From f104cc2dd126f8862e70c08764497ad96fec953c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 31 Mar 1995 23:08:15 +0000 Subject: [PATCH] better hack from Chris (but still a hack) --- parse.yacc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/parse.yacc b/parse.yacc index ac4102af3..ca06dc9e3 100644 --- a/parse.yacc +++ b/parse.yacc @@ -59,7 +59,7 @@ static char rcsid[] = "$Id$"; extern int sudolineno, parse_error; int errorlineno = -1; -static char *userent; +static int user_matched; /* * Alias types @@ -141,7 +141,9 @@ entry : COMMENT { ; } | error COMMENT { yyerrok; } - | NAME { userent = $1; } privileges + | NAME { + user_matched = ($1, user) == 0; + } privileges | HOSTALIAS hostaliases { ; } | CMNDALIAS cmndaliases @@ -154,8 +156,9 @@ privileges : privilege ; privilege : { push; } hostspec '=' opcmndlist { - user_matches = strcmp(user, userent) == 0; - if (!user_matches) + if (user_matched) + user_matches = TRUE; + else pop; } ; -- 2.40.0