[PATCH -next] security: Make capability_hooks static

Subsystems: capabilities, security subsystem, the rest

STALE2677d

2 messages, 2 authors, 2019-06-11 · open the first message on its own page

[PATCH -next] security: Make capability_hooks static

From: YueHaibing <hidden>
Date: 2019-06-11 13:48:39

Fix sparse warning:

security/commoncap.c:1347:27: warning:
 symbol 'capability_hooks' was not declared. Should it be static?

Reported-by: Hulk Robot <redacted>
Signed-off-by: YueHaibing <redacted>
---
 security/commoncap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/commoncap.c b/security/commoncap.c
index c0b9664..3150bed 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -1339,7 +1339,7 @@ int cap_mmap_file(struct file *file, unsigned long reqprot,
 
 #ifdef CONFIG_SECURITY
 
-struct security_hook_list capability_hooks[] __lsm_ro_after_init = {
+static struct security_hook_list capability_hooks[] __lsm_ro_after_init = {
 	LSM_HOOK_INIT(capable, cap_capable),
 	LSM_HOOK_INIT(settime, cap_settime),
 	LSM_HOOK_INIT(ptrace_access_check, cap_ptrace_access_check),
-- 
2.7.4

Re: [PATCH -next] security: Make capability_hooks static

From: James Morris <jmorris@namei.org>
Date: 2019-06-11 21:44:28

On Tue, 11 Jun 2019, YueHaibing wrote:
Fix sparse warning:

security/commoncap.c:1347:27: warning:
 symbol 'capability_hooks' was not declared. Should it be static?

Reported-by: Hulk Robot <redacted>
Signed-off-by: YueHaibing <redacted>
---
 security/commoncap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks!

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-lsm

-- 
James Morris
[off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help