summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2013-11-01 19:34:45 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-23 21:44:19 -0700
commit802610891c6421e3ea93c3d402891b93ebada52c (patch)
treee0fe91dd54e23d57d2f2b28ec735f233c8217204
parentBtrfs: fix data corruption when reading/updating compressed extents (diff)
downloadlinux-stable-802610891c6421e3ea93c3d402891b93ebada52c.tar.xz
linux-stable-802610891c6421e3ea93c3d402891b93ebada52c.zip
audit: don't generate loginuid log when audit disabled
commit c2412d91c68426e22add16550f97ae5cd988a159 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--kernel/auditsc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 90594c9f7552..ff328436445e 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),