summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-08-30 00:25:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:10 -0500
commit50017a00757b00a572fc42405f761cf42119b4a4 (patch)
treed1e4477414ba418e213fd2933c6c22d9f1bf40d4
parent0b91f3916430d0271eab867675d44c5439de40c2 (diff)
downloadsamba-50017a00757b00a572fc42405f761cf42119b4a4.tar.gz
samba-50017a00757b00a572fc42405f761cf42119b4a4.tar.bz2
samba-50017a00757b00a572fc42405f761cf42119b4a4.zip
r24793: The subtree_rename module is a work of fiction. An resemblance to a
working module, live or dead, is purely co-incidental. Andrew Bartlett (This used to be commit 64cc31642fd2ded149631d07bc022213f19595b8)
-rw-r--r--source4/dsdb/samdb/ldb_modules/subtree_rename.c23
-rw-r--r--source4/scripting/libjs/provision.js1
2 files changed, 7 insertions, 17 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/subtree_rename.c b/source4/dsdb/samdb/ldb_modules/subtree_rename.c
index 993331216e..2cc83b308b 100644
--- a/source4/dsdb/samdb/ldb_modules/subtree_rename.c
+++ b/source4/dsdb/samdb/ldb_modules/subtree_rename.c
@@ -44,16 +44,6 @@ struct subtree_rename_context {
int finished_requests;
};
-struct subtree_rename_search_context {
- struct ldb_module *module;
- struct ldb_request *orig_req;
- struct ldb_handle *handle;
-
- struct ldb_request **down_req;
- int num_requests;
- int finished_requests;
-};
-
static struct subtree_rename_context *subtree_rename_init_handle(struct ldb_request *req,
struct ldb_module *module)
{
@@ -127,7 +117,9 @@ static int subtree_rename_search_callback(struct ldb_context *ldb, void *context
talloc_steal(req, newdn);
- req->handle = ac->handle;
+ talloc_steal(req, ares->message->dn);
+
+ talloc_free(ares);
ac->down_req = talloc_realloc(ac, ac->down_req,
struct ldb_request *, ac->num_requests + 1);
@@ -136,6 +128,7 @@ static int subtree_rename_search_callback(struct ldb_context *ldb, void *context
return LDB_ERR_OPERATIONS_ERROR;
}
ac->down_req[ac->num_requests] = req;
+ ac->num_requests++;
return ldb_next_request(ac->module, req);
@@ -176,7 +169,7 @@ static int subtree_rename(struct ldb_module *module, struct ldb_request *req)
ret = ldb_build_search_req(&new_req, module->ldb, req,
req->op.rename.olddn,
LDB_SCOPE_SUBTREE,
- "objectClass=*",
+ "(objectClass=*)",
attrs,
req->controls,
ac,
@@ -197,8 +190,6 @@ static int subtree_rename(struct ldb_module *module, struct ldb_request *req)
return ret;
}
- new_req->handle = req->handle;
-
ac->down_req = talloc_realloc(ac, ac->down_req,
struct ldb_request *, ac->num_requests + 1);
if (!ac->down_req) {
@@ -210,8 +201,8 @@ static int subtree_rename(struct ldb_module *module, struct ldb_request *req)
ldb_oom(ac->module->ldb);
return LDB_ERR_OPERATIONS_ERROR;
}
-
- return ldb_next_request(module, req);
+ ac->num_requests++;
+ return ldb_next_request(module, new_req);
}
static int subtree_rename_wait_none(struct ldb_handle *handle) {
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js
index f20eb547ac..ca0fedf97b 100644
--- a/source4/scripting/libjs/provision.js
+++ b/source4/scripting/libjs/provision.js
@@ -935,7 +935,6 @@ function provision_guess()
"objectclass",
"rdn_name",
"show_deleted",
- "subtree_rename",
"partition");
subobj.MODULES_LIST = join(",", modules_list);
subobj.DOMAINDN_LDB = "users.ldb";