From 44d2e9dacf33709d54e8ec58bf9229028c8a362d Mon Sep 17 00:00:00 2001 From: John Johansen Date: Tue, 7 Oct 2014 12:50:23 -0700 Subject: [PATCH] fix: auditing of capabilities BugLink: http://bugs.launchpad.net/bugs/1378091 The audit flags are not being set correctly by the parser so that audit capability XXX, will not result in an audit message being logged when the capability is used. Signed-off-by: John Johansen Acked-by: Steve Beattie --- parser/parser_yacc.y | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/parser/parser_yacc.y b/parser/parser_yacc.y index af7e1c83b..bec68ca11 100644 --- a/parser/parser_yacc.y +++ b/parser/parser_yacc.y @@ -793,13 +793,17 @@ rules: rules opt_prefix capability if ($2.owner) yyerror(_("owner prefix not allowed on capability rules")); - if ($2.deny) + if ($2.deny && $2.audit) { + $1->caps.deny |= $3; + } else if ($2.deny) { $1->caps.deny |= $3; - else - $1->caps.allow |= $3; - - if (!$2.audit) $1->caps.quiet |= $3; + } else { + $1->caps.allow |= $3; + if ($2.audit) + $1->caps.audit |= $3; + } + $$ = $1; };