/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /home/cvs/openbsd/src/usr.bin/lex/flex.skl,v 1.11 2010/08/04 18:24:50 millert Exp $
+ * $Header: /cvs/src/usr.bin/lex/flex.skl,v 1.11 2010/08/04 18:24:50 millert Exp $
*/
#define FLEX_SCANNER
YY_RULE_SETUP
#line 494 "toke.l"
{
+#ifndef HAVE_SELINUX
got_alias:
+#endif
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("ALIAS ");
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 502 "toke.l"
+#line 504 "toke.l"
{
/* no command args allowed for Defaults!/path */
if (!fill_cmnd(yytext, yyleng))
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 510 "toke.l"
+#line 512 "toke.l"
{
BEGIN GOTCMND;
LEXTRACE("COMMAND ");
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 517 "toke.l"
+#line 519 "toke.l"
{
/* directories can't have args... */
if (yytext[yyleng - 1] == '/') {
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 532 "toke.l"
+#line 534 "toke.l"
{
LEXTRACE("BEGINSTR ");
yylval.string = NULL;
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 539 "toke.l"
+#line 541 "toke.l"
{
/* a word */
if (!fill(yytext, yyleng))
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 547 "toke.l"
+#line 549 "toke.l"
{
LEXTRACE("( ");
return '(';
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 552 "toke.l"
+#line 554 "toke.l"
{
LEXTRACE(") ");
return ')';
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 557 "toke.l"
+#line 559 "toke.l"
{
LEXTRACE(", ");
return ',';
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 562 "toke.l"
+#line 564 "toke.l"
{
LEXTRACE("= ");
return '=';
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 567 "toke.l"
+#line 569 "toke.l"
{
LEXTRACE(": ");
return ':';
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 572 "toke.l"
+#line 574 "toke.l"
{
if (yyleng & 1) {
LEXTRACE("!");
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 579 "toke.l"
+#line 581 "toke.l"
{
if (YY_START == INSTR) {
LEXTRACE("ERROR ");
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 591 "toke.l"
+#line 593 "toke.l"
{ /* throw away space/tabs */
sawspace = TRUE; /* but remember for fill_args */
}
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 595 "toke.l"
+#line 597 "toke.l"
{
sawspace = TRUE; /* remember for fill_args */
++sudolineno;
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 601 "toke.l"
+#line 603 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 609 "toke.l"
+#line 611 "toke.l"
{
LEXTRACE("ERROR ");
return ERROR;
case YY_STATE_EOF(STARTDEFS):
case YY_STATE_EOF(INDEFS):
case YY_STATE_EOF(INSTR):
-#line 614 "toke.l"
+#line 616 "toke.l"
{
if (YY_START != INITIAL) {
BEGIN INITIAL;
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 624 "toke.l"
+#line 626 "toke.l"
ECHO;
YY_BREAK
-#line 2441 "lex.yy.c"
+#line 2443 "lex.yy.c"
case YY_END_OF_BUFFER:
{
return 0;
}
#endif
-#line 624 "toke.l"
+#line 626 "toke.l"
struct path_list {
char *path;
if (!(dir = opendir(dirpath))) {
if (errno != ENOENT) {
char *errbuf;
- if (asprintf(&errbuf, "%s: %s", dirpath, strerror(errno)) != -1) {
+ if (asprintf(&errbuf, _("%s: %s"), dirpath, strerror(errno)) != -1) {
yyerror(errbuf);
free(errbuf);
} else {
- yyerror("unable to allocate memory");
+ yyerror(_("unable to allocate memory"));
}
}
goto done;
/* push current state onto stack */
if (idepth >= istacksize) {
if (idepth > MAX_SUDOERS_DEPTH) {
- yyerror("too many levels of includes");
+ yyerror(_("too many levels of includes"));
return FALSE;
}
istacksize += SUDOERS_STACK_INCREMENT;
istack = (struct include_stack *) realloc(istack,
sizeof(*istack) * istacksize);
if (istack == NULL) {
- yyerror("unable to allocate memory");
+ yyerror(_("unable to allocate memory"));
return FALSE;
}
}
} else {
if ((fp = open_sudoers(path, TRUE, &keepopen)) == NULL) {
char *errbuf;
- if (asprintf(&errbuf, "%s: %s", path, strerror(errno)) != -1) {
+ if (asprintf(&errbuf, _("%s: %s"), path, strerror(errno)) != -1) {
yyerror(errbuf);
free(errbuf);
} else {
- yyerror("unable to allocate memory");
+ yyerror(_("unable to allocate memory"));
}
return FALSE;
}
/* Make a copy of path and return it. */
len += (int)(ep - cp);
- if ((path = malloc(len + 1)) == NULL)
- yyerror("unable to allocate memory");
+ if ((path = malloc(len + 1)) == NULL) {
+ yyerror(_("unable to allocate memory"));
+ return NULL;
+ }
if (subst) {
/* substitute for %h */
char *pp = path;