diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2023-07-28 17:19:31 +0200 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2023-07-28 14:09:24 -0400 |
commit | f01dd5904519574017a4938ffb4424b31ba79cf3 (patch) | |
tree | 687f311a9ca609cabea34daf570bdc90c4edd7d7 /security/selinux/ss/policydb.c | |
parent | selinux: log about VM being executable by default (diff) | |
download | wireguard-linux-f01dd5904519574017a4938ffb4424b31ba79cf3.tar.xz wireguard-linux-f01dd5904519574017a4938ffb4424b31ba79cf3.zip |
selinux: move debug functions into debug configuration
avtab_hash_eval() and hashtab_stat() are only used in policydb.c when
the configuration SECURITY_SELINUX_DEBUG is enabled.
Move the function definitions under that configuration as well and
provide empty definitions in case SECURITY_SELINUX_DEBUG is disabled, to
avoid using #ifdef in the callers.
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/ss/policydb.c')
-rw-r--r-- | security/selinux/ss/policydb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index dc66868ff62c..a424997c79eb 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -701,6 +701,9 @@ static void symtab_hash_eval(struct symtab *s) static inline void hash_eval(struct hashtab *h, const char *hash_name) { } +static inline void symtab_hash_eval(struct symtab *s) +{ +} #endif /* CONFIG_SECURITY_SELINUX_DEBUG */ /* @@ -725,10 +728,8 @@ static int policydb_index(struct policydb *p) pr_debug("SELinux: %d classes, %d rules\n", p->p_classes.nprim, p->te_avtab.nel); -#ifdef CONFIG_SECURITY_SELINUX_DEBUG avtab_hash_eval(&p->te_avtab, "rules"); symtab_hash_eval(p->symtab); -#endif p->class_val_to_struct = kcalloc(p->p_classes.nprim, sizeof(*p->class_val_to_struct), |