diff options
author | Thomas Munro <tmunro@postgresql.org> | 2022-10-25 15:21:42 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2022-10-25 16:19:05 +1300 |
commit | f71007fbb3b83fba21daae9144cc07e205f2365c (patch) | |
tree | 6249a93231e4b23f584ea52123c4b0714fc1e44b /src/backend/access/transam/clog.c | |
parent | 387803d81d6256fcb60b9192bb5b00042442b4e3 (diff) | |
download | postgresql-f71007fbb3b83fba21daae9144cc07e205f2365c.tar.gz postgresql-f71007fbb3b83fba21daae9144cc07e205f2365c.zip |
Fix readlink() for non-PostgreSQL junction points on Windows.
Since commit c5cb8f3b taught stat() to follow symlinks, and since initdb
uses pg_mkdir_p(), and that examines parent directories, our humble
readlink() implementation can now be exposed to junction points not of
PostgreSQL origin. Those might be corrupted by our naive path mangling,
which doesn't really understand NT paths in general.
Simply decline to transform paths that don't look like a drive absolute
path. That means that readlink() returns the NT path directly when
checking a parent directory of PGDATA that happen to point to a drive
using "rooted" format. That works for the purposes of our stat()
emulation.
Reported-by: Roman Zharkov <r.zharkov@postgrespro.ru>
Reviewed-by: Roman Zharkov <r.zharkov@postgrespro.ru>
Discussion: https://postgr.es/m/4590c37927d7b8ee84f9855d83229018%40postgrespro.ru
Discussion: https://postgr.es/m/CA%2BhUKG%2BajSQ_8eu2AogTncOnZ5me2D-Cn66iN_-wZnRjLN%2Bicg%40mail.gmail.com
Diffstat (limited to 'src/backend/access/transam/clog.c')
0 files changed, 0 insertions, 0 deletions