From: Todd C. Miller Date: Thu, 27 Jan 1994 18:19:28 +0000 (+0000) Subject: took out setuid(0) and setreuid(udi) garbage. Its not needed since X-Git-Tag: SUDO_1_3_0~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9fe5184668bae1b70467d6083bccbba939376d08;p=sudo took out setuid(0) and setreuid(udi) garbage. Its not needed since we start out setuid with the correct perms. --- diff --git a/check.c b/check.c index 4a24a6b99..0f0fda177 100644 --- a/check.c +++ b/check.c @@ -77,33 +77,11 @@ void check_user() umask(077); /* make sure the timestamp files are private */ - if (setuid(0)) { /* have to be root to see timestamps */ - perror("setuid(0)"); - exit(1); - } rtn = check_timestamp(); - /* don't want to be root longer than necessary */ - if (setreuid(uid, (uid_t)-1)) { -#ifndef _AIX - perror("setreuid()"); - exit(1); -#endif - } if (rtn && uid) /* if timestamp is not current... */ check_passwd(); - if (setuid(0)) { /* have to be root to play with timestamps */ - perror("setuid(0)"); - exit(1); - } update_timestamp(); - /* don't want to be root longer than necessary */ - if (setreuid(uid, (uid_t)-1)) { -#ifndef _AIX - perror("setreuid()"); - exit(1); -#endif - } umask(022); /* want a real umask to exec() the command */ } diff --git a/sudo.c b/sudo.c index 123a88a3d..03d98488f 100644 --- a/sudo.c +++ b/sudo.c @@ -126,17 +126,7 @@ main(argc, argv, envp) clean_envp(envp); /* build Envp based on envp (w/o LD_*) */ - if (setuid(0)) { - perror("setuid(0)"); - exit(1); - } rtn = validate(); - if (setreuid(uid, (uid_t)-1)) { -#ifndef _AIX - perror("setreuid()"); - exit(1); -#endif - } switch (rtn) { case VALIDATE_OK: