diff options
Diffstat (limited to 'net/sunrpc/auth.c')
-rw-r--r-- | net/sunrpc/auth.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 9b81be8d9946..2bc0cc2196e0 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
@@ -159,6 +159,41 @@ rpcauth_get_pseudoflavor(rpc_authflavor_t flavor, struct rpcsec_gss_info *info) | |||
159 | EXPORT_SYMBOL_GPL(rpcauth_get_pseudoflavor); | 159 | EXPORT_SYMBOL_GPL(rpcauth_get_pseudoflavor); |
160 | 160 | ||
161 | /** | 161 | /** |
162 | * rpcauth_get_gssinfo - find GSS tuple matching a GSS pseudoflavor | ||
163 | * @pseudoflavor: GSS pseudoflavor to match | ||
164 | * @info: rpcsec_gss_info structure to fill in | ||
165 | * | ||
166 | * Returns zero and fills in "info" if pseudoflavor matches a | ||
167 | * supported mechanism. | ||
168 | */ | ||
169 | int | ||
170 | rpcauth_get_gssinfo(rpc_authflavor_t pseudoflavor, struct rpcsec_gss_info *info) | ||
171 | { | ||
172 | rpc_authflavor_t flavor = pseudoflavor_to_flavor(pseudoflavor); | ||
173 | const struct rpc_authops *ops; | ||
174 | int result; | ||
175 | |||
176 | ops = auth_flavors[flavor]; | ||
177 | if (ops == NULL) | ||
178 | request_module("rpc-auth-%u", flavor); | ||
179 | spin_lock(&rpc_authflavor_lock); | ||
180 | ops = auth_flavors[flavor]; | ||
181 | if (ops == NULL || !try_module_get(ops->owner)) { | ||
182 | spin_unlock(&rpc_authflavor_lock); | ||
183 | return -ENOENT; | ||
184 | } | ||
185 | spin_unlock(&rpc_authflavor_lock); | ||
186 | |||
187 | result = -ENOENT; | ||
188 | if (ops->flavor2info != NULL) | ||
189 | result = ops->flavor2info(pseudoflavor, info); | ||
190 | |||
191 | module_put(ops->owner); | ||
192 | return result; | ||
193 | } | ||
194 | EXPORT_SYMBOL_GPL(rpcauth_get_gssinfo); | ||
195 | |||
196 | /** | ||
162 | * rpcauth_list_flavors - discover registered flavors and pseudoflavors | 197 | * rpcauth_list_flavors - discover registered flavors and pseudoflavors |
163 | * @array: array to fill in | 198 | * @array: array to fill in |
164 | * @size: size of "array" | 199 | * @size: size of "array" |