diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-02 21:14:16 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:47:12 +0100 |
commit | 7e298580e06a5b9a0c1210937af47f277849080e (patch) | |
tree | 86966688d99fef76740411b9f70a0a1b5d7af850 /source4/auth/gensec | |
parent | 120ecdb5cb7dbd7c650f3e9fbcefb925f695e0f2 (diff) | |
download | samba-7e298580e06a5b9a0c1210937af47f277849080e.tar.gz samba-7e298580e06a5b9a0c1210937af47f277849080e.tar.bz2 samba-7e298580e06a5b9a0c1210937af47f277849080e.zip |
r26234: More global_loadparm fixes.
(This used to be commit 84892d030de6266fc0f3a699cade960dd5dc37bc)
Diffstat (limited to 'source4/auth/gensec')
-rw-r--r-- | source4/auth/gensec/gensec_gssapi.c | 27 | ||||
-rw-r--r-- | source4/auth/gensec/schannel.c | 3 | ||||
-rw-r--r-- | source4/auth/gensec/schannel_state.c | 6 |
3 files changed, 20 insertions, 16 deletions
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c index fabdfb4308..fd6ca1a336 100644 --- a/source4/auth/gensec/gensec_gssapi.c +++ b/source4/auth/gensec/gensec_gssapi.c @@ -142,7 +142,8 @@ static int gensec_gssapi_destructor(struct gensec_gssapi_state *gensec_gssapi_st return 0; } -static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security) +static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security, + struct loadparm_context *lp_ctx) { struct gensec_gssapi_state *gensec_gssapi_state; krb5_error_code ret; @@ -155,7 +156,7 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security) gensec_gssapi_state->gss_exchange_count = 0; gensec_gssapi_state->max_wrap_buf_size - = lp_parm_int(global_loadparm, NULL, "gensec_gssapi", "max wrap buf size", 65536); + = lp_parm_int(lp_ctx, NULL, "gensec_gssapi", "max wrap buf size", 65536); gensec_gssapi_state->sasl = false; gensec_gssapi_state->sasl_state = STAGE_GSS_NEG; @@ -170,16 +171,16 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security) gensec_gssapi_state->input_chan_bindings = GSS_C_NO_CHANNEL_BINDINGS; gensec_gssapi_state->want_flags = 0; - if (lp_parm_bool(global_loadparm, NULL, "gensec_gssapi", "mutual", true)) { + if (lp_parm_bool(lp_ctx, NULL, "gensec_gssapi", "mutual", true)) { gensec_gssapi_state->want_flags |= GSS_C_MUTUAL_FLAG; } - if (lp_parm_bool(global_loadparm, NULL, "gensec_gssapi", "delegation", true)) { + if (lp_parm_bool(lp_ctx, NULL, "gensec_gssapi", "delegation", true)) { gensec_gssapi_state->want_flags |= GSS_C_DELEG_FLAG; } - if (lp_parm_bool(global_loadparm, NULL, "gensec_gssapi", "replay", true)) { + if (lp_parm_bool(lp_ctx, NULL, "gensec_gssapi", "replay", true)) { gensec_gssapi_state->want_flags |= GSS_C_REPLAY_FLAG; } - if (lp_parm_bool(global_loadparm, NULL, "gensec_gssapi", "sequence", true)) { + if (lp_parm_bool(lp_ctx, NULL, "gensec_gssapi", "sequence", true)) { gensec_gssapi_state->want_flags |= GSS_C_SEQUENCE_FLAG; } @@ -213,10 +214,10 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security) talloc_free(gensec_gssapi_state); return NT_STATUS_INTERNAL_ERROR; } - if (lp_realm(global_loadparm) && *lp_realm(global_loadparm)) { - char *upper_realm = strupper_talloc(gensec_gssapi_state, lp_realm(global_loadparm)); + if (lp_realm(lp_ctx) && *lp_realm(lp_ctx)) { + char *upper_realm = strupper_talloc(gensec_gssapi_state, lp_realm(lp_ctx)); if (!upper_realm) { - DEBUG(1,("gensec_krb5_start: could not uppercase realm: %s\n", lp_realm(global_loadparm))); + DEBUG(1,("gensec_krb5_start: could not uppercase realm: %s\n", lp_realm(lp_ctx))); talloc_free(gensec_gssapi_state); return NT_STATUS_NO_MEMORY; } @@ -230,7 +231,7 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security) } /* don't do DNS lookups of any kind, it might/will fail for a netbios name */ - ret = gsskrb5_set_dns_canonicalize(lp_parm_bool(global_loadparm, NULL, "krb5", "set_dns_canonicalize", false)); + ret = gsskrb5_set_dns_canonicalize(lp_parm_bool(lp_ctx, NULL, "krb5", "set_dns_canonicalize", false)); if (ret) { DEBUG(1,("gensec_krb5_start: gsskrb5_set_dns_canonicalize failed\n")); talloc_free(gensec_gssapi_state); @@ -239,7 +240,7 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security) ret = smb_krb5_init_context(gensec_gssapi_state, gensec_security->event_ctx, - global_loadparm, + lp_ctx, &gensec_gssapi_state->smb_krb5_context); if (ret) { DEBUG(1,("gensec_krb5_start: krb5_init_context failed (%s)\n", @@ -258,7 +259,7 @@ static NTSTATUS gensec_gssapi_server_start(struct gensec_security *gensec_securi struct cli_credentials *machine_account; struct gssapi_creds_container *gcc; - nt_status = gensec_gssapi_start(gensec_security); + nt_status = gensec_gssapi_start(gensec_security, global_loadparm); if (!NT_STATUS_IS_OK(nt_status)) { return nt_status; } @@ -323,7 +324,7 @@ static NTSTATUS gensec_gssapi_client_start(struct gensec_security *gensec_securi return NT_STATUS_INVALID_PARAMETER; } - nt_status = gensec_gssapi_start(gensec_security); + nt_status = gensec_gssapi_start(gensec_security, global_loadparm); if (!NT_STATUS_IS_OK(nt_status)) { return nt_status; } diff --git a/source4/auth/gensec/schannel.c b/source4/auth/gensec/schannel.c index 98d000be22..a5e8c60ae3 100644 --- a/source4/auth/gensec/schannel.c +++ b/source4/auth/gensec/schannel.c @@ -29,6 +29,7 @@ #include "auth/gensec/schannel_state.h" #include "auth/gensec/schannel_proto.h" #include "librpc/rpc/dcerpc.h" +#include "param/param.h" static size_t schannel_sig_size(struct gensec_security *gensec_security, size_t data_size) { @@ -119,7 +120,7 @@ static NTSTATUS schannel_update(struct gensec_security *gensec_security, TALLOC_ } /* pull the session key for this client */ - status = schannel_fetch_session_key(out_mem_ctx, workstation, + status = schannel_fetch_session_key(out_mem_ctx, global_loadparm, workstation, domain, &creds); if (!NT_STATUS_IS_OK(status)) { DEBUG(3, ("Could not find session key for attempted schannel connection from %s: %s\n", diff --git a/source4/auth/gensec/schannel_state.c b/source4/auth/gensec/schannel_state.c index 77f5dfb599..66358d7830 100644 --- a/source4/auth/gensec/schannel_state.c +++ b/source4/auth/gensec/schannel_state.c @@ -137,13 +137,14 @@ NTSTATUS schannel_store_session_key_ldb(TALLOC_CTX *mem_ctx, } NTSTATUS schannel_store_session_key(TALLOC_CTX *mem_ctx, + struct loadparm_context *lp_ctx, struct creds_CredentialState *creds) { struct ldb_context *ldb; NTSTATUS nt_status; int ret; - ldb = schannel_db_connect(mem_ctx, global_loadparm); + ldb = schannel_db_connect(mem_ctx, lp_ctx); if (!ldb) { return NT_STATUS_ACCESS_DENIED; } @@ -267,6 +268,7 @@ NTSTATUS schannel_fetch_session_key_ldb(TALLOC_CTX *mem_ctx, } NTSTATUS schannel_fetch_session_key(TALLOC_CTX *mem_ctx, + struct loadparm_context *lp_ctx, const char *computer_name, const char *domain, struct creds_CredentialState **creds) @@ -274,7 +276,7 @@ NTSTATUS schannel_fetch_session_key(TALLOC_CTX *mem_ctx, NTSTATUS nt_status; struct ldb_context *ldb; - ldb = schannel_db_connect(mem_ctx, global_loadparm); + ldb = schannel_db_connect(mem_ctx, lp_ctx); if (!ldb) { return NT_STATUS_ACCESS_DENIED; } |