]> granicus.if.org Git - sudo/commitdiff
was setting runas_matches to -1 in wrong place
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 8 Jul 1996 14:21:18 +0000 (14:21 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 8 Jul 1996 14:21:18 +0000 (14:21 +0000)
parse.yacc

index bd94c1b2609e731a7a641b205472519a54e8a4c5..3ab204e375006bebfcbd8c87f57487383f6f52de 100644 (file)
@@ -158,7 +158,7 @@ void yyerror(s)
 
 %type <BOOLEAN>         cmnd
 %type <BOOLEAN>         runasspec
-%type <BOOLEAN>         runaslist 
+%type <BOOLEAN>         runaslist
 %type <BOOLEAN>         runasuser
 %type <BOOLEAN>         nopassreq
 %type <BOOLEAN>         chkcmnd
@@ -229,16 +229,13 @@ hostspec  :       ALL {
                        }
                ;
 
-opcmndlist     :       { no_passwd = runas_matches = -1; } opcmnd
-               |       opcmndlist ',' {
-                           no_passwd = runas_matches = -1;
-                       } opcmnd
+opcmndlist     :       { no_passwd = -1; } opcmnd
+               |       opcmndlist ',' { no_passwd = -1; } opcmnd
                ;
 
 opcmnd         :       cmnd {
-                           if (strcmp("root", runas_user) == 0)
-                               runas_matches = TRUE;
-                       } 
+                           runas_matches = (strcmp("root", runas_user) == 0);
+                       }
                |       '!' {
                            if (printmatches == TRUE && host_matches == TRUE
                                && user_matches == TRUE) {
@@ -262,8 +259,7 @@ opcmnd              :       cmnd {
                ;
 
 runasspec      :       RUNAS runaslist chkcmnd {
-                           if ($2 > 0 && $3 == TRUE) 
-                               runas_matches = TRUE;
+                           runas_matches = ($2 > 0 && $3 == TRUE);
                        }
 
 runaslist      :       runasuser {