]> granicus.if.org Git - sudo/commitdiff
now set uid to 1 instead of nobody for PERM_SUDOERS since nobody
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 25 Jun 1996 23:32:09 +0000 (23:32 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 25 Jun 1996 23:32:09 +0000 (23:32 +0000)
is not always set to a valid uid.

sudo.c

diff --git a/sudo.c b/sudo.c
index 39ae5b632639fa940d5d7c47aad5e59a27e40acb..4e5aa8a24b50654d3b5e5ae6caba15b89c2ea74e 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -893,19 +893,17 @@ void set_perms(perm)
                                /*
                                 * If SUDOERS_UID == 0 we need to use
                                 * a different uid in order to avoid
-                                * NFS lossage.  Sigh.
+                                * NFS lossage.  Using uid 1 is a bit
+                                * bogus but should be safe.
                                 */
-                               if (SUDOERS_UID) {
-                                   if (seteuid(SUDOERS_UID)) {
-                                       perror("seteuid(SUDOERS_UID)");
+                               if (SUDOERS_UID == 0) {
+                                   if (seteuid(1)) {
+                                       perror("seteuid(1)");
                                        exit(1);
                                    }
                                } else {
-                                   if (!(pw_ent = getpwnam("nobody")))
-                                       pw_ent->pw_uid = (uid_t) -2;
-
-                                   if (seteuid(pw_ent->pw_uid)) {
-                                       perror("seteuid(nobody)");
+                                   if (seteuid(SUDOERS_UID)) {
+                                       perror("seteuid(SUDOERS_UID)");
                                        exit(1);
                                    }
                                }