s4-dsdb: preserve @BL_lastKnownParent when deleting an object
authorMatthieu Patou <mat@matws.net>
Sun, 22 May 2011 18:26:14 +0000 (22:26 +0400)
committerMatthieu Patou <mat@matws.net>
Sat, 11 Jun 2011 19:18:55 +0000 (23:18 +0400)
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 784256b5b04574909d405629fef93f8bd140a05d..cb0c67da44a447c9058527e4442a09c7f58f6685 100644 (file)
@@ -2667,7 +2667,8 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req)
        struct ldb_result *res, *parent_res;
        const char *preserved_attrs[] = {
                /* yes, this really is a hard coded list. See MS-ADTS
-                  section 3.1.1.5.5.1.1 */
+                  section 3.1.1.5.5.1.1, we add our pseudo backlink for attribute lastKnownParent
+                  as we need lastKnowParent to be updated even when the parent object is deleted.*/
                "nTSecurityDescriptor", "attributeID", "attributeSyntax", "dNReferenceUpdate", "dNSHostName",
                "flatName", "governsID", "groupType", "instanceType", "lDAPDisplayName", "legacyExchangeDN",
                "isDeleted", "isRecycled", "lastKnownParent", "msDS-LastKnownRDN", "mS-DS-CreatorSID",
@@ -2675,7 +2676,7 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req)
                "oMSyntax", "proxiedObjectName", "name", "replPropertyMetaData", "sAMAccountName",
                "securityIdentifier", "sIDHistory", "subClassOf", "systemFlags", "trustPartner", "trustDirection",
                "trustType", "trustAttributes", "userAccountControl", "uSNChanged", "uSNCreated", "whenCreated",
-               "whenChanged", NULL};
+               "whenChanged", "@BL_lastKnownParent", NULL};
        unsigned int i, el_count = 0;
        enum deletion_state { OBJECT_NOT_DELETED=1, OBJECT_DELETED=2, OBJECT_RECYCLED=3,
                                                OBJECT_TOMBSTONE=4, OBJECT_REMOVED=5 };