Commit 5671b0c5 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] security: minor cleanups in capability.c

From: Chris Wright <chrisw@osdl.org>

Remove confusing error message when loading as secondary module, and ditch
conditional MY_NAME macro.
parent fc3a7889
...@@ -47,11 +47,7 @@ static struct security_operations capability_ops = { ...@@ -47,11 +47,7 @@ static struct security_operations capability_ops = {
.vm_enough_memory = cap_vm_enough_memory, .vm_enough_memory = cap_vm_enough_memory,
}; };
#if defined(CONFIG_SECURITY_CAPABILITIES_MODULE) #define MY_NAME __stringify(KBUILD_MODNAME)
#define MY_NAME THIS_MODULE->name
#else
#define MY_NAME "capability"
#endif
/* flag to keep track of how we were registered */ /* flag to keep track of how we were registered */
static int secondary; static int secondary;
...@@ -61,8 +57,6 @@ static int __init capability_init (void) ...@@ -61,8 +57,6 @@ static int __init capability_init (void)
{ {
/* register ourselves with the security framework */ /* register ourselves with the security framework */
if (register_security (&capability_ops)) { if (register_security (&capability_ops)) {
printk (KERN_INFO
"Failure registering capabilities with the kernel\n");
/* try registering with primary module */ /* try registering with primary module */
if (mod_reg_security (MY_NAME, &capability_ops)) { if (mod_reg_security (MY_NAME, &capability_ops)) {
printk (KERN_INFO "Failure registering capabilities " printk (KERN_INFO "Failure registering capabilities "
...@@ -71,7 +65,8 @@ static int __init capability_init (void) ...@@ -71,7 +65,8 @@ static int __init capability_init (void)
} }
secondary = 1; secondary = 1;
} }
printk (KERN_INFO "Capability LSM initialized\n"); printk (KERN_INFO "Capability LSM initialized%s\n",
secondary ? " as secondary" : "");
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment