aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-06-22 10:50:08 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-07-15 18:58:45 -0400
commit058c5c99999609e3de7e15b49049665f02d06577 (patch)
treeb43d9c94c6f52fd53f8ad95eb37cd4c00513d37f /net/sunrpc
parent13e0e958e8e06d27a2c69b2ace8c11d256b52d67 (diff)
rpc: allow autoloading of gss mechanisms
Remove the need for an explicit modprobe of rpcsec_gss_krb5. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c7
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c32
2 files changed, 35 insertions, 4 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index c3b75333b821..8c67890de427 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -744,6 +744,13 @@ static struct pf_desc gss_kerberos_pfs[] = {
744 }, 744 },
745}; 745};
746 746
747MODULE_ALIAS("rpc-auth-gss-krb5");
748MODULE_ALIAS("rpc-auth-gss-krb5i");
749MODULE_ALIAS("rpc-auth-gss-krb5p");
750MODULE_ALIAS("rpc-auth-gss-390003");
751MODULE_ALIAS("rpc-auth-gss-390004");
752MODULE_ALIAS("rpc-auth-gss-390005");
753
747static struct gss_api_mech gss_kerberos_mech = { 754static struct gss_api_mech gss_kerberos_mech = {
748 .gm_name = "krb5", 755 .gm_name = "krb5",
749 .gm_owner = THIS_MODULE, 756 .gm_owner = THIS_MODULE,
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index e3c36a274412..ca8cad8251c7 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -141,7 +141,7 @@ gss_mech_get(struct gss_api_mech *gm)
141EXPORT_SYMBOL_GPL(gss_mech_get); 141EXPORT_SYMBOL_GPL(gss_mech_get);
142 142
143struct gss_api_mech * 143struct gss_api_mech *
144gss_mech_get_by_name(const char *name) 144_gss_mech_get_by_name(const char *name)
145{ 145{
146 struct gss_api_mech *pos, *gm = NULL; 146 struct gss_api_mech *pos, *gm = NULL;
147 147
@@ -158,6 +158,17 @@ gss_mech_get_by_name(const char *name)
158 158
159} 159}
160 160
161struct gss_api_mech * gss_mech_get_by_name(const char *name)
162{
163 struct gss_api_mech *gm = NULL;
164
165 gm = _gss_mech_get_by_name(name);
166 if (!gm) {
167 request_module("rpc-auth-gss-%s", name);
168 gm = _gss_mech_get_by_name(name);
169 }
170 return gm;
171}
161EXPORT_SYMBOL_GPL(gss_mech_get_by_name); 172EXPORT_SYMBOL_GPL(gss_mech_get_by_name);
162 173
163struct gss_api_mech * 174struct gss_api_mech *
@@ -194,10 +205,9 @@ mech_supports_pseudoflavor(struct gss_api_mech *gm, u32 pseudoflavor)
194 return 0; 205 return 0;
195} 206}
196 207
197struct gss_api_mech * 208struct gss_api_mech *_gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
198gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
199{ 209{
200 struct gss_api_mech *pos, *gm = NULL; 210 struct gss_api_mech *gm = NULL, *pos;
201 211
202 spin_lock(&registered_mechs_lock); 212 spin_lock(&registered_mechs_lock);
203 list_for_each_entry(pos, &registered_mechs, gm_list) { 213 list_for_each_entry(pos, &registered_mechs, gm_list) {
@@ -213,6 +223,20 @@ gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
213 return gm; 223 return gm;
214} 224}
215 225
226struct gss_api_mech *
227gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
228{
229 struct gss_api_mech *gm;
230
231 gm = _gss_mech_get_by_pseudoflavor(pseudoflavor);
232
233 if (!gm) {
234 request_module("rpc-auth-gss-%u", pseudoflavor);
235 gm = _gss_mech_get_by_pseudoflavor(pseudoflavor);
236 }
237 return gm;
238}
239
216EXPORT_SYMBOL_GPL(gss_mech_get_by_pseudoflavor); 240EXPORT_SYMBOL_GPL(gss_mech_get_by_pseudoflavor);
217 241
218int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr) 242int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr)