pgsql: Fix stat() for recursive junction points on Windows.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix stat() for recursive junction points on Windows.
Date: 2025-01-18 14:34:48
Message-ID: E1tZ9uS-002Ewd-Jx@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix stat() for recursive junction points on Windows.

Commit c5cb8f3b supposed that we'd only ever have to follow one junction
point in stat(), because we don't construct longer chains of them ourselves.
When examining a parent directory supplied by the user, we should really be
able to cope with longer chains, just in case someone has their system
set up that way. Choose an arbitrary cap of 8, to match the minimum
acceptable value of SYMLOOP_MAX in POSIX.

Previously I'd avoided reporting ELOOP thinking Windows didn't have it,
but it turns out that it does, so we can use the proper error number.

Reviewed-by: Roman Zharkov <r(dot)zharkov(at)postgrespro(dot)ru>
Discussion: https://postgr.es/m/CA%2BhUKGJ7JDGWYFt9%3D-TyJiRRy5q9TtPfqeKkneWDr1XPU1%2Biqw%40mail.gmail.com
Discussion: https://postgr.es/m/CA%2BhUKG%2BajSQ_8eu2AogTncOnZ5me2D-Cn66iN_-wZnRjLN%2Bicg%40mail.gmail.com

Backpatched commit 4517358e as above by Thomas Munro into releases 13 thru 15

Discussion: https://postgr.es/m/CA+hUKGLbnv+pe3q1fYOVkLD3pMra7GuihfMxUN-1831YH9RYQg@mail.gmail.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e708f31881fd767af6d665968f6124ab82a08962
Author: Thomas Munro <tmunro(at)postgresql(dot)org>

Modified Files
--------------
src/port/win32stat.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2025-01-19 14:20:27 pgsql: Be clearer about when jsonapi's need_escapes is needed
Previous Message Jeff Davis 2025-01-17 23:59:48 pgsql: Support PG_UNICODE_FAST locale in the builtin collation provider