1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-23 20:23:50 +03:00

r25762: This test belongs best with the other checks for a valid parent, in

the objectclass module.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett
2007-10-31 04:41:36 +01:00
committed by Stefan Metzmacher
parent 958a92ed0c
commit 16a292fcb1
3 changed files with 15 additions and 8 deletions

View File

@@ -865,6 +865,14 @@ static int objectclass_rename(struct ldb_module *module, struct ldb_request *req
if (ldb_dn_is_special(req->op.rename.newdn)) { /* do not manipulate our control entries */
return ldb_next_request(module, req);
}
/* Firstly ensure we are not trying to rename it to be a child of itself */
if ((ldb_dn_compare_base(req->op.rename.olddn, req->op.rename.newdn) == 0)
&& (ldb_dn_compare(req->op.rename.olddn, req->op.rename.newdn) != 0)) {
ldb_asprintf_errstring(module->ldb, "Cannot rename %s to be a child of itself",
ldb_dn_get_linearized(req->op.rename.olddn));
return LDB_ERR_UNWILLING_TO_PERFORM;
}
h = oc_init_handle(req, module);
if (!h) {