kerberos: Remove un-used event context argument from smb_krb5_init_context()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 17 Apr 2014 10:35:33 +0000 (22:35 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 28 Apr 2014 00:24:57 +0000 (02:24 +0200)
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

12 files changed:
auth/credentials/credentials_krb5.c
source4/auth/gensec/gensec_gssapi.c
source4/auth/kerberos/krb5_init_context.c
source4/auth/kerberos/krb5_init_context.h
source4/dns_server/dlz_bind9.c
source4/dsdb/samdb/cracknames.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/update_keytab.c
source4/kdc/kdc.c
source4/libnet/libnet_export_keytab.c
source4/rpc_server/lsa/dcesrv_lsa.c
source4/torture/auth/pac.c

index 31fc9d2bebd252a8378038bc2d75651ad2bf75fe..489a959daf8107a4a0379635a075b2f1cb13d19c 100644 (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;
index 63fda1f807d26c722c973cccc17dc1f1acd4cb50..fdae2a8bb9fc474e11c184633c1e209631c641b6 100644 (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) {
index 12aab3404f9b044fbe8ef9216976622d24e62517..4404b6734c0fcfbb1807f2a1af24d6e0d73550ec 100644 (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,
index b955ae508dd3a6b30411f5cd6003e561ad8d3716..3c32069ba2fdf34e4e22577deafad34094c697e1 100644 (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); 
 
index f5ceb6a581d9f1cb410fa1da8fe2e73fa3015938..677578a97e901fb24607271ded2b8c0c04975299 100644 (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;
        }
index 5db5edee2d61a716cd0c5d7561542a9914d59321..5e97efcee3f58ba52a4efa22c3fbf4e28da23a31 100644 (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);
 
index 85c9c1bd1532692f0028ae70318054e8f3ab8046..f8114634441f85d6780e7c3ed58f9434d70e618e 100644 (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);
index 7b056ba9defea82b2fc431025072f1ee3f2c5004..42c3fa8fea0f936cbb6ba16a3a5aea84756f8eb7 100644 (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;
index 346b9014c16eee3e936b61b60e9c2221e756ba2e..4a16f7e5e029229fd08df8937fcee9f29009e687 100644 (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)));
index 16165b81c7b7232e606e0910ad9baccbe74318e3..295624e9f7110a428db20b390a374b7cd37e3f72 100644 (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; 
        }
index 6063ebe09b1e3866f805e49429b63ab2867a3ce5..e22a614c7a171fcf257c30538b0e4b0d7223ac46 100644 (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) {
index 64a843c07fcf53aa89e65e1c066ab9e4f6d7cfb0..c019c09672c723fed2c6f83b5d5600c6623e5064 100644 (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");