diff --git a/configure.ac b/configure.ac index a7388e79b..c6cdf8f23 100644 --- a/configure.ac +++ b/configure.ac @@ -49,7 +49,7 @@ AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])]) AC_CHECK_FUNCS(arc4random_buf futimes \ getentropy getrandom getspnam getusershell \ initgroups lckpwdf lutimes \ - setgroups updwtmpx innetgr \ + updwtmpx innetgr \ getspnam_r \ rpmatch \ memset_explicit explicit_bzero stpecpy stpeprintf) diff --git a/lib/addgrps.c b/lib/addgrps.c index 97c47e077..9eb59c583 100644 --- a/lib/addgrps.c +++ b/lib/addgrps.c @@ -9,7 +9,7 @@ #include -#if defined (HAVE_SETGROUPS) && ! defined (USE_PAM) +#if !defined(USE_PAM) #include "prototypes.h" #include "defines.h" @@ -110,7 +110,6 @@ add_groups(const char *list) free (grouplist); return 0; } -#else /* HAVE_SETGROUPS && !USE_PAM */ +#else /* !USE_PAM */ extern int ISO_C_forbids_an_empty_translation_unit; -#endif /* HAVE_SETGROUPS && !USE_PAM */ - +#endif /* !USE_PAM */ diff --git a/lib/prototypes.h b/lib/prototypes.h index 6b978a975..71bea819c 100644 --- a/lib/prototypes.h +++ b/lib/prototypes.h @@ -36,7 +36,7 @@ #include "commonio.h" /* addgrps.c */ -#if defined (HAVE_SETGROUPS) && ! defined (USE_PAM) +#if !defined(USE_PAM) extern int add_groups (const char *); #endif diff --git a/src/newgrp.c b/src/newgrp.c index f73508663..11194c873 100644 --- a/src/newgrp.c +++ b/src/newgrp.c @@ -38,10 +38,8 @@ static const char *Prog; extern char **newenvp; -#ifdef HAVE_SETGROUPS static int ngroups; static /*@null@*/ /*@only@*/GETGROUPS_T *grouplist; -#endif static bool is_newgrp; @@ -551,7 +549,6 @@ int main (int argc, char **argv) } } -#ifdef HAVE_SETGROUPS /* * get the current user's groupset. The new group will be added to * the concurrent groupset if there is room, otherwise you get a @@ -584,7 +581,6 @@ int main (int argc, char **argv) #endif exit (EXIT_FAILURE); } -#endif /* HAVE_SETGROUPS */ /* * now we put her in the new group. The password file entry for her @@ -632,7 +628,6 @@ int main (int argc, char **argv) goto failure; } -#ifdef HAVE_SETGROUPS /* when using pam_group, she will not be listed in the groups * database. However getgroups() will return the group. So * if she is listed there already it is ok to grant membership. @@ -643,7 +638,7 @@ int main (int argc, char **argv) break; } } -#endif /* HAVE_SETGROUPS */ + /* * For split groups (due to limitations of NIS), check all * groups of the same GID like the requested group for @@ -688,7 +683,6 @@ int main (int argc, char **argv) gid = grp->gr_gid; -#ifdef HAVE_SETGROUPS /* * I am going to try to add her new group id to her concurrent group * set. If the group id is already present I'll just skip this part. @@ -710,7 +704,6 @@ int main (int argc, char **argv) } } } -#endif /* * Close all files before changing the user/group IDs.