diff options
author | Adrian Bunk <bunk@kernel.org> | 2007-10-17 02:31:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:43:07 -0400 |
commit | cbfee34520666862f8ff539e580c48958fbb7706 (patch) | |
tree | ded5cafce333e908a0fbeda1f7c55eaf7c1fbaaa /security/security.c | |
parent | b53767719b6cd8789392ea3e7e2eb7b8906898f0 (diff) |
security/ cleanups
This patch contains the following cleanups that are now possible:
- remove the unused security_operations->inode_xattr_getsuffix
- remove the no longer used security_operations->unregister_security
- remove some no longer required exit code
- remove a bunch of no longer used exports
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: James Morris <jmorris@namei.org>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 58 |
1 files changed, 1 insertions, 57 deletions
diff --git a/security/security.c b/security/security.c index 2e1b35dd2550..0e1f1f124368 100644 --- a/security/security.c +++ b/security/security.c | |||
@@ -71,8 +71,7 @@ int __init security_init(void) | |||
71 | * | 71 | * |
72 | * This function is to allow a security module to register itself with the | 72 | * This function is to allow a security module to register itself with the |
73 | * kernel security subsystem. Some rudimentary checking is done on the @ops | 73 | * kernel security subsystem. Some rudimentary checking is done on the @ops |
74 | * value passed to this function. A call to unregister_security() should be | 74 | * value passed to this function. |
75 | * done to remove this security_options structure from the kernel. | ||
76 | * | 75 | * |
77 | * If there is already a security module registered with the kernel, | 76 | * If there is already a security module registered with the kernel, |
78 | * an error will be returned. Otherwise 0 is returned on success. | 77 | * an error will be returned. Otherwise 0 is returned on success. |
@@ -94,31 +93,6 @@ int register_security(struct security_operations *ops) | |||
94 | } | 93 | } |
95 | 94 | ||
96 | /** | 95 | /** |
97 | * unregister_security - unregisters a security framework with the kernel | ||
98 | * @ops: a pointer to the struct security_options that is to be registered | ||
99 | * | ||
100 | * This function removes a struct security_operations variable that had | ||
101 | * previously been registered with a successful call to register_security(). | ||
102 | * | ||
103 | * If @ops does not match the valued previously passed to register_security() | ||
104 | * an error is returned. Otherwise the default security options is set to the | ||
105 | * the dummy_security_ops structure, and 0 is returned. | ||
106 | */ | ||
107 | int unregister_security(struct security_operations *ops) | ||
108 | { | ||
109 | if (ops != security_ops) { | ||
110 | printk(KERN_INFO "%s: trying to unregister " | ||
111 | "a security_opts structure that is not " | ||
112 | "registered, failing.\n", __FUNCTION__); | ||
113 | return -EINVAL; | ||
114 | } | ||
115 | |||
116 | security_ops = &dummy_security_ops; | ||
117 | |||
118 | return 0; | ||
119 | } | ||
120 | |||
121 | /** | ||
122 | * mod_reg_security - allows security modules to be "stacked" | 96 | * mod_reg_security - allows security modules to be "stacked" |
123 | * @name: a pointer to a string with the name of the security_options to be registered | 97 | * @name: a pointer to a string with the name of the security_options to be registered |
124 | * @ops: a pointer to the struct security_options that is to be registered | 98 | * @ops: a pointer to the struct security_options that is to be registered |
@@ -147,30 +121,6 @@ int mod_reg_security(const char *name, struct security_operations *ops) | |||
147 | return security_ops->register_security(name, ops); | 121 | return security_ops->register_security(name, ops); |
148 | } | 122 | } |
149 | 123 | ||
150 | /** | ||
151 | * mod_unreg_security - allows a security module registered with mod_reg_security() to be unloaded | ||
152 | * @name: a pointer to a string with the name of the security_options to be removed | ||
153 | * @ops: a pointer to the struct security_options that is to be removed | ||
154 | * | ||
155 | * This function allows security modules that have been successfully registered | ||
156 | * with a call to mod_reg_security() to be unloaded from the system. | ||
157 | * This calls the currently loaded security module's unregister_security() call | ||
158 | * with the @name and @ops variables. | ||
159 | * | ||
160 | * The return value depends on the currently loaded security module, with 0 as | ||
161 | * success. | ||
162 | */ | ||
163 | int mod_unreg_security(const char *name, struct security_operations *ops) | ||
164 | { | ||
165 | if (ops == security_ops) { | ||
166 | printk(KERN_INFO "%s invalid attempt to unregister " | ||
167 | " primary security ops.\n", __FUNCTION__); | ||
168 | return -EINVAL; | ||
169 | } | ||
170 | |||
171 | return security_ops->unregister_security(name, ops); | ||
172 | } | ||
173 | |||
174 | /* Security operations */ | 124 | /* Security operations */ |
175 | 125 | ||
176 | int security_ptrace(struct task_struct *parent, struct task_struct *child) | 126 | int security_ptrace(struct task_struct *parent, struct task_struct *child) |
@@ -528,11 +478,6 @@ int security_inode_killpriv(struct dentry *dentry) | |||
528 | return security_ops->inode_killpriv(dentry); | 478 | return security_ops->inode_killpriv(dentry); |
529 | } | 479 | } |
530 | 480 | ||
531 | const char *security_inode_xattr_getsuffix(void) | ||
532 | { | ||
533 | return security_ops->inode_xattr_getsuffix(); | ||
534 | } | ||
535 | |||
536 | int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) | 481 | int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) |
537 | { | 482 | { |
538 | if (unlikely(IS_PRIVATE(inode))) | 483 | if (unlikely(IS_PRIVATE(inode))) |
@@ -858,7 +803,6 @@ int security_netlink_send(struct sock *sk, struct sk_buff *skb) | |||
858 | { | 803 | { |
859 | return security_ops->netlink_send(sk, skb); | 804 | return security_ops->netlink_send(sk, skb); |
860 | } | 805 | } |
861 | EXPORT_SYMBOL(security_netlink_send); | ||
862 | 806 | ||
863 | int security_netlink_recv(struct sk_buff *skb, int cap) | 807 | int security_netlink_recv(struct sk_buff *skb, int cap) |
864 | { | 808 | { |