LEXTRACE("INCLUDEDIR\n");
- /* Push current buffer and switch to include file */
- if (!push_includedir(path))
+ /*
+ * Push current buffer and switch to include file.
+ * We simply ignore empty directories.
+ */
+ if (!push_includedir(path) && parse_error)
yyterminate();
}
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 261 "toke.l"
+#line 264 "toke.l"
{
int n;
for (n = 0; isblank((unsigned char)yytext[n]); n++)
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 290 "toke.l"
+#line 293 "toke.l"
{
int n;
for (n = 0; isblank((unsigned char)yytext[n]); n++)
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 310 "toke.l"
+#line 313 "toke.l"
{
/* cmnd does not require passwd for this user */
LEXTRACE("NOPASSWD ");
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 316 "toke.l"
+#line 319 "toke.l"
{
/* cmnd requires passwd for this user */
LEXTRACE("PASSWD ");
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 322 "toke.l"
+#line 325 "toke.l"
{
LEXTRACE("NOEXEC ");
return(NOEXEC);
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 327 "toke.l"
+#line 330 "toke.l"
{
LEXTRACE("EXEC ");
return(EXEC);
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 332 "toke.l"
+#line 335 "toke.l"
{
LEXTRACE("SETENV ");
return(SETENV);
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 337 "toke.l"
+#line 340 "toke.l"
{
LEXTRACE("NOSETENV ");
return(NOSETENV);
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 342 "toke.l"
+#line 345 "toke.l"
{
/* netgroup */
if (!fill(yytext, yyleng))
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 350 "toke.l"
+#line 353 "toke.l"
{
/* UN*X group */
if (!fill(yytext, yyleng))
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 358 "toke.l"
+#line 361 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 365 "toke.l"
+#line 368 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 372 "toke.l"
+#line 375 "toke.l"
{
if (!ipv6_valid(yytext)) {
LEXTRACE("ERROR ");
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 383 "toke.l"
+#line 386 "toke.l"
{
if (!ipv6_valid(yytext)) {
LEXTRACE("ERROR ");
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 394 "toke.l"
+#line 397 "toke.l"
{
if (strcmp(yytext, "ALL") == 0) {
LEXTRACE("ALL ");
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 416 "toke.l"
+#line 419 "toke.l"
{
/* no command args allowed for Defaults!/path */
if (!fill_cmnd(yytext, yyleng))
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 424 "toke.l"
+#line 427 "toke.l"
{
BEGIN GOTCMND;
LEXTRACE("COMMAND ");
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 431 "toke.l"
+#line 434 "toke.l"
{
/* directories can't have args... */
if (yytext[yyleng - 1] == '/') {
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 446 "toke.l"
+#line 449 "toke.l"
{
/* a quoted user/group name */
if (!fill(yytext + 1, yyleng - 2))
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 463 "toke.l"
+#line 466 "toke.l"
{
/* a word */
if (!fill(yytext, yyleng))
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 471 "toke.l"
+#line 474 "toke.l"
{
LEXTRACE("( ");
return ('(');
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 476 "toke.l"
+#line 479 "toke.l"
{
LEXTRACE(") ");
return(')');
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 481 "toke.l"
+#line 484 "toke.l"
{
LEXTRACE(", ");
return(',');
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 486 "toke.l"
+#line 489 "toke.l"
{
LEXTRACE("= ");
return('=');
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 491 "toke.l"
+#line 494 "toke.l"
{
LEXTRACE(": ");
return(':');
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 496 "toke.l"
+#line 499 "toke.l"
{
if (yyleng % 2 == 1)
return('!'); /* return '!' */
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 501 "toke.l"
+#line 504 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 508 "toke.l"
+#line 511 "toke.l"
{ /* throw away space/tabs */
sawspace = TRUE; /* but remember for fill_args */
}
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 512 "toke.l"
+#line 515 "toke.l"
{
sawspace = TRUE; /* remember for fill_args */
++sudolineno;
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 518 "toke.l"
+#line 521 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 525 "toke.l"
+#line 528 "toke.l"
{
LEXTRACE("ERROR ");
return(ERROR);
case YY_STATE_EOF(STARTDEFS):
case YY_STATE_EOF(INDEFS):
case YY_STATE_EOF(INSTR):
-#line 530 "toke.l"
+#line 533 "toke.l"
{
if (YY_START != INITIAL) {
BEGIN INITIAL;
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 540 "toke.l"
+#line 543 "toke.l"
ECHO;
YY_BREAK
-#line 2272 "lex.yy.c"
+#line 2275 "lex.yy.c"
case YY_END_OF_BUFFER:
{
return 0;
}
#endif
-#line 540 "toke.l"
+#line 543 "toke.l"
static unsigned char
hexchar(s)
if (!(dir = opendir(dirpath))) {
yyerror(dirpath);
- return(FALSE);
+ return(NULL);
}
while ((dent = readdir(dir))) {
/* Ignore files that end in '~' or have a '.' in them. */
}
if (isdir) {
if (!(path = switch_dir(&istack[idepth], path))) {
- yyerror(path);
+ /* switch_dir() called yyerror() for us */
return(FALSE);
}
if ((fp = open_sudoers(path, FALSE, &keepopen)) == NULL) {
yyerror(path);
- return(FALSE); /* XXX - just to go next one? */
+ return(FALSE); /* XXX - just to go next one */
}
} else {
if ((fp = open_sudoers(path, TRUE, &keepopen)) == NULL) {
istack[idepth - 1].more = pl->next;
if ((fp = open_sudoers(pl->path, FALSE, &keepopen)) == NULL) {
yyerror(pl->path);
- return(FALSE); /* XXX - just to go next one? */
+ return(FALSE); /* XXX - just to go next one */
}
efree(sudoers);
sudoers = pl->path;
LEXTRACE("INCLUDEDIR\n");
- /* Push current buffer and switch to include file */
- if (!push_includedir(path))
+ /*
+ * Push current buffer and switch to include file.
+ * We simply ignore empty directories.
+ */
+ if (!push_includedir(path) && parse_error)
yyterminate();
}
if (!(dir = opendir(dirpath))) {
yyerror(dirpath);
- return(FALSE);
+ return(NULL);
}
while ((dent = readdir(dir))) {
/* Ignore files that end in '~' or have a '.' in them. */
}
if (isdir) {
if (!(path = switch_dir(&istack[idepth], path))) {
- yyerror(path);
+ /* switch_dir() called yyerror() for us */
return(FALSE);
}
if ((fp = open_sudoers(path, FALSE, &keepopen)) == NULL) {
yyerror(path);
- return(FALSE); /* XXX - just to go next one? */
+ return(FALSE); /* XXX - just to go next one */
}
} else {
if ((fp = open_sudoers(path, TRUE, &keepopen)) == NULL) {
istack[idepth - 1].more = pl->next;
if ((fp = open_sudoers(pl->path, FALSE, &keepopen)) == NULL) {
yyerror(pl->path);
- return(FALSE); /* XXX - just to go next one? */
+ return(FALSE); /* XXX - just to go next one */
}
efree(sudoers);
sudoers = pl->path;