]> git.armaanb.net Git - opendoas.git/blobdiff - parse.y
s/authorization/authentication/g
[opendoas.git] / parse.y
diff --git a/parse.y b/parse.y
index e4a041a374164133761a77c8f3f1e27f09c7556a..c50378a5784c0001f2011a12eaa7cc9c101b6e25 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -16,6 +16,8 @@
  */
 
 %{
+#include "config.h"
+
 #include <sys/types.h>
 #include <ctype.h>
 #include <err.h>
@@ -73,7 +75,7 @@ arraylen(const char **arr)
 %}
 
 %token TPERMIT TDENY TAS TCMD TARGS
-%token TNOPASS TPERSIST TKEEPENV TSETENV
+%token TNOPASS TNOLOG TPERSIST TKEEPENV TSETENV
 %token TSTRING
 
 %%
@@ -139,6 +141,9 @@ options:    /* none */ {
 option:                TNOPASS {
                        $$.options = NOPASS;
                        $$.envlist = NULL;
+               } | TNOLOG {
+                       $$.options = NOLOG;
+                       $$.envlist = NULL;
                } | TPERSIST {
                        $$.options = PERSIST;
                        $$.envlist = NULL;
@@ -212,6 +217,7 @@ static struct keyword {
        { "cmd", TCMD },
        { "args", TARGS },
        { "nopass", TNOPASS },
+       { "nolog", TNOLOG },
        { "persist", TPERSIST },
        { "keepenv", TKEEPENV },
        { "setenv", TSETENV },
@@ -272,6 +278,8 @@ repeat:
                        if (escape) {
                                nonkw = 1;
                                escape = 0;
+                               yylval.colno = 0;
+                               yylval.lineno++;
                                continue;
                        }
                        goto eow;
@@ -303,8 +311,10 @@ repeat:
                        }
                }
                *p++ = c;
-               if (p == ebuf)
+               if (p == ebuf) {
                        yyerror("too long line");
+                       p = buf;
+               }
                escape = 0;
        }