Commit 5c5b8d8b authored by Richard Guy Briggs's avatar Richard Guy Briggs Committed by Paul Moore

audit: use existing session info function

Use the existing audit_log_session_info() function rather than
hardcoding its functionality.
Signed-off-by: default avatarRichard Guy Briggs <rgb@redhat.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 38f80590
...@@ -1089,8 +1089,6 @@ static void audit_list_rules(int seq, struct sk_buff_head *q) ...@@ -1089,8 +1089,6 @@ static void audit_list_rules(int seq, struct sk_buff_head *q)
static void audit_log_rule_change(char *action, struct audit_krule *rule, int res) static void audit_log_rule_change(char *action, struct audit_krule *rule, int res)
{ {
struct audit_buffer *ab; struct audit_buffer *ab;
uid_t loginuid = from_kuid(&init_user_ns, audit_get_loginuid(current));
unsigned int sessionid = audit_get_sessionid(current);
if (!audit_enabled) if (!audit_enabled)
return; return;
...@@ -1098,7 +1096,7 @@ static void audit_log_rule_change(char *action, struct audit_krule *rule, int re ...@@ -1098,7 +1096,7 @@ static void audit_log_rule_change(char *action, struct audit_krule *rule, int re
ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE);
if (!ab) if (!ab)
return; return;
audit_log_format(ab, "auid=%u ses=%u" ,loginuid, sessionid); audit_log_session_info(ab);
audit_log_task_context(ab); audit_log_task_context(ab);
audit_log_format(ab, " op=%s", action); audit_log_format(ab, " op=%s", action);
audit_log_key(ab, rule->filterkey); audit_log_key(ab, rule->filterkey);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment