Re: pg_basebackup check vs Windows file path limits
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Daniel Gustafsson <daniel@yesql.se>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2023-11-15T11:34:58Z
Lists: pgsql-hackers
On 2023-Nov-13, Andrew Dunstan wrote: > > size? > > > > https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-deviceiocontrol > > Hmm, here's what that page says - I can't see it saying what you're > suggesting here - am I missing something?: I don't think so. I think I just confused myself. Reading the docs it appears that other Windows APIs work as I described, but not this one. Anyway, after looking at it a bit more, I realized that this code uses MAX_PATH as basis for its buffer's length limit -- and apparently on Windows that's only 260, much shorter than MAXPGPATH (1024) which our own code uses to limit the buffers given to readlink(). So maybe fixing this is just a matter of doing s/MAX_PATH/MAXPGPATH/ in dirmod.c. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Commits
-
Skip pg_baseback long filename test if path too long on Windows
- b94d70a632aa 16.0 landed
- 2e99ce68bcd2 11.21 landed
- 2d3983aea5db 12.16 landed
- 9ebe6fdc5c68 13.12 landed
- fb0f05576a0a 14.9 landed
- c0cb12f9e7b3 15.4 landed
- 1fa25ce70f09 17.0 landed