diff options
author | Chris Wright <chrisw@osdl.org> | 2004-10-21 18:15:52 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-21 18:15:52 -0700 |
commit | 6ba4eba6be1fc63002ce883cc42733139a24946a (patch) | |
tree | e1c6dd58d98e406c0fad7de152142e4555f86b21 /security | |
parent | d52dd365eaf5c2bc13dde46ab5bb6f28fde5e697 (diff) | |
download | history-6ba4eba6be1fc63002ce883cc42733139a24946a.tar.gz |
[PATCH] lsm: reduce noise during security_register
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>
Diffstat (limited to 'security')
-rw-r--r-- | security/security.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/security/security.c b/security/security.c index 890b678acecc1a..1aee1805509bc6 100644 --- a/security/security.c +++ b/security/security.c @@ -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; |