1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

kerberos: Remove un-used event context argument from smb_krb5_init_context()

The event context here was only specified in the server or admin-tool
context, which does not do network communication, so this only caused
a talloc_reference() and never any useful result.

The actual network communication code sets an event context directly
before making the network call.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Apr 28 02:24:57 CEST 2014 on sn-devel-104
This commit is contained in:
Andrew Bartlett 2014-04-17 22:35:33 +12:00
parent 7a26989d4c
commit 086c06e361
12 changed files with 6 additions and 25 deletions

View File

@ -49,7 +49,7 @@ _PUBLIC_ int cli_credentials_get_krb5_context(struct cli_credentials *cred,
return 0;
}
ret = smb_krb5_init_context(cred, NULL, lp_ctx,
ret = smb_krb5_init_context(cred, lp_ctx,
&cred->smb_krb5_context);
if (ret) {
cred->smb_krb5_context = NULL;

View File

@ -179,7 +179,6 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security)
}
ret = smb_krb5_init_context(gensec_gssapi_state,
NULL,
gensec_security->settings->lp_ctx,
&gensec_gssapi_state->smb_krb5_context);
if (ret) {

View File

@ -474,7 +474,6 @@ smb_krb5_init_context_basic(TALLOC_CTX *tmp_ctx,
}
krb5_error_code smb_krb5_init_context(void *parent_ctx,
struct tevent_context *ev,
struct loadparm_context *lp_ctx,
struct smb_krb5_context **smb_krb5_context)
{
@ -529,17 +528,6 @@ krb5_error_code smb_krb5_init_context(void *parent_ctx,
}
krb5_set_warn_dest(kctx, logf);
/* Set use of our socket lib */
if (ev) {
struct tevent_context *previous_ev;
ret = smb_krb5_context_set_event_ctx(*smb_krb5_context,
ev, &previous_ev);
if (ret) {
talloc_free(tmp_ctx);
return ret;
}
}
/* Set options in kerberos */
krb5_set_dns_canonicalize_hostname(kctx,

View File

@ -34,7 +34,7 @@ smb_krb5_init_context_basic(TALLOC_CTX *tmp_ctx,
struct loadparm_context *lp_ctx,
krb5_context *_krb5_context);
krb5_error_code smb_krb5_init_context(void *parent_ctx, struct tevent_context *ev,
krb5_error_code smb_krb5_init_context(void *parent_ctx,
struct loadparm_context *lp_ctx,
struct smb_krb5_context **smb_krb5_context);

View File

@ -630,7 +630,7 @@ _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
lpcfg_do_global_parameter(state->lp, "log level", "0");
}
if (smb_krb5_init_context(state, state->ev_ctx, state->lp, &state->smb_krb5_ctx) != 0) {
if (smb_krb5_init_context(state, state->lp, &state->smb_krb5_ctx) != 0) {
result = ISC_R_NOMEMORY;
goto failed;
}

View File

@ -663,7 +663,6 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
char *unparsed_name;
ret = smb_krb5_init_context(mem_ctx,
NULL,
(struct loadparm_context *)ldb_get_opaque(sam_ctx, "loadparm"),
&smb_krb5_context);
@ -704,7 +703,6 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
char *service;
ret = smb_krb5_init_context(mem_ctx,
NULL,
(struct loadparm_context *)ldb_get_opaque(sam_ctx, "loadparm"),
&smb_krb5_context);

View File

@ -2231,7 +2231,6 @@ static int setup_io(struct ph_context *ac,
/* Some operations below require kerberos contexts */
if (smb_krb5_init_context(ac,
NULL,
(struct loadparm_context *)ldb_get_opaque(ldb, "loadparm"),
&io->smb_krb5_context) != 0) {
return ldb_operr(ldb);

View File

@ -378,7 +378,6 @@ static int update_kt_prepare_commit(struct ldb_module *module)
struct dn_list *p;
struct smb_krb5_context *smb_krb5_context;
int krb5_ret = smb_krb5_init_context(data,
NULL,
ldb_get_opaque(ldb, "loadparm"),
&smb_krb5_context);
TALLOC_CTX *tmp_ctx = NULL;

View File

@ -918,7 +918,7 @@ static void kdc_task_init(struct task_server *task)
initialize_krb5_error_table();
ret = smb_krb5_init_context(kdc, task->event_ctx, task->lp_ctx, &kdc->smb_krb5_context);
ret = smb_krb5_init_context(kdc, task->lp_ctx, &kdc->smb_krb5_context);
if (ret) {
DEBUG(1,("kdc_task_init: krb5_init_context failed (%s)\n",
error_message(ret)));

View File

@ -45,7 +45,7 @@ NTSTATUS libnet_export_keytab(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, s
return NT_STATUS_NO_MEMORY;
}
ret = smb_krb5_init_context(ctx, ctx->event_ctx, ctx->lp_ctx, &smb_krb5_context);
ret = smb_krb5_init_context(ctx, ctx->lp_ctx, &smb_krb5_context);
if (ret) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -3764,7 +3764,6 @@ static NTSTATUS dcesrv_lsa_QueryDomainInformationPolicy(struct dcesrv_call_state
struct lsa_DomainInfoKerberos *k = &info->kerberos_info;
struct smb_krb5_context *smb_krb5_context;
int ret = smb_krb5_init_context(mem_ctx,
dce_call->event_ctx,
dce_call->conn->dce_ctx->lp_ctx,
&smb_krb5_context);
if (ret != 0) {

View File

@ -60,7 +60,6 @@ static bool torture_pac_self_check(struct torture_context *tctx)
TALLOC_CTX *mem_ctx = tctx;
torture_assert(tctx, 0 == smb_krb5_init_context(mem_ctx,
NULL,
tctx->lp_ctx,
&smb_krb5_context),
"smb_krb5_init_context");
@ -317,7 +316,7 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
time_t authtime;
TALLOC_CTX *mem_ctx = tctx;
torture_assert(tctx, 0 == smb_krb5_init_context(mem_ctx, NULL,
torture_assert(tctx, 0 == smb_krb5_init_context(mem_ctx,
tctx->lp_ctx,
&smb_krb5_context),
"smb_krb5_init_context");