summaryrefslogtreecommitdiff
path: root/security/smack/smack_access.c
diff options
context:
space:
mode:
authorKonstantin Andreev <andreev@swemel.ru>2025-01-18 00:46:46 +0300
committerCasey Schaufler <casey@schaufler-ca.com>2025-02-14 05:33:55 +0300
commitbf9f14c91a05ec77ee3710703b699c2a32f80ae4 (patch)
tree1dcd07aacf0c8755e17062400abeb0228d815270 /security/smack/smack_access.c
parent6cce0cc3861337b3ad8d4ac131d6e47efa0954ec (diff)
downloadlinux-bf9f14c91a05ec77ee3710703b699c2a32f80ae4.tar.xz
smack: remove /smack/logging if audit is not configured
If CONFIG_AUDIT is not set then SMACK does not generate audit messages, however, keeps audit control file, /smack/logging, while there is no entity to control. This change removes audit control file /smack/logging when audit is not configured in the kernel Signed-off-by: Konstantin Andreev <andreev@swemel.ru> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security/smack/smack_access.c')
-rw-r--r--security/smack/smack_access.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
index 87a0ae65c524..2e4a0cb22782 100644
--- a/security/smack/smack_access.c
+++ b/security/smack/smack_access.c
@@ -45,11 +45,13 @@ LIST_HEAD(smack_known_list);
*/
static u32 smack_next_secid = 10;
+#ifdef CONFIG_AUDIT
/*
* what events do we log
* can be overwritten at run-time by /smack/logging
*/
int log_policy = SMACK_AUDIT_DENIED;
+#endif /* CONFIG_AUDIT */
/**
* smk_access_entry - look up matching access rule