2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Add a configure option to turn off use of POSIX saved IDs

This commit is contained in:
Todd C. Miller
2002-01-15 22:47:29 +00:00
parent 62233923e0
commit f039427253
6 changed files with 53 additions and 19 deletions

4
sudo.c
View File

@@ -260,7 +260,7 @@ main(argc, argv, envp)
* set the real, effective and saved uids to 0 and use set_perms_fallback()
* instead of set_perms_posix().
*/
#if defined(_SC_SAVED_IDS) && defined(_SC_VERSION)
#if !defined(NO_SAVED_IDS) && defined(_SC_SAVED_IDS) && defined(_SC_VERSION)
if (!def_flag(I_STAY_SETUID) && set_perms == set_perms_posix) {
if (setuid(0)) {
perror("setuid(0)");
@@ -888,7 +888,7 @@ initial_setup()
(void) sigaction(SIGCHLD, &sa, NULL);
/* Set set_perms pointer to the correct function */
#if defined(_SC_SAVED_IDS) && defined(_SC_VERSION)
#if !defined(NO_SAVED_IDS) && defined(_SC_SAVED_IDS) && defined(_SC_VERSION)
if (sysconf(_SC_SAVED_IDS) == 1 && sysconf(_SC_VERSION) >= 199009)
set_perms = set_perms_posix;
else