diff options
author | Clive Ferreira <cliveferreira@catalyst.net.nz> | 2016-10-11 15:32:54 +1300 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2016-11-30 12:19:33 +0100 |
commit | 2be252946f65c9c1edc5676aae90a4b9e4a7d390 (patch) | |
tree | ae113f8c3e56c4aec0dfd400f32732af80d5ba73 | |
parent | 0802e0aed8f89d1eaf905b1769745cde56300df7 (diff) | |
download | samba-2be252946f65c9c1edc5676aae90a4b9e4a7d390.tar.gz |
objectclass_attrs: Only abort on a missing attribute when an attribute is both MUST and replicated
If an attribute is not replicated or constructed, it is quite normal for
it to be missing. This is the case with both rIDNextRid and
rIDPreviousAllocationPool. This currently prevents us switching the RID
master. On Windows, missing this attribute does not cause any problems
for the RID manager.
We may now remove the knownfail entry added earlier.
Signed-off-by: Clive Ferreira <cliveferreira@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Pair-programmed-with: Bob Campbell <bobcampbell@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12394
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Nov 2 01:28:44 CET 2016 on sn-devel-144
(cherry picked from commit 79dd22aacb4c12bd008d9ad354ec5ec088560748)
-rw-r--r-- | selftest/knownfail | 1 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/objectclass_attrs.c | 23 |
2 files changed, 17 insertions, 7 deletions
diff --git a/selftest/knownfail b/selftest/knownfail index c6151202ab3..c1899da9053 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -292,4 +292,3 @@ #ntvfs server blocks copychunk with execute access on read handle ^samba4.smb2.ioctl.copy_chunk_bad_access ^samba4.drs.getnc_exop.python.*getnc_exop.DrsReplicaPrefixMapTestCase.test_regular_prefix_map_ex_attid.* -^samba4.drs.getnc_exop.python.*getnc_exop.DrsReplicaSyncTestCase.test_edit_rid_master.* diff --git a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c index 616cff83482..e239fb946e7 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c @@ -426,12 +426,23 @@ static int attr_handler2(struct oc_context *ac) * replicated. */ if (found_must_contain[0] != NULL && - ldb_msg_check_string_attribute(msg, "isDeleted", "TRUE") == 0 && - ldb_request_get_control(ac->req, DSDB_CONTROL_DBCHECK) == NULL) { - ldb_asprintf_errstring(ldb, "objectclass_attrs: at least one mandatory attribute ('%s') on entry '%s' wasn't specified!", - found_must_contain[0], - ldb_dn_get_linearized(msg->dn)); - return LDB_ERR_OBJECT_CLASS_VIOLATION; + ldb_msg_check_string_attribute(msg, "isDeleted", "TRUE") == 0) { + + for (i = 0; found_must_contain[i] != NULL; i++) { + const struct dsdb_attribute *broken_attr = dsdb_attribute_by_lDAPDisplayName(ac->schema, + found_must_contain[i]); + + bool replicated = (broken_attr->systemFlags & + (DS_FLAG_ATTR_NOT_REPLICATED | DS_FLAG_ATTR_IS_CONSTRUCTED)) == 0; + + if (replicated) { + ldb_asprintf_errstring(ldb, "objectclass_attrs: at least one mandatory " + "attribute ('%s') on entry '%s' wasn't specified!", + found_must_contain[i], + ldb_dn_get_linearized(msg->dn)); + return LDB_ERR_OBJECT_CLASS_VIOLATION; + } + } } if (isSchemaAttr) { |