summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-10 21:01:11 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-10 21:01:11 +0200
commit067b5721c71cbc0004ea59d357e79cd4fc8d8954 (patch)
treeabee068b2b85d47d5221a3d2cabec7addb1118fc /source4
parent303089f5b8ced9fb80ed76cb0205f0cdf11fc530 (diff)
downloadsamba-067b5721c71cbc0004ea59d357e79cd4fc8d8954.tar.gz
samba-067b5721c71cbc0004ea59d357e79cd4fc8d8954.tar.bz2
samba-067b5721c71cbc0004ea59d357e79cd4fc8d8954.zip
s4:objectclass LDB module - weak the check for the "rIDSet" delete constraint
Perform it only when a "rIDSet" does exist. Requested by ekacnet for "upgradeprovision".
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index 9c2e416dcc..548d51e614 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -1366,20 +1366,22 @@ static int objectclass_do_delete(struct oc_context *ac)
}
/* DC's rIDSet object */
+ /* Perform this check only when it does exist - this is needed in order
+ * to don't let existing provisions break. */
ret = samdb_rid_set_dn(ldb, ac, &dn);
- if (ret != LDB_SUCCESS) {
+ if ((ret != LDB_SUCCESS) && (ret != LDB_ERR_NO_SUCH_OBJECT)) {
return ret;
}
-
- if (ldb_dn_compare(ac->req->op.del.dn, dn) == 0) {
+ if (ret == LDB_SUCCESS) {
+ if (ldb_dn_compare(ac->req->op.del.dn, dn) == 0) {
+ talloc_free(dn);
+ ldb_asprintf_errstring(ldb, "objectclass: Cannot delete %s, it's the DC's rIDSet object!",
+ ldb_dn_get_linearized(ac->req->op.del.dn));
+ return LDB_ERR_UNWILLING_TO_PERFORM;
+ }
talloc_free(dn);
- ldb_asprintf_errstring(ldb, "objectclass: Cannot delete %s, it's the DC's rIDSet object!",
- ldb_dn_get_linearized(ac->req->op.del.dn));
- return LDB_ERR_UNWILLING_TO_PERFORM;
}
- talloc_free(dn);
-
/* crossRef objects regarding config, schema and default domain NCs */
if (samdb_find_attribute(ldb, ac->search_res->message, "objectClass",
"crossRef") != NULL) {