From 60f30dc2f06d619f9996c6d3ac3572c832f5c293 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 28 Apr 1996 19:01:02 +0000 Subject: [PATCH] make #uid work + some minor cleanup --- parse.lex | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/parse.lex b/parse.lex index 370c1e8dc..67fb26543 100644 --- a/parse.lex +++ b/parse.lex @@ -104,7 +104,7 @@ WORD [a-zA-Z0-9_-]+ } [:\,=\n] { - BEGIN 0; + BEGIN INITIAL; unput(*yytext); return(COMMAND); } /* end of command line args */ @@ -115,7 +115,7 @@ WORD [a-zA-Z0-9_-]+ return(COMMENT); } /* return newline */ -#.*\n { +#.*\n { ++sudolineno; LEXTRACE("\n"); return(COMMENT); @@ -128,7 +128,7 @@ WORD [a-zA-Z0-9_-]+ sawspace = FALSE; } /* quoted command line arg */ -[^:\,= \t\n#]+ { +[^:\,= \t\n]+ { LEXTRACE("ARG "); fill_args(yytext, yyleng, sawspace); sawspace = FALSE; @@ -164,15 +164,17 @@ NOPASSWD: { return(NOPASSWD); } -\+[a-zA-Z][a-zA-Z0-9_-]* { +\+{WORD} { + /* netgroup */ fill(yytext, yyleng); return(NETGROUP); - } + } -\%[a-zA-Z][a-zA-Z0-9_-]* { +\%{WORD} { + /* UN*X group */ fill(yytext, yyleng); return(USERGROUP); - } + } {OCTET}(\.{OCTET}){3} { fill(yytext, yyleng); @@ -205,15 +207,14 @@ NOPASSWD: { } } -#?[a-zA-Z0-9_-]+ { +#?{WORD} { /* username/uid that user can run command as */ - /* XXX - should we allow more than thse chars? */ fill(yytext, yyleng); LEXTRACE("NAME "); return(NAME); } -\) BEGIN 0; /* XXX - will newlines be treated correctly? */ +\) BEGIN INITIAL; /* XXX - will newlines be treated correctly? */ \/[^\,:=\\ \t\n#]+ { -- 2.49.0