diff --git a/parser/af_unix.cc b/parser/af_unix.cc index 117688692..66c52ffe3 100644 --- a/parser/af_unix.cc +++ b/parser/af_unix.cc @@ -413,7 +413,7 @@ int unix_rule::gen_policy_re(Profile &prof) tmp << ".."; buf = tmp.str(); if (!prof.policy.rules->add_rule(buf.c_str(), rule_mode == RULE_DENY, - map_perms(AA_NET_OPT), + map_perms(mask & AA_NET_OPT), map_perms(audit == AUDIT_FORCE ? AA_NET_OPT : 0), parseopts)) goto fail; diff --git a/tests/regression/apparmor/prologue.inc b/tests/regression/apparmor/prologue.inc index b4e2dd59c..78d2a4888 100755 --- a/tests/regression/apparmor/prologue.inc +++ b/tests/regression/apparmor/prologue.inc @@ -70,9 +70,14 @@ kernel_features() # check if feature is in file feature=$(basename "$features_dir/$f") file=$(dirname "$features_dir/$f") - if [ -f $file ] && ! grep -q $feature $file; then + if [ -f $file ]; then + if ! grep -q $feature $file; then + echo "Required feature '$f' not available." + return 2; + fi + else echo "Required feature '$f' not available." - return 2; + return 3; fi fi done