From: Alejandro Colomar Date: Fri, 2 Dec 2022 21:31:38 +0000 (+0100) Subject: Assume fchown(2) exists X-Git-Tag: 4.14.0-rc1~286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e71c23586a8921b6c5feab5bffa5d3d11e546a74;p=thirdparty%2Fshadow.git Assume fchown(2) exists It is required by POSIX.1-2001. Cc: Christian Göttsche Signed-off-by: Alejandro Colomar --- diff --git a/configure.ac b/configure.ac index ae15ff8d8..56fa3fb48 100644 --- a/configure.ac +++ b/configure.ac @@ -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 fchown fsync futimes \ +AC_CHECK_FUNCS(arc4random_buf fsync futimes \ getentropy getrandom getspnam getusershell \ getutent initgroups lckpwdf lutimes \ setgroups updwtmp updwtmpx innetgr getpwnam_r \ diff --git a/lib/commonio.c b/lib/commonio.c index df26c2b8b..7234e613f 100644 --- a/lib/commonio.c +++ b/lib/commonio.c @@ -251,16 +251,9 @@ static /*@null@*/ /*@dependent@*/FILE *fopen_set_perms ( return NULL; } -#ifdef HAVE_FCHOWN if (fchown (fileno (fp), sb->st_uid, sb->st_gid) != 0) { goto fail; } -#else /* !HAVE_FCHOWN */ - if (chown (name, sb->st_mode) != 0) { - goto fail; - } -#endif /* !HAVE_FCHOWN */ - if (fchmod (fileno (fp), sb->st_mode & 0664) != 0) { goto fail; }