]> granicus.if.org Git - sudo/commitdiff
Add configure check for getgroups()
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 16 Nov 2004 23:59:56 +0000 (23:59 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 16 Nov 2004 23:59:56 +0000 (23:59 +0000)
config.h.in
configure
configure.in
sudo.c

index 7935afdde18ea9a7be91e17c7a7ba852a78b0569..c60cbc6b186499ff567f785e41571f849c7c0234 100644 (file)
 /* Define to 1 if you have the `getdomainname' function. */
 #undef HAVE_GETDOMAINNAME
 
+/* Define to 1 if you have the `getgroups' function. */
+#undef HAVE_GETGROUPS
+
 /* Define to 1 if you have the `getifaddrs' function. */
 #undef HAVE_GETIFADDRS
 
index 84a4e4422ac02431480aa24d831796a23d48430a..3d3abf638bb848d30ea0aae55d789ea2f210440e 100755 (executable)
--- a/configure
+++ b/configure
@@ -25609,8 +25609,9 @@ esac
 
 
 
+
 for ac_func in strchr strrchr memchr memcpy memset sysconf tzset \
-              strftime setrlimit initgroups fstat
+              strftime setrlimit initgroups getgroups fstat
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
index 3bdd03cfb7a48be54e917bdcad8d989c2f3f277d..62cf1d7024ae42ee66501d106ce0e4d8138e7c34 100644 (file)
@@ -1674,7 +1674,7 @@ dnl
 dnl Function checks
 dnl
 AC_CHECK_FUNCS(strchr strrchr memchr memcpy memset sysconf tzset \
-              strftime setrlimit initgroups fstat)
+              strftime setrlimit initgroups getgroups fstat)
 if test -z "$SKIP_SETRESUID"; then
     AC_CHECK_FUNCS(setresuid, [SKIP_SETREUID=yes])
 fi
diff --git a/sudo.c b/sudo.c
index bc40007a563c533fa82a20986df44962e595bac0..94027508136bc465effe805119cd891f4d4f639c 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -553,11 +553,13 @@ init_vars(sudo_mode)
 
     /* It is now safe to use log_error() and set_perms() */
 
+#ifdef HAVE_GETGROUPS
     if ((user_ngroups = getgroups(0, NULL)) > 0) {
        user_groups = emalloc2(user_ngroups, sizeof(gid_t));
        if (getgroups(user_ngroups, user_groups) < 0)
            log_error(USE_ERRNO|MSG_ONLY, "can't get group vector");
     }
+#endif
 
     if (def_fqdn)
        set_fqdn();                     /* may call log_error() */