=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sudo/Attic/parse.yacc,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- src/usr.bin/sudo/Attic/parse.yacc 2007/11/02 19:16:47 1.18 +++ src/usr.bin/sudo/Attic/parse.yacc 2007/12/03 15:09:47 1.19 @@ -69,7 +69,7 @@ #endif /* HAVE_LSEARCH */ #ifndef lint -__unused static const char rcsid[] = "$Sudo: parse.yacc,v 1.204.2.8 2007/11/02 19:09:01 millert Exp $"; +__unused static const char rcsid[] = "$Sudo: parse.yacc,v 1.204.2.9 2007/11/21 18:15:49 millert Exp $"; #endif /* lint */ /* @@ -104,6 +104,9 @@ (_var) = NOMATCH; \ } while (0) +#define SETENV_RESET \ + if (setenv_ok == IMPLIED) setenv_ok = def_setenv ? TRUE : UNSPEC + /* * The matching stack, initial space allocated in init_parser(). */ @@ -440,7 +443,7 @@ | cmndspeclist ',' cmndspec ; -cmndspec : runasspec cmndtag opcmnd { +cmndspec : { SETENV_RESET; } runasspec cmndtag opcmnd { /* * Push the entry onto the stack if it is worth * saving and reset cmnd_matches for next cmnd. @@ -692,6 +695,9 @@ expand_match_list(); } } + /* sudo "ALL" implies the SETENV tag */ + if (setenv_ok == UNSPEC) + setenv_ok = IMPLIED; efree(safe_cmnd); safe_cmnd = NULL;