From d2173d02916175b50b3734b5f90c9712a0493e63 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 21 Jul 1996 22:41:21 +0000 Subject: [PATCH] can't rely on cmnd_matches as much as I thought -- added some $$ stuff back in to prevent namespace pollution problems. --- parse.yacc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/parse.yacc b/parse.yacc index 448d5f950..0fdc060ec 100644 --- a/parse.yacc +++ b/parse.yacc @@ -156,6 +156,8 @@ void yyerror(s) %token ':' '=' ',' '!' '.' /* union member tokens */ %token ERROR +%type cmnd +%type opcmnd %type runasspec %type runaslist %type runasuser @@ -235,7 +237,7 @@ cmndspeclist : cmndspec ; cmndspec : runasspec nopasswd opcmnd { - if ($1 > 0 && cmnd_matches == TRUE) { + if ($1 > 0 && $3 == TRUE) { runas_matches = TRUE; if ($2 == TRUE) no_passwd = TRUE; @@ -261,6 +263,7 @@ opcmnd : cmnd { ; } cmnd_matches = FALSE; else if (cmnd_matched == FALSE) cmnd_matches = TRUE; + $$ = cmnd_matches; } ; @@ -315,6 +318,7 @@ cmnd : ALL { (void) puts("ALL"); cmnd_matches = TRUE; + $$ = TRUE; } | ALIAS { if (printmatches == TRUE && host_matches == TRUE && @@ -322,6 +326,7 @@ cmnd : ALL { (void) puts($1); if (find_alias($1, CMND)) { cmnd_matches = TRUE; + $$ = TRUE; } (void) free($1); } @@ -340,6 +345,7 @@ cmnd : ALL { if (command_matches(cmnd, (NewArgc > 1) ? &NewArgv[1] : NULL, $1.cmnd, $1.args)) { cmnd_matches = TRUE; + $$ = TRUE; } (void) free($1.cmnd);