]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Assume fchmod(2) exists
authorAlejandro Colomar <alx@kernel.org>
Fri, 2 Dec 2022 21:30:24 +0000 (22:30 +0100)
committerSerge Hallyn <serge@hallyn.com>
Thu, 15 Dec 2022 22:22:05 +0000 (16:22 -0600)
It is required by POSIX.1-2001.

Cc: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
configure.ac
lib/commonio.c

index ebb3b1b0c4366c84c313c22b2776d1c03ce31b6a..ae15ff8d8df56b215183867b826bc9da794f3698 100644 (file)
@@ -45,7 +45,7 @@ AC_CHECK_HEADERS(crypt.h utmp.h \
 dnl shadow now uses the libc's shadow implementation
 AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
 
-AC_CHECK_FUNCS(arc4random_buf fchmod fchown fsync futimes \
+AC_CHECK_FUNCS(arc4random_buf fchown fsync futimes \
        getentropy getrandom getspnam getusershell \
        getutent initgroups lckpwdf lutimes \
        setgroups updwtmp updwtmpx innetgr getpwnam_r \
index 9a02ce1acd9ae770aa31ca5bcc9164fc5fdaf328..df26c2b8b838e95d956bcd5b1101222fde056109 100644 (file)
@@ -261,15 +261,10 @@ static /*@null@*/ /*@dependent@*/FILE *fopen_set_perms (
        }
 #endif                         /* !HAVE_FCHOWN */
 
-#ifdef HAVE_FCHMOD
        if (fchmod (fileno (fp), sb->st_mode & 0664) != 0) {
                goto fail;
        }
-#else                          /* !HAVE_FCHMOD */
-       if (chmod (name, sb->st_mode & 0664) != 0) {
-               goto fail;
-       }
-#endif                         /* !HAVE_FCHMOD */
+
        return fp;
 
       fail: