summaryrefslogtreecommitdiffstats
path: root/sys/kgssapi
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2011-06-19 22:08:55 +0000
committerrmacklem <rmacklem@FreeBSD.org>2011-06-19 22:08:55 +0000
commitbe57e75b00c1ba88332a570e83564f6cae5dba45 (patch)
tree1748b2392bad991b60d72c1a5c4c795f329b87ca /sys/kgssapi
parentf3c935589780909d53003a34a63975a197937374 (diff)
downloadFreeBSD-src-be57e75b00c1ba88332a570e83564f6cae5dba45.zip
FreeBSD-src-be57e75b00c1ba88332a570e83564f6cae5dba45.tar.gz
Fix the kgssapi so that it can be loaded as a module. Currently
the NFS subsystems use five of the rpcsec_gss/kgssapi entry points, but since it was not obvious which others might be useful, all nineteen were included. Basically the nineteen entry points are set in a structure called rpc_gss_entries and inline functions defined in sys/rpc/rpcsec_gss.h check for the entry points being non-NULL and then call them. A default value is returned otherwise. Requested by rwatson. Reviewed by: jhb MFC after: 2 weeks
Diffstat (limited to 'sys/kgssapi')
-rw-r--r--sys/kgssapi/gss_impl.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/sys/kgssapi/gss_impl.c b/sys/kgssapi/gss_impl.c
index 01d940a..09b0a4b 100644
--- a/sys/kgssapi/gss_impl.c
+++ b/sys/kgssapi/gss_impl.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <kgssapi/gssapi_impl.h>
#include <rpc/rpc.h>
#include <rpc/rpc_com.h>
+#include <rpc/rpcsec_gss.h>
#include "gssd.h"
#include "kgss_if.h"
@@ -253,8 +254,40 @@ kgss_copy_buffer(const gss_buffer_t from, gss_buffer_t to)
static int
kgssapi_modevent(module_t mod, int type, void *data)
{
-
- return (0);
+ int error = 0;
+
+ switch (type) {
+ case MOD_LOAD:
+ rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind;
+ rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge;
+ rpc_gss_entries.rpc_gss_seccreate = rpc_gss_seccreate;
+ rpc_gss_entries.rpc_gss_set_defaults = rpc_gss_set_defaults;
+ rpc_gss_entries.rpc_gss_max_data_length =
+ rpc_gss_max_data_length;
+ rpc_gss_entries.rpc_gss_get_error = rpc_gss_get_error;
+ rpc_gss_entries.rpc_gss_mech_to_oid = rpc_gss_mech_to_oid;
+ rpc_gss_entries.rpc_gss_oid_to_mech = rpc_gss_oid_to_mech;
+ rpc_gss_entries.rpc_gss_qop_to_num = rpc_gss_qop_to_num;
+ rpc_gss_entries.rpc_gss_get_mechanisms = rpc_gss_get_mechanisms;
+ rpc_gss_entries.rpc_gss_get_versions = rpc_gss_get_versions;
+ rpc_gss_entries.rpc_gss_is_installed = rpc_gss_is_installed;
+ rpc_gss_entries.rpc_gss_set_svc_name = rpc_gss_set_svc_name;
+ rpc_gss_entries.rpc_gss_clear_svc_name = rpc_gss_clear_svc_name;
+ rpc_gss_entries.rpc_gss_getcred = rpc_gss_getcred;
+ rpc_gss_entries.rpc_gss_set_callback = rpc_gss_set_callback;
+ rpc_gss_entries.rpc_gss_clear_callback = rpc_gss_clear_callback;
+ rpc_gss_entries.rpc_gss_get_principal_name =
+ rpc_gss_get_principal_name;
+ rpc_gss_entries.rpc_gss_svc_max_data_length =
+ rpc_gss_svc_max_data_length;
+ break;
+ case MOD_UNLOAD:
+ /* Unloading of the kgssapi module isn't supported. */
+ /* FALLTHROUGH */
+ default:
+ error = EOPNOTSUPP;
+ };
+ return (error);
}
static moduledata_t kgssapi_mod = {
"kgssapi",
OpenPOWER on IntegriCloud