]> git.armaanb.net Git - opendoas.git/commitdiff
don't allow combining nopass and persist in a single rule
authortedu <tedu>
Sun, 4 Sep 2016 15:11:13 +0000 (15:11 +0000)
committerDuncaen <mail@duncano.de>
Mon, 11 Dec 2017 15:28:56 +0000 (16:28 +0100)
parse.y

diff --git a/parse.y b/parse.y
index 43732a6291144726e88e82d3925620394ddd9ea1..8a333642200c0c0a5f094edae977d03f78019274 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -111,6 +111,10 @@ options:   /* none */ {
                } | options option {
                        $$.options = $1.options | $2.options;
                        $$.envlist = $1.envlist;
+                       if (($$.options & (NOPASS|PERSIST)) == (NOPASS|PERSIST)) {
+                               yyerror("can't combine nopass and persist");
+                               YYERROR;
+                       }
                        if ($2.envlist) {
                                if ($$.envlist) {
                                        yyerror("can't have two setenv sections");