]> granicus.if.org Git - sudo/commitdiff
Add check for initgroups() since old SYSV lacks this.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 9 Dec 1999 04:04:47 +0000 (04:04 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 9 Dec 1999 04:04:47 +0000 (04:04 +0000)
config.h.in
configure
configure.in
sudo.c

index 7b5df580f62052dd28ebe75322250b5c598ecde1..cea16fe193097ea8af478ecabea0fd6be0f31070 100644 (file)
 /* Define if you have innetgr(3).  */
 #undef HAVE_INNETGR
 
+/* Define if you have initgroups(3).  */
+#undef HAVE_INITGROUPS
+
 /* Define if you have getdomainname(2).  */
 #undef HAVE_GETDOMAINNAME
 
index 5f60af6be3fde9f26e6ab2062fbf704827b9aeb7..e3240583453d93a1e9093df833dbdc7596e34289 100755 (executable)
--- a/configure
+++ b/configure
@@ -5403,7 +5403,7 @@ EOF
 
 ;;
 esac
-for ac_func in strchr strrchr memchr memcpy memset sysconf sigaction tzset seteuid ftruncate strftime setrlimit
+for ac_func in strchr strrchr memchr memcpy memset sysconf sigaction tzset seteuid ftruncate strftime setrlimit initgroups
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 echo "configure:5410: checking for $ac_func" >&5
index b3bafa75fc8a8699aeb7581a800df2d7f5bc5a5e..93b1acdb9fe0f3bcd6c85f4f7563ce744e6d3ded 100644 (file)
@@ -1333,7 +1333,7 @@ esac
 dnl
 dnl Function checks
 dnl
-AC_CHECK_FUNCS(strchr strrchr memchr memcpy memset sysconf sigaction tzset seteuid ftruncate strftime setrlimit)
+AC_CHECK_FUNCS(strchr strrchr memchr memcpy memset sysconf sigaction tzset seteuid ftruncate strftime setrlimit initgroups)
 if test -n "$SECUREWARE"; then
     AC_CHECK_FUNCS(bigcrypt)
     AC_CHECK_FUNCS(set_auth_parameters)
diff --git a/sudo.c b/sudo.c
index 38e0bc30b23288c55128efab56d811b972153cbe..4ecc05aa7f5a325fc4b24bafb41d5a451631e7ce 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -929,7 +929,7 @@ set_perms(perm, sudo_mode)
                                            strerror(errno));
                                        exit(1);
                                    }
-
+#ifdef HAVE_INITGROUPS
                                    /*
                                     * Initialize group vector only if are
                                     * going to run as a non-root user.
@@ -942,7 +942,7 @@ set_perms(perm, sudo_mode)
                                            Argv[0], strerror(errno));
                                        exit(1);
                                    }
-
+#endif /* HAVE_INITGROUPS */
                                    if (setuid(pw->pw_uid)) {
                                        (void) fprintf(stderr,
                                            "%s: cannot set uid to %ld: %s\n",