From 7a26989d4c62f38dcafc2a688b8cbaccc6499480 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 17 Apr 2014 21:48:30 +1200 Subject: [PATCH] dsdb: Specify no event context to smb_krb5_init_context() in dsdb These routines parse principals and generate keys only, no network communication is done. Andrew Bartlett Signed-off-by: Andrew Bartlett Reviewed-by: Jeremy Allison --- source4/dsdb/samdb/cracknames.c | 4 ++-- source4/dsdb/samdb/ldb_modules/password_hash.c | 2 +- source4/dsdb/samdb/ldb_modules/update_keytab.c | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c index d09da25bb80..5db5edee2d6 100644 --- a/source4/dsdb/samdb/cracknames.c +++ b/source4/dsdb/samdb/cracknames.c @@ -663,7 +663,7 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx, char *unparsed_name; ret = smb_krb5_init_context(mem_ctx, - ldb_get_event_context(sam_ctx), + NULL, (struct loadparm_context *)ldb_get_opaque(sam_ctx, "loadparm"), &smb_krb5_context); @@ -704,7 +704,7 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx, char *service; ret = smb_krb5_init_context(mem_ctx, - ldb_get_event_context(sam_ctx), + NULL, (struct loadparm_context *)ldb_get_opaque(sam_ctx, "loadparm"), &smb_krb5_context); diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index 1dee6af8f39..85c9c1bd153 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -2231,7 +2231,7 @@ static int setup_io(struct ph_context *ac, /* Some operations below require kerberos contexts */ if (smb_krb5_init_context(ac, - ldb_get_event_context(ldb), + NULL, (struct loadparm_context *)ldb_get_opaque(ldb, "loadparm"), &io->smb_krb5_context) != 0) { return ldb_operr(ldb); diff --git a/source4/dsdb/samdb/ldb_modules/update_keytab.c b/source4/dsdb/samdb/ldb_modules/update_keytab.c index 6b195459e9e..7b056ba9def 100644 --- a/source4/dsdb/samdb/ldb_modules/update_keytab.c +++ b/source4/dsdb/samdb/ldb_modules/update_keytab.c @@ -377,7 +377,9 @@ static int update_kt_prepare_commit(struct ldb_module *module) struct update_kt_private *data = talloc_get_type(ldb_module_get_private(module), struct update_kt_private); struct dn_list *p; struct smb_krb5_context *smb_krb5_context; - int krb5_ret = smb_krb5_init_context(data, ldb_get_event_context(ldb), ldb_get_opaque(ldb, "loadparm"), + int krb5_ret = smb_krb5_init_context(data, + NULL, + ldb_get_opaque(ldb, "loadparm"), &smb_krb5_context); TALLOC_CTX *tmp_ctx = NULL; -- 2.11.4.GIT