diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2013-11-20 14:01:53 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2014-01-13 22:31:22 -0500 |
commit | ce0d9f04699706843e8a494d12cf6c7663d478c7 (patch) | |
tree | 34cae2d8036f35933d49d3a02c49b37e0d95811b /kernel/audit.c | |
parent | a06e56b2a11b5f7d5354b05988f97118c90580d2 (diff) |
audit: refactor audit_receive_msg() to clarify AUDIT_*_RULE* cases
audit_receive_msg() needlessly contained a fallthrough case that called
audit_receive_filter(), containing no common code between the cases. Separate
them to make the logic clearer. Refactor AUDIT_LIST_RULES, AUDIT_ADD_RULE,
AUDIT_DEL_RULE cases to create audit_rule_change(), audit_list_rules_send()
functions. This should not functionally change the logic.
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index fdb8528ceca3..c460f33c2801 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -903,11 +903,12 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
903 | audit_log_end(ab); | 903 | audit_log_end(ab); |
904 | return -EPERM; | 904 | return -EPERM; |
905 | } | 905 | } |
906 | /* fallthrough */ | 906 | err = audit_rule_change(msg_type, NETLINK_CB(skb).portid, |
907 | case AUDIT_LIST_RULES: | ||
908 | err = audit_receive_filter(msg_type, NETLINK_CB(skb).portid, | ||
909 | seq, data, nlmsg_len(nlh)); | 907 | seq, data, nlmsg_len(nlh)); |
910 | break; | 908 | break; |
909 | case AUDIT_LIST_RULES: | ||
910 | err = audit_list_rules_send(NETLINK_CB(skb).portid, seq); | ||
911 | break; | ||
911 | case AUDIT_TRIM: | 912 | case AUDIT_TRIM: |
912 | audit_trim_trees(); | 913 | audit_trim_trees(); |
913 | audit_log_common_recv_msg(&ab, AUDIT_CONFIG_CHANGE); | 914 | audit_log_common_recv_msg(&ab, AUDIT_CONFIG_CHANGE); |