svn commit: samba r15782 - in
branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .
idra at samba.org
idra at samba.org
Sun May 21 20:06:02 GMT 2006
Author: idra
Date: 2006-05-21 20:06:01 +0000 (Sun, 21 May 2006)
New Revision: 15782
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15782
Log:
More fixes for async cases
Modified:
branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectguid.c
branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c
branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c
Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectguid.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectguid.c 2006-05-21 16:30:03 UTC (rev 15781)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectguid.c 2006-05-21 20:06:01 UTC (rev 15782)
@@ -133,8 +133,10 @@
return LDB_ERR_OPERATIONS_ERROR;
}
+ *down_req = *req;
+
/* we have to copy the message as the caller might have it as a const */
- msg = ldb_msg_copy_shallow(down_req, req->op.add.message);
+ down_req->op.add.message = msg = ldb_msg_copy_shallow(down_req, req->op.add.message);
if (msg == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -152,16 +154,7 @@
if (ret) {
return ret;
}
-
- down_req->op.add.message = msg;
- down_req->controls = req->controls;
- down_req->creds = req->creds;
-
- down_req->async.context = req->async.context;
- down_req->async.callback = req->async.callback;
- down_req->async.timeout = req->async.timeout;
-
/* go on with the call chain */
ret = ldb_next_request(module, down_req);
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c 2006-05-21 16:30:03 UTC (rev 15781)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c 2006-05-21 20:06:01 UTC (rev 15782)
@@ -205,6 +205,8 @@
case LDB_REQ_MODIFY:
modified_orig_request->op.mod.message = msg2;
break;
+ default:
+ return LDB_ERR_OPERATIONS_ERROR;
}
/* Send the (modified) request of the original caller down to the database */
@@ -1275,7 +1277,7 @@
ac = talloc_get_type(h->private_data, struct ph_async_context);
- domain = get_domain_data(ac->module, ac, ac->search_res);
+ domain = get_domain_data(ac->module, ac, ac->dom_res);
if (domain == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -1693,7 +1695,8 @@
return LDB_SUCCESS;
}
}
- return LDB_SUCCESS;
+
+ break;
case PH_MOD_DO_REQ:
if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c 2006-05-21 16:30:03 UTC (rev 15781)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c 2006-05-21 20:06:01 UTC (rev 15782)
@@ -625,6 +625,20 @@
return LDB_ERR_OPERATIONS_ERROR;
}
+ /* make sure we also add person, organizationalPerson and top */
+ if ( ! samldb_find_or_add_attribute(module, msg2, "objectclass", "person", "person")) {
+ talloc_free(mem_ctx);
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+ if ( ! samldb_find_or_add_attribute(module, msg2, "objectclass", "organizationalPerson", "organizationalPerson")) {
+ talloc_free(mem_ctx);
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+ if ( ! samldb_find_or_add_attribute(module, msg2, "objectclass", "top", "top")) {
+ talloc_free(mem_ctx);
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+
/* meddle with objectclass */
if (ldb_msg_find_element(msg2, "samAccountName") == NULL) {
@@ -762,15 +776,18 @@
return ldb_next_request(module, req);
}
- /* is user or computer? add all relevant missing objects */
- if ((samldb_find_attribute(msg, "objectclass", "user") != NULL) ||
- (samldb_find_attribute(msg, "objectclass", "computer") != NULL)) {
- ret = samldb_fill_user_or_computer_object(module, msg, &msg2);
- if (ret) {
- return ret;
- }
+ /* is user or computer? Skip if not */
+ if ((samldb_find_attribute(msg, "objectclass", "user") == NULL) &&
+ (samldb_find_attribute(msg, "objectclass", "computer") == NULL)) {
+ return ldb_next_request(module, req);
}
+ /* add all relevant missing objects */
+ ret = samldb_fill_user_or_computer_object(module, msg, &msg2);
+ if (ret) {
+ return ret;
+ }
+
/* is group? add all relevant missing objects */
if ( ! msg2 ) {
if (samldb_find_attribute(msg, "objectclass", "group") != NULL) {
@@ -830,15 +847,18 @@
return LDB_ERR_OPERATIONS_ERROR;
}
- /* is user or computer? add all relevant missing objects */
- if ((samldb_find_attribute(msg, "objectclass", "user") != NULL) ||
- (samldb_find_attribute(msg, "objectclass", "computer") != NULL)) {
- ret = samldb_fill_user_or_computer_object(module, msg, &msg2);
- if (ret) {
- return ret;
- }
+ /* is user or computer? Skip if not */
+ if ((samldb_find_attribute(msg, "objectclass", "user") == NULL) &&
+ (samldb_find_attribute(msg, "objectclass", "computer") == NULL)) {
+ return ldb_next_request(module, req);
}
+ /* add all relevant missing objects */
+ ret = samldb_fill_user_or_computer_object(module, msg, &msg2);
+ if (ret) {
+ return ret;
+ }
+
/* is group? add all relevant missing objects */
if ( ! msg2 ) {
if (samldb_find_attribute(msg, "objectclass", "group") != NULL) {
More information about the samba-cvs
mailing list