]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dssync: record the bind info in the new remote_info28 in libnet_dssync_bind().
authorMichael Adam <obnox@samba.org>
Thu, 17 Jul 2008 11:04:04 +0000 (13:04 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 1 Aug 2008 14:04:41 +0000 (16:04 +0200)
This extracts the info24 data in case this is what was returned (instead of info28).
E.g. windows 2000 returns info24.

Michael

source/libnet/libnet_dssync.c

index 9801ec76d099a862d73fe15f837378e6cc7cc9d4..35f420c9016c956bdefcb4eb16dd9abaf36eaccf 100644 (file)
@@ -241,6 +241,35 @@ static NTSTATUS libnet_dssync_bind(TALLOC_CTX *mem_ctx,
                return werror_to_ntstatus(werr);
        }
 
+       ZERO_STRUCT(ctx->remote_info28);
+       switch (bind_info.length) {
+       case 24: {
+               struct drsuapi_DsBindInfo24 *info24;
+               info24 = &bind_info.info.info24;
+               ctx->remote_info28.site_guid            = info24->site_guid;
+               ctx->remote_info28.supported_extensions = info24->supported_extensions;
+               ctx->remote_info28.pid                  = info24->pid;
+               ctx->remote_info28.repl_epoch           = 0;
+               break;
+       }
+       case 28:
+               ctx->remote_info28 = bind_info.info.info28;
+               break;
+       case 48: {
+               struct drsuapi_DsBindInfo48 *info48;
+               info48 = &bind_info.info.info48;
+               ctx->remote_info28.site_guid            = info48->site_guid;
+               ctx->remote_info28.supported_extensions = info48->supported_extensions;
+               ctx->remote_info28.pid                  = info48->pid;
+               ctx->remote_info28.repl_epoch           = info48->repl_epoch;
+               break;
+       }
+       default:
+               DEBUG(1, ("Warning: invalid info length in bind info: %d\n",
+                         bind_info.length));
+               break;
+       }
+
        return status;
 }