2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-02 15:25:58 +00:00

Add check for initgroups() since old SYSV lacks this.

This commit is contained in:
Todd C. Miller
1999-12-09 04:04:47 +00:00
parent 957fa7941d
commit ac67ced558
4 changed files with 7 additions and 4 deletions

View File

@@ -188,6 +188,9 @@
/* Define if you have innetgr(3). */ /* Define if you have innetgr(3). */
#undef HAVE_INNETGR #undef HAVE_INNETGR
/* Define if you have initgroups(3). */
#undef HAVE_INITGROUPS
/* Define if you have getdomainname(2). */ /* Define if you have getdomainname(2). */
#undef HAVE_GETDOMAINNAME #undef HAVE_GETDOMAINNAME

2
configure vendored
View File

@@ -5403,7 +5403,7 @@ EOF
;; ;;
esac 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 do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5410: checking for $ac_func" >&5 echo "configure:5410: checking for $ac_func" >&5

View File

@@ -1333,7 +1333,7 @@ esac
dnl dnl
dnl Function checks dnl Function checks
dnl 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 if test -n "$SECUREWARE"; then
AC_CHECK_FUNCS(bigcrypt) AC_CHECK_FUNCS(bigcrypt)
AC_CHECK_FUNCS(set_auth_parameters) AC_CHECK_FUNCS(set_auth_parameters)

4
sudo.c
View File

@@ -929,7 +929,7 @@ set_perms(perm, sudo_mode)
strerror(errno)); strerror(errno));
exit(1); exit(1);
} }
#ifdef HAVE_INITGROUPS
/* /*
* Initialize group vector only if are * Initialize group vector only if are
* going to run as a non-root user. * going to run as a non-root user.
@@ -942,7 +942,7 @@ set_perms(perm, sudo_mode)
Argv[0], strerror(errno)); Argv[0], strerror(errno));
exit(1); exit(1);
} }
#endif /* HAVE_INITGROUPS */
if (setuid(pw->pw_uid)) { if (setuid(pw->pw_uid)) {
(void) fprintf(stderr, (void) fprintf(stderr,
"%s: cannot set uid to %ld: %s\n", "%s: cannot set uid to %ld: %s\n",