summaryrefslogtreecommitdiff
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2013-11-01 19:34:45 +0800
committerEric Paris <eparis@redhat.com>2014-01-13 22:30:25 -0500
commitc2412d91c68426e22add16550f97ae5cd988a159 (patch)
tree5c426fbdfe792c6d4435a20e925b15456d77ee08 /kernel/auditsc.c
parent4547b3bc43c64389ca4368be0edf1f90ae1b938d (diff)
audit: don't generate loginuid log when audit disabled
If audit is disabled, we shouldn't generate loginuid audit log. Acked-by: Eric Paris <eparis@redhat.com> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com> Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c3
1 files changed, 3 insertions, 0 deletions
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),