]> Savannah Git Hosting - gnulib.git/commit
fchmodat: port better to MS-Windows etc.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 12 Jun 2022 20:46:52 +0000 (13:46 -0700)
committerBruno Haible <bruno@clisp.org>
Wed, 31 Aug 2022 23:13:19 +0000 (01:13 +0200)
commit2e401687bf8a09459dd58427f5348eedd95ba1c5
tree6a0b4d4807ff3df8d8e3fb1bb55332b50e3a4c43
parent09966280b769d217deedc9b794539508a7899673
fchmodat: port better to MS-Windows etc.

MS-Windows problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00041.html
Although I don’t use MS-Windows I see some related fstatat etc.
problems and am trying to fix them with this further patch.
* lib/fchmodat.c (fchmodat):
* lib/lchmod.c (lchmod):
* lib/lchown.c (lchown)
[!HAVE_LCHOWN && HAVE_CHOWN && !CHOWN_MODIFIES_SYMLINK]:
* lib/renameatu.c (renameatu)
[HAVE_RENAME && RENAME_TRAILING_SLASH_SOURCE_BUG]:
Use readlinkat/readlink instead of fstatat/lstat to test merely
whether a string names a symlink, as this avoids problems
with EOVERFLOW.  Also, I hope it works around the MS-Windows
issues that Bruno noted.
* m4/fchmodat.m4 (gl_PREREQ_FCHMODAT):
Check for readlinkat, not lchmod.
* m4/lchmod.m4 (gl_FUNC_LCHMOD): Do not require AC_CANONICAL_HOST
or check for lstat.
(gl_PREREQ_LCHMOD): Check for readlink.
* modules/lchown (Depends-on): Add readlink.  Do not depend on
lstat merely because !HAVE_LCHOWN.
* modules/renameatu (Depends-on): Add fstatat, readlinkat.
ChangeLog
lib/fchmodat.c
lib/lchmod.c
lib/lchown.c
lib/renameatu.c
m4/fchmodat.m4
m4/lchmod.m4
modules/lchown
modules/renameatu