extern int parse_error;
int sudolineno = 1;
char *sudoers;
-int (*trace_print)(const char *msg);
static int sawspace = FALSE;
static int continued = FALSE;
static int pop_include(void);
static char *parse_include(char *);
+#ifdef TRACELEXER
+static int sudoers_trace_print(const char *msg);
+#else
+# define sudoers_trace_print NULL
+#endif
+int (*trace_print)(const char *msg) = sudoers_trace_print;
+
#define push_include(_p) (_push_include((_p), FALSE))
#define push_includedir(_p) (_push_include((_p), TRUE))
#define YY_NO_INPUT 1
#define INSTR 5
-#line 1501 "lex.yy.c"
+#line 1507 "lex.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 114 "toke.l"
+#line 120 "toke.l"
-#line 1657 "lex.yy.c"
+#line 1663 "lex.yy.c"
if ( yy_init )
{
case 1:
YY_RULE_SETUP
-#line 115 "toke.l"
+#line 121 "toke.l"
{
LEXTRACE(", ");
return ',';
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 120 "toke.l"
+#line 126 "toke.l"
BEGIN STARTDEFS;
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 122 "toke.l"
+#line 128 "toke.l"
{
BEGIN INDEFS;
LEXTRACE("DEFVAR ");
case 4:
YY_RULE_SETUP
-#line 131 "toke.l"
+#line 137 "toke.l"
{
BEGIN STARTDEFS;
LEXTRACE(", ");
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 137 "toke.l"
+#line 143 "toke.l"
{
LEXTRACE("= ");
return '=';
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 142 "toke.l"
+#line 148 "toke.l"
{
LEXTRACE("+= ");
return '+';
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 147 "toke.l"
+#line 153 "toke.l"
{
LEXTRACE("-= ");
return '-';
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 152 "toke.l"
+#line 158 "toke.l"
{
LEXTRACE("BEGINSTR ");
yylval.string = NULL;
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 159 "toke.l"
+#line 165 "toke.l"
{
LEXTRACE("WORD(2) ");
if (!fill(yytext, yyleng))
case 10:
YY_RULE_SETUP
-#line 168 "toke.l"
+#line 174 "toke.l"
{
/* Line continuation char followed by newline. */
++sudolineno;
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 174 "toke.l"
+#line 180 "toke.l"
{
LEXTRACE("ENDSTR ");
BEGIN prev_state;
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 191 "toke.l"
+#line 197 "toke.l"
{
LEXTRACE("BACKSLASH ");
if (!append(yytext, yyleng))
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 197 "toke.l"
+#line 203 "toke.l"
{
LEXTRACE("STRBODY ");
if (!append(yytext, yyleng))
case 14:
YY_RULE_SETUP
-#line 205 "toke.l"
+#line 211 "toke.l"
{
/* quoted fnmatch glob char, pass verbatim */
LEXTRACE("QUOTEDCHAR ");
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 213 "toke.l"
+#line 219 "toke.l"
{
/* quoted sudoers special char, strip backslash */
LEXTRACE("QUOTEDCHAR ");
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 221 "toke.l"
+#line 227 "toke.l"
{
BEGIN INITIAL;
yyless(0);
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 227 "toke.l"
+#line 233 "toke.l"
{
LEXTRACE("ARG ");
if (!fill_args(yytext, yyleng, sawspace))
case 18:
YY_RULE_SETUP
-#line 235 "toke.l"
+#line 241 "toke.l"
{
char *path;
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 253 "toke.l"
+#line 259 "toke.l"
{
char *path;
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 274 "toke.l"
+#line 280 "toke.l"
{
char deftype;
int n;
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 314 "toke.l"
+#line 320 "toke.l"
{
int n;
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 340 "toke.l"
+#line 346 "toke.l"
{
/* cmnd does not require passwd for this user */
LEXTRACE("NOPASSWD ");
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 346 "toke.l"
+#line 352 "toke.l"
{
/* cmnd requires passwd for this user */
LEXTRACE("PASSWD ");
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 352 "toke.l"
+#line 358 "toke.l"
{
LEXTRACE("NOEXEC ");
return NOEXEC;
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 357 "toke.l"
+#line 363 "toke.l"
{
LEXTRACE("EXEC ");
return EXEC;
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 362 "toke.l"
+#line 368 "toke.l"
{
LEXTRACE("SETENV ");
return SETENV;
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 367 "toke.l"
+#line 373 "toke.l"
{
LEXTRACE("NOSETENV ");
return NOSETENV;
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 372 "toke.l"
+#line 378 "toke.l"
{
LEXTRACE("LOG_OUTPUT ");
return LOG_OUTPUT;
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 377 "toke.l"
+#line 383 "toke.l"
{
LEXTRACE("NOLOG_OUTPUT ");
return NOLOG_OUTPUT;
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 382 "toke.l"
+#line 388 "toke.l"
{
LEXTRACE("LOG_INPUT ");
return LOG_INPUT;
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 387 "toke.l"
+#line 393 "toke.l"
{
LEXTRACE("NOLOG_INPUT ");
return NOLOG_INPUT;
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 392 "toke.l"
+#line 398 "toke.l"
{
/* netgroup */
if (!fill(yytext, yyleng))
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 400 "toke.l"
+#line 406 "toke.l"
{
/* UN*X group */
if (!fill(yytext, yyleng))
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 408 "toke.l"
+#line 414 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 415 "toke.l"
+#line 421 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 422 "toke.l"
+#line 428 "toke.l"
{
if (!ipv6_valid(yytext)) {
LEXTRACE("ERROR ");
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 433 "toke.l"
+#line 439 "toke.l"
{
if (!ipv6_valid(yytext)) {
LEXTRACE("ERROR ");
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 444 "toke.l"
+#line 450 "toke.l"
{
if (strcmp(yytext, "ALL") == 0) {
LEXTRACE("ALL ");
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 466 "toke.l"
+#line 472 "toke.l"
{
/* no command args allowed for Defaults!/path */
if (!fill_cmnd(yytext, yyleng))
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 474 "toke.l"
+#line 480 "toke.l"
{
BEGIN GOTCMND;
LEXTRACE("COMMAND ");
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 481 "toke.l"
+#line 487 "toke.l"
{
/* directories can't have args... */
if (yytext[yyleng - 1] == '/') {
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 496 "toke.l"
+#line 502 "toke.l"
{
LEXTRACE("BEGINSTR ");
yylval.string = NULL;
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 503 "toke.l"
+#line 509 "toke.l"
{
/* a word */
if (!fill(yytext, yyleng))
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 511 "toke.l"
+#line 517 "toke.l"
{
LEXTRACE("( ");
return '(';
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 516 "toke.l"
+#line 522 "toke.l"
{
LEXTRACE(") ");
return ')';
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 521 "toke.l"
+#line 527 "toke.l"
{
LEXTRACE(", ");
return ',';
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 526 "toke.l"
+#line 532 "toke.l"
{
LEXTRACE("= ");
return '=';
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 531 "toke.l"
+#line 537 "toke.l"
{
LEXTRACE(": ");
return ':';
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 536 "toke.l"
+#line 542 "toke.l"
{
if (yyleng % 2 == 1)
return '!'; /* return '!' */
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 541 "toke.l"
+#line 547 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 549 "toke.l"
+#line 555 "toke.l"
{ /* throw away space/tabs */
sawspace = TRUE; /* but remember for fill_args */
}
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 553 "toke.l"
+#line 559 "toke.l"
{
sawspace = TRUE; /* remember for fill_args */
++sudolineno;
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 559 "toke.l"
+#line 565 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 567 "toke.l"
+#line 573 "toke.l"
{
LEXTRACE("ERROR ");
return ERROR;
case YY_STATE_EOF(STARTDEFS):
case YY_STATE_EOF(INDEFS):
case YY_STATE_EOF(INSTR):
-#line 572 "toke.l"
+#line 578 "toke.l"
{
if (YY_START != INITIAL) {
BEGIN INITIAL;
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 582 "toke.l"
+#line 588 "toke.l"
ECHO;
YY_BREAK
-#line 2382 "lex.yy.c"
+#line 2388 "lex.yy.c"
case YY_END_OF_BUFFER:
{
return 0;
}
#endif
-#line 582 "toke.l"
+#line 588 "toke.l"
struct path_list {
char *path;
return path;
}
+
+#ifdef TRACELEXER
+static int
+sudoers_trace_print(const char *msg)
+{
+ return fputs(msg, stderr);
+}
+#endif /* TRACELEXER */
extern int parse_error;
int sudolineno = 1;
char *sudoers;
-int (*trace_print)(const char *msg);
static int sawspace = FALSE;
static int continued = FALSE;
static int pop_include(void);
static char *parse_include(char *);
+#ifdef TRACELEXER
+static int sudoers_trace_print(const char *msg);
+#else
+# define sudoers_trace_print NULL
+#endif
+int (*trace_print)(const char *msg) = sudoers_trace_print;
+
#define push_include(_p) (_push_include((_p), FALSE))
#define push_includedir(_p) (_push_include((_p), TRUE))
%}
return path;
}
+
+#ifdef TRACELEXER
+static int
+sudoers_trace_print(const char *msg)
+{
+ return fputs(msg, stderr);
+}
+#endif /* TRACELEXER */