[apparmor] [PATCH 04/10] From 34e17974b97355313e84feb74e92e5e3a91ef5e9 Mon Sep 17 00:00:00 2001 From: John Johansen <john.johansen at canonical.com> Date: Sat, 27 Oct 2012 04:50:11 -0700 Subject: [PATCH 04/10] Refactor policydb entry processing
John Johansen
john.johansen at canonical.com
Mon Jul 22 05:32:47 UTC 2013
Refactor policydb entry processing so that post_process_policydb_ents is
just a driver for rule specific routines.
Signed-off-by: John Johansen <john.johansen at canonical.com>
---
parser/parser_regex.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/parser/parser_regex.c b/parser/parser_regex.c
index 0ba8114..30a86cc 100644
--- a/parser/parser_regex.c
+++ b/parser/parser_regex.c
@@ -1041,7 +1041,7 @@ fail:
}
-int post_process_policydb_ents(struct codomain *cod)
+int post_process_mnt_ents(struct codomain *cod)
{
int ret = TRUE;
int count = 0;
@@ -1058,10 +1058,19 @@ int post_process_policydb_ents(struct codomain *cod)
} else if (cod->mnt_ents && !kernel_supports_mount)
pwarn("profile %s mount rules not enforced\n", cod->name);
- cod->policy_rule_count = count;
+ cod->policy_rule_count += count;
+
return ret;
}
+int post_process_policydb_ents(struct codomain *cod)
+{
+ if (!post_process_mnt_ents(cod))
+ return FALSE;
+
+ return TRUE;
+}
+
int process_policydb(struct codomain *cod)
{
int error = -1;
--
1.8.1.2
More information about the AppArmor
mailing list