]> granicus.if.org Git - sudo/commitdiff
fixed -u support with multiple user lists on a line
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 17 Jun 1996 16:16:11 +0000 (16:16 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 17 Jun 1996 16:16:11 +0000 (16:16 +0000)
parse.c
parse.yacc

diff --git a/parse.c b/parse.c
index 1316ccb5896b712110a313f7ae65ad9330387fc9..7e7cc01b56b7d9b9e1a5cd75685ecb347dc116c0 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -153,8 +153,7 @@ int validate(check_cmnd)
        while (top) {
            if (host_matches == TRUE)
                if (cmnd_matches == TRUE)
-                  if ((runas_matches == TRUE) ||
-                      (runas_matches != FALSE && !strcmp(runas_user, "root")))
+                  if (runas_matches == TRUE)
                        /*
                         * User was granted access to cmnd on host.
                         * If no passwd required return as such.
index 727a023bafd296391027b4ff98e4b5d15cdbda39..44d30f4365a1ad9513718e8276abca9b8de799be 100644 (file)
@@ -233,7 +233,7 @@ opcmndlist  :       opcmnd
                |       opcmndlist ',' opcmnd
                ;
 
-opcmnd         :  cmnd { ; } 
+opcmnd         :  cmnd { runas_matches = TRUE; } 
                |       '!' {
                            if (printmatches == TRUE && host_matches == TRUE
                                && user_matches == TRUE) {
@@ -259,8 +259,6 @@ opcmnd              :  cmnd { ; }
 runasspec      :       RUNAS runaslist chkcmnd {
                            if ($2 > 0 && $3 == TRUE) 
                                runas_matches = TRUE;
-                           else
-                               runas_matches = FALSE;
                        }
 
 runaslist      :       runasuser {