summaryrefslogtreecommitdiff
path: root/source4/utils
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-02-13 10:24:16 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-02-13 10:24:16 +1100
commit71632a16977a93968b0d520a491a52f635e611a1 (patch)
tree75604f676004c10bdd9c4ee1cfdf917a90ddfc0b /source4/utils
parent147a2e3440056ec30d8b386901754a58ea3947d1 (diff)
downloadsamba-71632a16977a93968b0d520a491a52f635e611a1.tar.gz
samba-71632a16977a93968b0d520a491a52f635e611a1.tar.bz2
samba-71632a16977a93968b0d520a491a52f635e611a1.zip
Remove auth/ntlm as a dependency of GENSEC by means of function pointers.
When starting GENSEC on the server, the auth subsystem context must be passed in, which now includes function pointers to the key elements. This should (when the other dependencies are fixed up) allow GENSEC to exist as a client or server library without bundling in too much of our server code. Andrew Bartlett
Diffstat (limited to 'source4/utils')
-rw-r--r--source4/utils/ntlm_auth.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c
index bd262683d5..2c6f353252 100644
--- a/source4/utils/ntlm_auth.c
+++ b/source4/utils/ntlm_auth.c
@@ -482,16 +482,33 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
break;
case GSS_SPNEGO_SERVER:
case SQUID_2_5_NTLMSSP:
+ {
+ const char *winbind_method[] = { "winbind", NULL };
+ struct auth_context *auth_context;
+
msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx),
lp_iconv_convenience(lp_ctx), ev);
if (!msg) {
exit(1);
}
- if (!NT_STATUS_IS_OK(gensec_server_start(state, ev, lp_gensec_settings(state, lp_ctx),
- msg, &state->gensec_state))) {
+ nt_status = auth_context_create_methods(mem_ctx,
+ winbind_method,
+ ev,
+ msg,
+ lp_ctx,
+ &auth_context);
+
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ exit(1);
+ }
+
+ if (!NT_STATUS_IS_OK(gensec_server_start(state, ev,
+ lp_gensec_settings(state, lp_ctx),
+ auth_context, &state->gensec_state))) {
exit(1);
}
break;
+ }
default:
abort();
}