%option nounput
%option noyywrap
-/* XXX - convert GOTRUNAS to exclusive state (GOTDEFS cannot be) */
-%s GOTRUNAS
%s GOTDEFS
%x GOTCMND
%x STARTDEFS
}
<INITIAL>^#include[[:blank:]]+\/.*\n {
+ /* XXX - handle include lines in grammar */
char *cp, *ep;
++sudolineno;
/* pull out path from #include line */
return(USERALIAS);
case 'R':
LEXTRACE("RUNASALIAS ");
- BEGIN GOTRUNAS;
return(RUNASALIAS);
}
}
return(NTWKADDR);
}
-<INITIAL>\( {
- BEGIN GOTRUNAS;
- LEXTRACE("( ");
- return (RUNAS);
- }
-
[[:upper:]][[:upper:][:digit:]_]* {
if (strcmp(yytext, "ALL") == 0) {
LEXTRACE("ALL ");
}
}
-<GOTRUNAS>({ID}|{WORD}) {
- /* username/uid that user can run command as */
- if (!fill(yytext, yyleng))
- yyterminate();
- LEXTRACE("WORD(3) ");
- return(WORD);
- }
-
-<GOTRUNAS>#[^0-9-].*\n {
- BEGIN INITIAL;
- ++sudolineno;
- LEXTRACE("\n");
- return(COMMENT);
- }
-
-<GOTRUNAS>\) {
- BEGIN INITIAL;
- LEXTRACE(") ");
- }
-
<GOTDEFS>({PATH}|sudoedit) {
/* no command args allowed for Defaults!/path */
if (!fill_cmnd(yytext, yyleng))
}
} /* a pathname */
-<INITIAL,GOTDEFS>{WORD} {
+<INITIAL,GOTDEFS>({ID}|{WORD}) {
/* a word */
if (!fill(yytext, yyleng))
yyterminate();
return(WORD);
}
+\( {
+ LEXTRACE("( ");
+ return ('(');
+ }
+
+\) {
+ LEXTRACE(") ");
+ return(')');
+ }
+
, {
LEXTRACE(", ");
return(',');
LEXTRACE("\n\t");
} /* throw away EOL after \ */
-<INITIAL,STARTDEFS,INDEFS>#.*\n {
+<INITIAL,STARTDEFS,INDEFS>#[^0-9-].*\n {
BEGIN INITIAL;
++sudolineno;
LEXTRACE("\n");