summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2016-09-04 15:11:14 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2016-09-04 15:11:14 +0000
commit8978a74d8580eec4148f42269a9d88dbf743ce76 (patch)
treefa7e844e41e9a948b665ae6dad63c71807ea216e /usr.bin
parent721800298959f3fac0ffedff97dea3be4b3d4880 (diff)
don't allow combining nopass and persist in a single rule
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/doas/parse.y6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/doas/parse.y b/usr.bin/doas/parse.y
index 900f7970b05..9a30e1ea7c7 100644
--- a/usr.bin/doas/parse.y
+++ b/usr.bin/doas/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.20 2016/09/02 18:12:30 tedu Exp $ */
+/* $OpenBSD: parse.y,v 1.21 2016/09/04 15:11:13 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -108,6 +108,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");