]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
fchownat: fix recently introduced flag typo
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 22 Sep 2025 01:56:18 +0000 (18:56 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 22 Sep 2025 01:56:18 +0000 (18:56 -0700)
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2025-09/msg00282.html
* lib/fchownat.c (rpl_fchownat): Fix typo by passing
our flag to fstatat.

ChangeLog
lib/fchownat.c

index 27e3dea5472a8caba7b4d82b54923671f5bb3e6d..f61718951ef9ff0c809896c004ec1d4927799b48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-09-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       fchownat: fix recently introduced flag typo
+       Problem reported by Bruno Haible in:
+       https://lists.gnu.org/r/bug-gnulib/2025-09/msg00282.html
+       * lib/fchownat.c (rpl_fchownat): Fix typo by passing
+       our flag to fstatat.
+
 2025-09-21  Bruno Haible  <bruno@clisp.org>
 
        pthread-once: Improve configuration.
index cce3a7abd4a8a4b06216e9142ea3781ba7ec91f0..a5e8bb8f47a9153d9d9d8df82f817f6259686852 100644 (file)
@@ -135,7 +135,7 @@ rpl_fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag)
       || (CHOWN_TRAILING_SLASH_BUG
           && file[0] && file[strlen (file) - 1] == '/'))
     {
-      int r = fstatat (fd, file, &st, 0);
+      int r = fstatat (fd, file, &st, flag);
 
       /* EOVERFLOW means the file exists, which is all that the
          trailing slash check needs.  */