Imported Upstream version 1.8.2
[debian/sudo] / plugins / sudoers / toke.l
index 9428049e40117d26cc190e9842371142fa744bbc..398e1d1359431a1b801ff888ccfd0153f519d0f3 100644 (file)
@@ -492,7 +492,9 @@ ALL {
                        }
 
 [[:upper:]][[:upper:][:digit:]_]* {
+#ifndef HAVE_SELINUX
                        got_alias:
+#endif
                            if (!fill(yytext, yyleng))
                                yyterminate();
                            LEXTRACE("ALIAS ");
@@ -658,11 +660,11 @@ switch_dir(struct include_stack *stack, char *dirpath)
     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;
@@ -781,14 +783,14 @@ _push_include(char *path, int isdir)
     /* 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;
        }
     }
@@ -809,11 +811,11 @@ _push_include(char *path, int isdir)
     } 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;
        }
@@ -898,8 +900,10 @@ parse_include(char *base)
 
     /* 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;