From: Todd C. Miller Date: Mon, 8 Jul 1996 14:21:18 +0000 (+0000) Subject: was setting runas_matches to -1 in wrong place X-Git-Tag: SUDO_1_5_0~115 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11f5b7788036933ff19db846fffb1dc8e367608e;p=sudo was setting runas_matches to -1 in wrong place --- diff --git a/parse.yacc b/parse.yacc index bd94c1b26..3ab204e37 100644 --- a/parse.yacc +++ b/parse.yacc @@ -158,7 +158,7 @@ void yyerror(s) %type cmnd %type runasspec -%type runaslist +%type runaslist %type runasuser %type nopassreq %type 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 {