From: Gao feng Date: Fri, 1 Nov 2013 11:34:45 +0000 (+0800) Subject: audit: don't generate loginuid log when audit disabled X-Git-Tag: firefly_0821_release~176^2~4072^2~62 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c2412d91c68426e22add16550f97ae5cd988a159;p=firefly-linux-kernel-4.4.55.git audit: don't generate loginuid log when audit disabled If audit is disabled, we shouldn't generate loginuid audit log. Acked-by: Eric Paris Signed-off-by: Gao feng Signed-off-by: Richard Guy Briggs Signed-off-by: Eric Paris --- diff --git a/kernel/auditsc.c b/kernel/auditsc.c index df1e685809e1..9ab02fa2334c 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -1971,6 +1971,9 @@ static void audit_log_set_loginuid(kuid_t koldloginuid, kuid_t kloginuid, struct audit_buffer *ab; uid_t uid, ologinuid, nloginuid; + if (!audit_enabled) + return; + uid = from_kuid(&init_user_ns, task_uid(current)); ologinuid = from_kuid(&init_user_ns, koldloginuid); nloginuid = from_kuid(&init_user_ns, kloginuid),