]> granicus.if.org Git - sudo/commitdiff
took out setuid(0) and setreuid(udi) garbage. Its not needed since
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 27 Jan 1994 18:19:28 +0000 (18:19 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 27 Jan 1994 18:19:28 +0000 (18:19 +0000)
we start out setuid with the correct perms.

check.c
sudo.c

diff --git a/check.c b/check.c
index 4a24a6b996308ab9b4ccce5cb57ef54d1efff5e4..0f0fda177c6ad7aa4178697e59718c23566d7b5e 100644 (file)
--- 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 123a88a3dce39901a3d4ddd3eef5ac843a9b83cb..03d98488fb3451fd297a676e6c4ed4b83918819f 100644 (file)
--- 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: