diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2012-07-11 16:31:08 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-07-16 15:12:15 -0400 |
commit | 6a1a1e34dc55f17e7bd260809207442dbb7a0296 (patch) | |
tree | 3a2ce5b9d3c8edc80f6486efc1f9b34cee559f8f /include | |
parent | 56d08fef2369d5ca9ad2e1fc697f5379fd8af751 (diff) |
SUNRPC: Add rpcauth_list_flavors()
The gss_mech_list_pseudoflavors() function provides a list of
currently registered GSS pseudoflavors. This list does not include
any non-GSS flavors that have been registered with the RPC client.
nfs4_find_root_sec() currently adds these extra flavors by hand.
Instead, nfs4_find_root_sec() should be looking at the set of flavors
that have been explicitly registered via rpcauth_register(). And,
other areas of code will soon need the same kind of list that
contains all flavors the kernel currently knows about (see below).
Rather than cloning the open-coded logic in nfs4_find_root_sec() to
those new places, introduce a generic RPC function that generates a
full list of registered auth flavors and pseudoflavors.
A new rpc_authops method is added that lists a flavor's
pseudoflavors, if it has any. I encountered an interesting module
loader loop when I tried to get the RPC client to invoke
gss_mech_list_pseudoflavors() by name.
This patch is a pre-requisite for server trunking discovery, and a
pre-requisite for fixing up the in-kernel mount client to do better
automatic security flavor selection.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sunrpc/auth.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/gss_api.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 492a36d72829..f25ba922baaf 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -101,6 +101,7 @@ struct rpc_authops { | |||
101 | struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); | 101 | struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); |
102 | int (*pipes_create)(struct rpc_auth *); | 102 | int (*pipes_create)(struct rpc_auth *); |
103 | void (*pipes_destroy)(struct rpc_auth *); | 103 | void (*pipes_destroy)(struct rpc_auth *); |
104 | int (*list_pseudoflavors)(rpc_authflavor_t *, int); | ||
104 | }; | 105 | }; |
105 | 106 | ||
106 | struct rpc_credops { | 107 | struct rpc_credops { |
@@ -135,6 +136,7 @@ int rpcauth_register(const struct rpc_authops *); | |||
135 | int rpcauth_unregister(const struct rpc_authops *); | 136 | int rpcauth_unregister(const struct rpc_authops *); |
136 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); | 137 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); |
137 | void rpcauth_release(struct rpc_auth *); | 138 | void rpcauth_release(struct rpc_auth *); |
139 | int rpcauth_list_flavors(rpc_authflavor_t *, int); | ||
138 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); | 140 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); |
139 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | 141 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); |
140 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); | 142 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 332da61cf8b7..a19e2547ae6a 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
16 | #include <linux/sunrpc/xdr.h> | 16 | #include <linux/sunrpc/xdr.h> |
17 | #include <linux/sunrpc/msg_prot.h> | ||
17 | #include <linux/uio.h> | 18 | #include <linux/uio.h> |
18 | 19 | ||
19 | /* The mechanism-independent gss-api context: */ | 20 | /* The mechanism-independent gss-api context: */ |
@@ -127,7 +128,7 @@ struct gss_api_mech *gss_mech_get_by_name(const char *); | |||
127 | struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); | 128 | struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); |
128 | 129 | ||
129 | /* Fill in an array with a list of supported pseudoflavors */ | 130 | /* Fill in an array with a list of supported pseudoflavors */ |
130 | int gss_mech_list_pseudoflavors(u32 *); | 131 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int); |
131 | 132 | ||
132 | /* Just increments the mechanism's reference count and returns its input: */ | 133 | /* Just increments the mechanism's reference count and returns its input: */ |
133 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); | 134 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); |