summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-05-20 19:37:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:15 -0500
commit6d0969aa1adff4c7f134bd6e3e42997e72b41cf6 (patch)
tree67b86f66eb8f698988c3484c55774e3b1397ced5 /source4/dsdb
parente23cc70a72e6582e91bcfdaf1d6ed2191e7e23a6 (diff)
downloadsamba-6d0969aa1adff4c7f134bd6e3e42997e72b41cf6.tar.gz
samba-6d0969aa1adff4c7f134bd6e3e42997e72b41cf6.tar.bz2
samba-6d0969aa1adff4c7f134bd6e3e42997e72b41cf6.zip
r15761: Fix-as-you-go ...
Testing various async paths and uncovering bugs (This used to be commit 099d873ea596ece18efe63b06bc64e7f97a96f82)
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index b7f4aff67a..617962b909 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -1672,11 +1672,11 @@ static int ph_async_wait(struct ldb_async_handle *handle) {
switch (ac->step) {
case PH_ADD_SEARCH_DOM:
- if (ac->dom_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->dom_req->async.handle->state != LDB_ASYNC_DONE) {
ret = ldb_async_wait(ac->dom_req->async.handle, LDB_WAIT_NONE);
- if (ret != LDB_SUCCESS) goto error;
+ if (ret != LDB_SUCCESS) goto done;
- if (ac->dom_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->dom_req->async.handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
}
@@ -1685,22 +1685,22 @@ static int ph_async_wait(struct ldb_async_handle *handle) {
return password_hash_add_async_do_add(handle);
case PH_ADD_DO_ADD:
- if (ac->down_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
ret = ldb_async_wait(ac->down_req->async.handle, LDB_WAIT_NONE);
- if (ret != LDB_SUCCESS) goto error;
+ if (ret != LDB_SUCCESS) goto done;
- if (ac->down_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
}
return LDB_SUCCESS;
case PH_MOD_DO_REQ:
- if (ac->down_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
ret = ldb_async_wait(ac->down_req->async.handle, LDB_WAIT_NONE);
- if (ret != LDB_SUCCESS) goto error;
+ if (ret != LDB_SUCCESS) goto done;
- if (ac->down_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
}
@@ -1709,11 +1709,11 @@ static int ph_async_wait(struct ldb_async_handle *handle) {
return password_hash_mod_async_search_self(handle);
case PH_MOD_SEARCH_SELF:
- if (ac->search_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->search_req->async.handle->state != LDB_ASYNC_DONE) {
ret = ldb_async_wait(ac->search_req->async.handle, LDB_WAIT_NONE);
- if (ret != LDB_SUCCESS) goto error;
+ if (ret != LDB_SUCCESS) goto done;
- if (ac->search_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->search_req->async.handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
}
@@ -1722,11 +1722,11 @@ static int ph_async_wait(struct ldb_async_handle *handle) {
return password_hash_mod_async_search_dom(handle);
case PH_MOD_SEARCH_DOM:
- if (ac->dom_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->dom_req->async.handle->state != LDB_ASYNC_DONE) {
ret = ldb_async_wait(ac->dom_req->async.handle, LDB_WAIT_NONE);
- if (ret != LDB_SUCCESS) goto error;
+ if (ret != LDB_SUCCESS) goto done;
- if (ac->dom_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->dom_req->async.handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
}
@@ -1735,22 +1735,25 @@ static int ph_async_wait(struct ldb_async_handle *handle) {
return password_hash_mod_async_do_mod(handle);
case PH_MOD_DO_MOD:
- if (ac->mod_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->mod_req->async.handle->state != LDB_ASYNC_DONE) {
ret = ldb_async_wait(ac->mod_req->async.handle, LDB_WAIT_NONE);
- if (ret != LDB_SUCCESS) goto error;
+ if (ret != LDB_SUCCESS) goto done;
- if (ac->mod_req->async.handle->status != LDB_ASYNC_DONE) {
+ if (ac->mod_req->async.handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
}
- return LDB_SUCCESS;
+
+ break;
default:
ret = LDB_ERR_OPERATIONS_ERROR;
- goto error;
+ goto done;
}
-error:
+ ret = LDB_SUCCESS;
+
+done:
handle->state = LDB_ASYNC_DONE;
handle->status = ret;
return ret;