diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2018-05-17 22:01:48 -0400 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2018-05-18 15:47:54 -0400 |
commit | 5c5b8d8bebee2b4e784e67b2751934fa564b1a79 (patch) | |
tree | 21d61057135ef4961756ba6543267ccfb65aee11 | |
parent | 38f80590486e38a4f2aac7b1fcf9cf60cb618a1a (diff) |
audit: use existing session info function
Use the existing audit_log_session_info() function rather than
hardcoding its functionality.
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r-- | kernel/auditfilter.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index a0c5a3ec6e60..eaa320148d97 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c | |||
@@ -1089,8 +1089,6 @@ static void audit_list_rules(int seq, struct sk_buff_head *q) | |||
1089 | static void audit_log_rule_change(char *action, struct audit_krule *rule, int res) | 1089 | static void audit_log_rule_change(char *action, struct audit_krule *rule, int res) |
1090 | { | 1090 | { |
1091 | struct audit_buffer *ab; | 1091 | struct audit_buffer *ab; |
1092 | uid_t loginuid = from_kuid(&init_user_ns, audit_get_loginuid(current)); | ||
1093 | unsigned int sessionid = audit_get_sessionid(current); | ||
1094 | 1092 | ||
1095 | if (!audit_enabled) | 1093 | if (!audit_enabled) |
1096 | return; | 1094 | return; |
@@ -1098,7 +1096,7 @@ static void audit_log_rule_change(char *action, struct audit_krule *rule, int re | |||
1098 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); | 1096 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); |
1099 | if (!ab) | 1097 | if (!ab) |
1100 | return; | 1098 | return; |
1101 | audit_log_format(ab, "auid=%u ses=%u" ,loginuid, sessionid); | 1099 | audit_log_session_info(ab); |
1102 | audit_log_task_context(ab); | 1100 | audit_log_task_context(ab); |
1103 | audit_log_format(ab, " op=%s", action); | 1101 | audit_log_format(ab, " op=%s", action); |
1104 | audit_log_key(ab, rule->filterkey); | 1102 | audit_log_key(ab, rule->filterkey); |