]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] lsm: reduce noise during security_register
authorChris Wright <chrisw@osdl.org>
Fri, 22 Oct 2004 01:15:52 +0000 (18:15 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 22 Oct 2004 01:15:52 +0000 (18:15 -0700)
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@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
security/security.c

index 890b678acecc1a3dcd253d962fbf6d68a65244a9..1aee1805509bc6ade2f161c6dc97ecd202681664 100644 (file)
@@ -29,11 +29,8 @@ struct security_operations *security_ops;    /* Initialized to NULL */
 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 __init security_init(void)
 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;