]> granicus.if.org Git - sudo/commitdiff
will now only running commands as root if there was no runas
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 28 Apr 1996 21:16:30 +0000 (21:16 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 28 Apr 1996 21:16:30 +0000 (21:16 +0000)
list (or if root is in the runas list)

parse.c

diff --git a/parse.c b/parse.c
index c21d29e3695d0784fab1a676e07b204151f6f7c3..c7a54e6ad76accf523eed5c0f93fd18bc4752ff5 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -145,8 +145,8 @@ int validate(check_cmnd)
        while (top) {
            if (host_matches == TRUE)
                if (cmnd_matches == TRUE)
-                  if (runas_user == NULL || 
-                       (runas_user != NULL && runas_matches == TRUE))
+                  if ((runas_matches == TRUE) ||
+                      (runas_matches != FALSE && !strcmp(runas_user, "root")))
                        /*
                         * User was granted access to cmnd on host.
                         * If no passwd required return as such.