diff options
author | Gao feng <gaofeng@cn.fujitsu.com> | 2013-11-01 19:34:45 +0800 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2014-01-13 22:30:25 -0500 |
commit | c2412d91c68426e22add16550f97ae5cd988a159 (patch) | |
tree | 5c426fbdfe792c6d4435a20e925b15456d77ee08 /kernel | |
parent | 4547b3bc43c64389ca4368be0edf1f90ae1b938d (diff) | |
download | op-kernel-dev-c2412d91c68426e22add16550f97ae5cd988a159.zip op-kernel-dev-c2412d91c68426e22add16550f97ae5cd988a159.tar.gz |
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')
-rw-r--r-- | kernel/auditsc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index df1e685..9ab02fa 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), |