summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/password_hash.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-06-04 05:28:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:52 -0500
commitca5accf224dc3ef998235603797b519866b57b1c (patch)
tree3d2790afbc47076c2b12611d5c1e5b20683b36c5 /source4/dsdb/samdb/ldb_modules/password_hash.c
parentb31c685ec293ef65bc33a474fc5a1d83545d4749 (diff)
downloadsamba-ca5accf224dc3ef998235603797b519866b57b1c.tar.gz
samba-ca5accf224dc3ef998235603797b519866b57b1c.tar.bz2
samba-ca5accf224dc3ef998235603797b519866b57b1c.zip
r16036: Add a couple of new functions to corretly deal with timeouts.
Check timeouts are correctly verified. Some minor fixed and removal of unused code. (This used to be commit b52e5d6a0cb1a32e62759eaa49ce3e4cc804cc92)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/password_hash.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index a04fb52cd2..8a400fbc63 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -510,6 +510,7 @@ static int build_domain_data_request(struct ph_async_context *ac,
ac->dom_req->async.context = ac;
ac->dom_req->async.callback = get_domain_data_callback;
ac->dom_req->async.timeout = ac->orig_req->async.timeout;
+ ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->dom_req);
return LDB_SUCCESS;
}
@@ -634,7 +635,7 @@ static int password_hash_add_do_add(struct ldb_async_handle *h) {
if (ac->down_req->op.add.message == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
-
+
/* Some operations below require kerberos contexts */
if (smb_krb5_init_context(ac->down_req, &smb_krb5_context) != 0) {
return LDB_ERR_OPERATIONS_ERROR;
@@ -685,6 +686,8 @@ static int password_hash_add_do_add(struct ldb_async_handle *h) {
ac->step = PH_ADD_DO_ADD;
+ ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->down_req);
+
/* perform the operation */
return ldb_next_request(ac->module, ac->down_req);
}
@@ -777,6 +780,8 @@ static int password_hash_modify(struct ldb_module *module, struct ldb_request *r
ac->step = PH_MOD_DO_REQ;
+ ldb_set_timeout_from_prev_req(module->ldb, req, ac->down_req);
+
return ldb_next_request(module, ac->down_req);
}
@@ -848,7 +853,7 @@ static int password_hash_mod_search_self(struct ldb_async_handle *h) {
ac->search_req->controls = NULL;
ac->search_req->async.context = ac;
ac->search_req->async.callback = get_self_callback;
- ac->search_req->async.timeout = ac->orig_req->async.timeout;
+ ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->search_req);
ac->step = PH_MOD_SEARCH_SELF;
@@ -1001,6 +1006,8 @@ static int password_hash_mod_do_mod(struct ldb_async_handle *h) {
ac->step = PH_MOD_DO_MOD;
+ ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->mod_req);
+
/* perform the search */
return ldb_next_request(ac->module, ac->mod_req);
}