]> Savannah Git Hosting - gnulib.git/commit
fchmodat: port to old Linux kernel + newer headers
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 11 Jun 2022 23:58:25 +0000 (16:58 -0700)
committerBruno Haible <bruno@clisp.org>
Wed, 31 Aug 2022 23:09:35 +0000 (01:09 +0200)
commit09966280b769d217deedc9b794539508a7899673
tree28dd77efdeaffbb77294ff099fac65a48cfe0f8d
parent4ead384ff3b04f3ad91c00d02b82e43cd2f84630
fchmodat: port to old Linux kernel + newer headers

Problem reported by Lance Fredrickson in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00038.html
* lib/fchmodat.c (fchmodat):
* lib/lchmod.c (lchmod): Do not rely on AT_EMPTY_PATH as to
whether syscalls work on ""; instead, if a call fails with
ENOENT assume that those syscalls do not work.
Do not use fstatat to determine whether a file is a symlink,
as this has problems with EOVERFLOW.  Use readlinkat instead,
and if it fails with EINVAL then the file is not a symlink.
Remove #if tests on __linux__ || __ANDROID__ || __CYGWIN__
as this has been a maintenance hassle and it’s unlikely
these days that a new platform would #define O_PATH without also
either supporting /proc or keeping it absent.
* modules/fchmodat (Depends-on): Remove fstatat.
There should be no need for either fchmodat or lchmod to depend on
readlinkat, since they use readlinkat only in contexts where it
should work without Gnulib intervention.
ChangeLog
lib/fchmodat.c
lib/lchmod.c
modules/fchmodat