From f5f27a8e03bf039b7d90dd605175046bcc3fe0f8 Mon Sep 17 00:00:00 2001 From: tedu Date: Sun, 4 Sep 2016 15:11:13 +0000 Subject: [PATCH] don't allow combining nopass and persist in a single rule --- parse.y | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parse.y b/parse.y index 43732a6..8a33364 100644 --- 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"); -- 2.39.2