From 42127cdbb040a260c2c745e9114b600f2186794a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 11 Oct 2010 16:53:08 +1100 Subject: s4-credentials Add explicit event context handling to Kerberos calls (only) By setting the event context to use for this operation (only) onto the krb5_context just before we call that operation, we can try and emulate the specification of an event context to the actual send_to_kdc() This eliminates the specification of an event context to many other cli_credentials calls, and the last use of event_context_find() Special care is taken to restore the event context in the event of nesting in the send_to_kdc function. Andrew Bartlett --- source4/dsdb/samdb/samdb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source4/dsdb') diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c index 57de27a22e..d8c1728d3f 100644 --- a/source4/dsdb/samdb/samdb.c +++ b/source4/dsdb/samdb/samdb.c @@ -55,8 +55,7 @@ static int samdb_credentials_destructor(struct cli_credentials *creds) this returns a static set of system credentials. It is static so that we always get the same pointer in ldb_wrap_connect() */ -struct cli_credentials *samdb_credentials(struct tevent_context *event_ctx, - struct loadparm_context *lp_ctx) +struct cli_credentials *samdb_credentials(struct loadparm_context *lp_ctx) { static struct cli_credentials *static_credentials; struct cli_credentials *cred; @@ -77,7 +76,7 @@ struct cli_credentials *samdb_credentials(struct tevent_context *event_ctx, * anyway */ cli_credentials_set_kerberos_state(cred, CRED_DONT_USE_KERBEROS); - if (!NT_STATUS_IS_OK(cli_credentials_set_secrets(cred, event_ctx, lp_ctx, NULL, NULL, + if (!NT_STATUS_IS_OK(cli_credentials_set_secrets(cred, lp_ctx, NULL, NULL, SECRETS_LDAP_FILTER, &error_string))) { DEBUG(5, ("(normal if no LDAP backend) %s", error_string)); /* Perfectly OK - if not against an LDAP backend */ @@ -106,7 +105,7 @@ struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx, int ret; url = lpcfg_sam_url(lp_ctx); - credentials = samdb_credentials(ev_ctx, lp_ctx); + credentials = samdb_credentials(lp_ctx); ldb = ldb_wrap_find(url, ev_ctx, lp_ctx, session_info, credentials, flags); if (ldb != NULL) -- cgit