From: Todd C. Miller Date: Sun, 30 Dec 2001 22:12:06 +0000 (+0000) Subject: Allow '@', '(', ')', ':' in arguments to a defaults variable X-Git-Tag: SUDO_1_6_4~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d5c6783d936ade4058f419adc3bcf9b22d9aa98;p=sudo Allow '@', '(', ')', ':' in arguments to a defaults variable w/o requiring that they be quoted. --- diff --git a/parse.lex b/parse.lex index 7748884f2..bdb5b6745 100644 --- a/parse.lex +++ b/parse.lex @@ -101,6 +101,7 @@ OCTET (1?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]) DOTTEDQUAD {OCTET}(\.{OCTET}){3} HOSTNAME [[:alnum:]_-]+ WORD ([^#@!=:,\(\) \t\n\\]|\\[^\n])+ +ENVAR ([^#!=, \t\n\\]|\\[^\n])([^#=, \t\n\\]|\\[^\n])* DEFVAR [a-z_]+ /* XXX - convert GOTRUNAS to exclusive state (GOTDEFS cannot be) */ @@ -147,6 +148,12 @@ DEFVAR [a-z_]+ fill(yytext + 1, yyleng - 2); return(WORD); } + + {ENVAR} { + LEXTRACE("WORD(2) "); + fill(yytext, yyleng); + return(WORD); + } } { @@ -261,7 +268,7 @@ PASSWD[[:blank:]]*: { (#[0-9-]+|{WORD}) { /* username/uid that user can run command as */ fill(yytext, yyleng); - LEXTRACE("WORD(2) "); + LEXTRACE("WORD(3) "); return(WORD); } @@ -282,10 +289,10 @@ PASSWD[[:blank:]]*: { } } /* a pathname */ -{WORD} { +{WORD} { /* a word */ fill(yytext, yyleng); - LEXTRACE("WORD(3) "); + LEXTRACE("WORD(4) "); return(WORD); }