diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2023-03-23 18:17:49 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2023-03-23 18:17:49 -0400 |
commit | 11a0a8b529caeab101206ec4a33af95bb4445746 (patch) | |
tree | 9bfca3e79f13570170502caaa9c01fc7489c3f70 /src/backend/utils/adt/pgstatfuncs.c | |
parent | eb2618a03c53695532eaad680522c60dca0d4061 (diff) | |
download | postgresql-11a0a8b529caeab101206ec4a33af95bb4445746.tar.gz postgresql-11a0a8b529caeab101206ec4a33af95bb4445746.zip |
Implement find_my_exec()'s path normalization using realpath(3).
Replace the symlink-chasing logic in find_my_exec with realpath(3),
which has been required by POSIX since SUSv2. (Windows lacks
realpath(), but there we can use _fullpath() which is functionally
equivalent.) The main benefit of this is that -- on all modern
platforms at least -- realpath() avoids the chdir() shenanigans
we used to perform while interpreting symlinks. That had various
corner-case failure modes so it's good to get rid of it.
There is still ongoing discussion about whether we could skip the
replacement of symlinks in some cases, but that's really matter
for a separate patch. Meanwhile I want to push this before we get
too close to feature freeze, so that we can find out if there are
showstopper portability issues.
Discussion: https://postgr.es/m/797232.1662075573@sss.pgh.pa.us
Diffstat (limited to 'src/backend/utils/adt/pgstatfuncs.c')
0 files changed, 0 insertions, 0 deletions