Assume fchown(2) exists
It is required by POSIX.1-2001. Cc: Christian Göttsche <cgzones@googlemail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
parent
9c86e07067
commit
e71c23586a
@ -45,7 +45,7 @@ AC_CHECK_HEADERS(crypt.h utmp.h \
|
|||||||
dnl shadow now uses the libc's shadow implementation
|
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_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 \
|
getentropy getrandom getspnam getusershell \
|
||||||
getutent initgroups lckpwdf lutimes \
|
getutent initgroups lckpwdf lutimes \
|
||||||
setgroups updwtmp updwtmpx innetgr getpwnam_r \
|
setgroups updwtmp updwtmpx innetgr getpwnam_r \
|
||||||
|
@ -251,16 +251,9 @@ static /*@null@*/ /*@dependent@*/FILE *fopen_set_perms (
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_FCHOWN
|
|
||||||
if (fchown (fileno (fp), sb->st_uid, sb->st_gid) != 0) {
|
if (fchown (fileno (fp), sb->st_uid, sb->st_gid) != 0) {
|
||||||
goto fail;
|
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) {
|
if (fchmod (fileno (fp), sb->st_mode & 0664) != 0) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user