s4-drs: treat a zero GUID as not present in replmd_add_fix_la
authorAndrew Tridgell <tridge@samba.org>
Mon, 21 Dec 2009 10:18:31 +0000 (21:18 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 1 Jan 2010 21:16:53 +0000 (08:16 +1100)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 87868354a92fcc0f5a2aa020919b78bb0b1c8448..6e0c9b44e523305a9c9d22ffd1c01a5d92e45d84 100644 (file)
@@ -618,9 +618,12 @@ static int replmd_add_fix_la(struct ldb_module *module, struct ldb_message_eleme
                /* note that the DN already has the extended
                   components from the extended_dn_store module */
                status = dsdb_get_extended_dn_guid(dsdb_dn->dn, &target_guid, "GUID");
-               if (!NT_STATUS_IS_OK(status)) {
-                       talloc_free(tmp_ctx);
-                       return LDB_ERR_OPERATIONS_ERROR;
+               if (!NT_STATUS_IS_OK(status) || GUID_all_zero(&target_guid)) {
+                       ret = dsdb_module_guid_by_dn(module, dsdb_dn->dn, &target_guid);
+                       if (ret != LDB_SUCCESS) {
+                               talloc_free(tmp_ctx);
+                               return ret;
+                       }
                }
 
                ret = replmd_add_backlink(module, schema, guid, &target_guid, true, sa, false);