]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
configure.ac, lib/: Assume initgroups(3) exists
authorAlejandro Colomar <alx@kernel.org>
Sat, 16 Nov 2024 13:02:08 +0000 (14:02 +0100)
committerSerge Hallyn <serge@hallyn.com>
Fri, 24 Jan 2025 01:50:01 +0000 (19:50 -0600)
It's available in every system I checked: glibc,musl,{Free,Net,Open}BSD.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
configure.ac
lib/age.c
lib/prototypes.h
lib/setugid.c

index c6cdf8f23f5b0c5b1fa49ee5341ad732a1426754..4e31d571209d340619b278c748915920c9501f56 100644 (file)
@@ -48,7 +48,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 \
+       lckpwdf lutimes \
        updwtmpx innetgr \
        getspnam_r \
        rpmatch \
index 72a13eab51bcc6023ef5dcc96bb7e1808424043e..ff2aebe2bd8fed1a8de8b12f6705ca47c670e82b 100644 (file)
--- a/lib/age.c
+++ b/lib/age.c
@@ -106,7 +106,7 @@ int expire (const struct passwd *pw, /*@null@*/const struct spwd *sp)
                 * passwd to work just like it would had they executed
                 * it from the command line while logged in.
                 */
-#if defined(HAVE_INITGROUPS) && ! defined(USE_PAM)
+#if !defined(USE_PAM)
                if (setup_uid_gid (pw, false) != 0)
 #else
                if (setup_uid_gid (pw) != 0)
index 71bea819c9c506d99db6b4d4b506818aea62a834..f85c14663db1332afb063db325dcfa3bc55cfc14 100644 (file)
@@ -384,7 +384,7 @@ extern int del_seuser(const char *login_name);
 /* setugid.c */
 extern int setup_groups (const struct passwd *info);
 extern int change_uid (const struct passwd *info);
-#if (defined HAVE_INITGROUPS) && (! defined USE_PAM)
+#if !defined(USE_PAM)
 extern int setup_uid_gid (const struct passwd *info, bool is_console);
 #else
 extern int setup_uid_gid (const struct passwd *info);
index 6dbe38ee17bef61c78e26e158884046393e34f3d..cfe63e0055458a784c78a72401bedf6e99d1024e 100644 (file)
@@ -47,7 +47,7 @@ int setup_groups (const struct passwd *info)
                closelog ();
                return -1;
        }
-#ifdef HAVE_INITGROUPS
+
        /*
         * For systems which support multiple concurrent groups, go get
         * the group set from the /etc/group file.
@@ -60,7 +60,7 @@ int setup_groups (const struct passwd *info)
                closelog ();
                return -1;
        }
-#endif
+
        return 0;
 }
 
@@ -96,7 +96,7 @@ int change_uid (const struct passwd *info)
  *     Returns 0 on success, or -1 on failure.
  */
 
-#if defined (HAVE_INITGROUPS) && ! (defined USE_PAM)
+#if !defined(USE_PAM)
 int setup_uid_gid (const struct passwd *info, bool is_console)
 #else
 int setup_uid_gid (const struct passwd *info)
@@ -106,7 +106,7 @@ int setup_uid_gid (const struct passwd *info)
                return -1;
        }
 
-#if defined (HAVE_INITGROUPS) && ! defined (USE_PAM)
+#if !defined(USE_PAM)
        if (is_console) {
                const char *cp = getdef_str ("CONSOLE_GROUPS");
 
@@ -114,7 +114,7 @@ int setup_uid_gid (const struct passwd *info)
                        perror ("Warning: add_groups");
                }
        }
-#endif                         /* HAVE_INITGROUPS && !USE_PAM*/
+#endif  // !USE_PAM
 
        if (change_uid (info) < 0) {
                return -1;