Re: Checking pgwin32_is_junction() errors

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Michael Paquier <michael@paquier.xyz>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-08-05T09:17:45Z
Lists: pgsql-hackers

Attachments

On Thu, Aug 4, 2022 at 9:42 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> On Thu, Aug 4, 2022 at 9:28 AM Andrew Dunstan <andrew@dunslane.net> wrote:
> > On 2022-08-01 Mo 16:06, Andrew Dunstan wrote:
> > > I'll try it out on fairywren/drongo.
>
> > They are happy with patches 2, 3, and 4.
>
> Thanks for testing!
>
> If there are no objections, I'll go ahead and commit these later today.

Hmm, POSIX says st_link should contain the length of a symlink's
target path, so I suppose we should probably set that even though we
never consult it.  Here's a version that does that.  I also removed
the rest of the now redundant #ifdef S_ISLNK conditions.

Commits

  1. Fix readlink() for non-PostgreSQL junction points on Windows.

  2. Fix stat() for recursive junction points on Windows.

  3. aix: fix misreading of condition in 8f12a4e7add

  4. Make unlink() work for junction points on Windows.

  5. Replace pgwin32_is_junction() with lstat().

  6. Provide lstat() for Windows.