[PATCH 2/3][LSM] reduce noise during security_register

From: Chris Wright
Date: Thu Oct 21 2004 - 21:48:57 EST


Registering a security module can be a noisy operation, esp. when it
retries registration with the primary module. Eliminate some noise, and
distinguish the return values for register_security so a module can tell
the difference between failure modes.

Signed-off-by: Chris Wright <chrisw@xxxxxxxx>

security.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)

--- linus-2.6/security/security.c~verbose 2004-10-21 16:50:30.844353688 -0700
+++ linus-2.6/security/security.c 2004-10-21 17:00:54.386560864 -0700
@@ -29,11 +29,8 @@
static inline int verify (struct security_operations *ops)
{
/* verify the security_operations structure exists */
- if (!ops) {
- printk (KERN_INFO "Passed a NULL security_operations "
- "pointer, %s failed.\n", __FUNCTION__);
+ if (!ops)
return -EINVAL;
- }
security_fixup_ops (ops);
return 0;
}
@@ -85,16 +82,13 @@
int register_security (struct security_operations *ops)
{
if (verify (ops)) {
- printk (KERN_INFO "%s could not verify "
+ printk(KERN_DEBUG "%s could not verify "
"security_operations structure.\n", __FUNCTION__);
return -EINVAL;
}

- if (security_ops != &dummy_security_ops) {
- printk (KERN_INFO "There is already a security "
- "framework initialized, %s failed.\n", __FUNCTION__);
- return -EINVAL;
- }
+ if (security_ops != &dummy_security_ops)
+ return -EAGAIN;

security_ops = ops;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/