*/
krb5_error_code gssapi_krb5_init (void);
+krb5_error_code gssapi_krb5_init_ev (void *event_context);
#define GSSAPI_KRB5_INIT() do { \
krb5_error_code kret_gss_init; \
return NULL;
}
-krb5_error_code
-gssapi_krb5_init (void)
-{
- krb5_error_code ret = 0;
#ifdef _SAMBA_BUILD_
+/* Init krb5 with an event context. Disgusting Samba-specific hack */
+
+krb5_error_code
+gssapi_krb5_init_ev (void *event_context)
+{
static struct smb_krb5_context *smb_krb5_context;
+ krb5_error_code ret = 0;
HEIMDAL_MUTEX_lock(&gssapi_krb5_context_mutex);
if(smb_krb5_context == NULL) {
- ret = smb_krb5_init_context(NULL, &smb_krb5_context);
+ ret = smb_krb5_init_context(event_context, &smb_krb5_context);
}
if (ret == 0 && !created_key) {
HEIMDAL_key_create(&gssapi_context_key,
}
HEIMDAL_MUTEX_unlock(&gssapi_krb5_context_mutex);
+ return ret;
+}
+#endif
+
+krb5_error_code
+gssapi_krb5_init (void)
+{
+ krb5_error_code ret = 0;
+#ifdef _SAMBA_BUILD_
+ ret = gssapi_krb5_init_ev(NULL);
#else
HEIMDAL_MUTEX_lock(&gssapi_krb5_context_mutex);
#include "lib/cmdline/popt_common.h"
#include "system/dir.h"
#include "system/filesys.h"
+#include "system/kerberos.h"
+/* For sepecifiying event context to GSSAPI below */
+#include "heimdal/lib/gssapi/gssapi_locl.h"
/*
recursively delete a directory tree
return 1;
}
+ /* Hack to ensure that GSSAPI uses the right event context */
+ gssapi_krb5_init_ev(event_ctx);
+
/* wait for events - this is where smbd sits for most of its
life */
event_loop_wait(event_ctx);