s4-dsdb: deleted objects are expected to be missing mandatory attributes
authorAndrew Tridgell <tridge@samba.org>
Mon, 11 Jul 2011 02:20:27 +0000 (12:20 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 11 Jul 2011 04:32:44 +0000 (14:32 +1000)
the objectclass_attrs validation that an object contains all mandatory
attributes is incorrect for deleted objects, as they get stripped of
some mandatory attributes when deleted (for example, objectCategory
gets stripped)

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

source4/dsdb/samdb/ldb_modules/objectclass_attrs.c

index 302904ab971fc6bf2159fbaa1be7582ad93b055a..4525cf3dddbdeffce71f8a795e2d1b53a08eb4c4 100644 (file)
@@ -332,7 +332,8 @@ static int attr_handler2(struct oc_context *ac)
                }
        }
 
-       if (found_must_contain[0] != NULL) {
+       if (found_must_contain[0] != NULL &&
+           ldb_msg_check_string_attribute(msg, "isDeleted", "TRUE") == 0) {
                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));