summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-05-21 20:21:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:19 -0500
commit1a22d88c93b173ef4221f69d566be1e1f4797850 (patch)
treeacdf9446506c5e7216daf3085ee88719d5a458d8 /source4/dsdb/samdb/ldb_modules
parente2112ba3b7d491f6b6d9957b57a36a78efed18a9 (diff)
downloadsamba-1a22d88c93b173ef4221f69d566be1e1f4797850.tar.gz
samba-1a22d88c93b173ef4221f69d566be1e1f4797850.tar.bz2
samba-1a22d88c93b173ef4221f69d566be1e1f4797850.zip
r15783: Fix previous commit, was the wrong way to deal with the problem
(This used to be commit 36537100db491012d8124f7aca266a8290f2eee6)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c50
1 files changed, 24 insertions, 26 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 8a708af83b..706c0bb5c3 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -776,16 +776,14 @@ static int samldb_add(struct ldb_module *module, struct ldb_request *req)
return ldb_next_request(module, req);
}
- /* 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 user or computer? */
+ if ((samldb_find_attribute(msg, "objectclass", "user") != NULL) ||
+ (samldb_find_attribute(msg, "objectclass", "computer") != NULL)) {
+ /* 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 */
@@ -842,21 +840,14 @@ static int samldb_add_async(struct ldb_module *module, struct ldb_request *req)
return ldb_next_request(module, req);
}
- down_req = talloc(module, struct ldb_request);
- if (down_req == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- /* is user or computer? Skip if not */
+ /* is user or computer? */
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;
+ /* 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 */
@@ -879,11 +870,18 @@ static int samldb_add_async(struct ldb_module *module, struct ldb_request *req)
}
}
+ if (msg2 == NULL) {
+ return ldb_next_request(module, req);
+ }
+
+ down_req = talloc(module, struct ldb_request);
+ if (down_req == NULL) {
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+
*down_req = *req;
- if (msg2 != NULL) {
- down_req->op.add.message = talloc_steal(down_req, msg2);
- }
+ down_req->op.add.message = talloc_steal(down_req, msg2);
/* go on with the call chain */
ret = ldb_next_request(module, down_req);