libnet: set the invocation_id earlier in order to avoid annoying messages
authorMatthieu Patou <mat@matws.net>
Mon, 31 Dec 2012 10:12:23 +0000 (02:12 -0800)
committerMatthieu Patou <mat@samba.org>
Wed, 9 Jan 2013 06:19:54 +0000 (07:19 +0100)
At that moment we have all the information to set the invocation id so
let's set it, it will avoid useless messages about missing invocation
id.

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
source4/libnet/libnet_vampire.c

index 4091346..a354d41 100644 (file)
@@ -288,6 +288,19 @@ static NTSTATUS libnet_vampire_cb_apply_schema(struct libnet_vampire_cb_state *s
        default:
                return NT_STATUS_INVALID_PARAMETER;
        }
+       /* We must set these up to ensure the replMetaData is written
+        * correctly, before our NTDS Settings entry is replicated */
+       ok = samdb_set_ntds_invocation_id(s->ldb, &c->dest_dsa->invocation_id);
+       if (!ok) {
+               DEBUG(0,("Failed to set cached ntds invocationId\n"));
+               return NT_STATUS_FOOBAR;
+       }
+       ok = samdb_set_ntds_objectGUID(s->ldb, &c->dest_dsa->ntds_guid);
+       if (!ok) {
+               DEBUG(0,("Failed to set cached ntds objectGUID\n"));
+               return NT_STATUS_FOOBAR;
+       }
+
 
        status = dsdb_schema_pfm_from_drsuapi_pfm(mapping_ctr, true,
                                                  s, &pfm_remote, NULL);
@@ -492,19 +505,6 @@ static NTSTATUS libnet_vampire_cb_apply_schema(struct libnet_vampire_cb_state *s
        talloc_free(s_dsa);
        talloc_free(schema_objs);
 
-       /* We must set these up to ensure the replMetaData is written
-        * correctly, before our NTDS Settings entry is replicated */
-       ok = samdb_set_ntds_invocation_id(s->ldb, &c->dest_dsa->invocation_id);
-       if (!ok) {
-               DEBUG(0,("Failed to set cached ntds invocationId\n"));
-               return NT_STATUS_FOOBAR;
-       }
-       ok = samdb_set_ntds_objectGUID(s->ldb, &c->dest_dsa->ntds_guid);
-       if (!ok) {
-               DEBUG(0,("Failed to set cached ntds objectGUID\n"));
-               return NT_STATUS_FOOBAR;
-       }
-
        s->schema = dsdb_get_schema(s->ldb, s);
        if (!s->schema) {
                DEBUG(0,("Failed to get loaded dsdb_schema\n"));