mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
idl:drsuapi: Manage all possible lengths of drsuapi_DsBindInfo
Signed-off-by: Samuel Cabrero <scabrero@zentyal.com> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
This commit is contained in:
parent
331fb7fc64
commit
d747372d28
@ -129,6 +129,14 @@ interface drsuapi
|
|||||||
uint32 repl_epoch;
|
uint32 repl_epoch;
|
||||||
} drsuapi_DsBindInfo28;
|
} drsuapi_DsBindInfo28;
|
||||||
|
|
||||||
|
typedef [public] struct {
|
||||||
|
drsuapi_SupportedExtensions supported_extensions;
|
||||||
|
GUID site_guid;
|
||||||
|
uint32 pid;
|
||||||
|
uint32 repl_epoch;
|
||||||
|
drsuapi_SupportedExtensionsExt supported_extensions_ext;
|
||||||
|
} drsuapi_DsBindInfo32;
|
||||||
|
|
||||||
/* this is used by w2k8 */
|
/* this is used by w2k8 */
|
||||||
typedef [public] struct {
|
typedef [public] struct {
|
||||||
drsuapi_SupportedExtensions supported_extensions;
|
drsuapi_SupportedExtensions supported_extensions;
|
||||||
@ -139,6 +147,17 @@ interface drsuapi
|
|||||||
GUID config_dn_guid;
|
GUID config_dn_guid;
|
||||||
} drsuapi_DsBindInfo48;
|
} drsuapi_DsBindInfo48;
|
||||||
|
|
||||||
|
/* this is used by w2k12 R2 [MS-DRSR] Section 5.39 */
|
||||||
|
typedef [public] struct {
|
||||||
|
drsuapi_SupportedExtensions supported_extensions;
|
||||||
|
GUID site_guid;
|
||||||
|
uint32 pid;
|
||||||
|
uint32 repl_epoch;
|
||||||
|
drsuapi_SupportedExtensionsExt supported_extensions_ext;
|
||||||
|
GUID config_dn_guid;
|
||||||
|
drsuapi_SupportedExtensionsExt supported_capabilities_ext;
|
||||||
|
} drsuapi_DsBindInfo52;
|
||||||
|
|
||||||
typedef [public] struct {
|
typedef [public] struct {
|
||||||
[flag(NDR_REMAINING)] DATA_BLOB info;
|
[flag(NDR_REMAINING)] DATA_BLOB info;
|
||||||
} drsuapi_DsBindInfoFallBack;
|
} drsuapi_DsBindInfoFallBack;
|
||||||
@ -146,7 +165,9 @@ interface drsuapi
|
|||||||
typedef [nopull, nopush, noprint] [nodiscriminant] union {
|
typedef [nopull, nopush, noprint] [nodiscriminant] union {
|
||||||
[case(24)][subcontext(0), subcontext_size(24)] drsuapi_DsBindInfo24 info24;
|
[case(24)][subcontext(0), subcontext_size(24)] drsuapi_DsBindInfo24 info24;
|
||||||
[case(28)][subcontext(0), subcontext_size(28)] drsuapi_DsBindInfo28 info28;
|
[case(28)][subcontext(0), subcontext_size(28)] drsuapi_DsBindInfo28 info28;
|
||||||
|
[case(32)][subcontext(0), subcontext_size(32)] drsuapi_DsBindInfo32 info32;
|
||||||
[case(48)][subcontext(0), subcontext_size(48)] drsuapi_DsBindInfo48 info48;
|
[case(48)][subcontext(0), subcontext_size(48)] drsuapi_DsBindInfo48 info48;
|
||||||
|
[case(52)][subcontext(0), subcontext_size(52)] drsuapi_DsBindInfo52 info52;
|
||||||
/*
|
/*
|
||||||
* The size for the defaut case is a bit arbitrary it in fact the value
|
* The size for the defaut case is a bit arbitrary it in fact the value
|
||||||
* of the switch but we can't reference it.
|
* of the switch but we can't reference it.
|
||||||
|
@ -195,9 +195,19 @@ static NTSTATUS libnet_dssync_bind(TALLOC_CTX *mem_ctx,
|
|||||||
ctx->remote_info28.repl_epoch = 0;
|
ctx->remote_info28.repl_epoch = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 28:
|
case 28: {
|
||||||
ctx->remote_info28 = bind_info.info.info28;
|
ctx->remote_info28 = bind_info.info.info28;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
case 32: {
|
||||||
|
struct drsuapi_DsBindInfo32 *info32;
|
||||||
|
info32 = &bind_info.info.info32;
|
||||||
|
ctx->remote_info28.site_guid = info32->site_guid;
|
||||||
|
ctx->remote_info28.supported_extensions = info32->supported_extensions;
|
||||||
|
ctx->remote_info28.pid = info32->pid;
|
||||||
|
ctx->remote_info28.repl_epoch = info32->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 48: {
|
case 48: {
|
||||||
struct drsuapi_DsBindInfo48 *info48;
|
struct drsuapi_DsBindInfo48 *info48;
|
||||||
info48 = &bind_info.info.info48;
|
info48 = &bind_info.info.info48;
|
||||||
@ -207,6 +217,15 @@ static NTSTATUS libnet_dssync_bind(TALLOC_CTX *mem_ctx,
|
|||||||
ctx->remote_info28.repl_epoch = info48->repl_epoch;
|
ctx->remote_info28.repl_epoch = info48->repl_epoch;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 52: {
|
||||||
|
struct drsuapi_DsBindInfo52 *info52;
|
||||||
|
info52 = &bind_info.info.info52;
|
||||||
|
ctx->remote_info28.site_guid = info52->site_guid;
|
||||||
|
ctx->remote_info28.supported_extensions = info52->supported_extensions;
|
||||||
|
ctx->remote_info28.pid = info52->pid;
|
||||||
|
ctx->remote_info28.repl_epoch = info52->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
DEBUG(1, ("Warning: invalid info length in bind info: %d\n",
|
DEBUG(1, ("Warning: invalid info length in bind info: %d\n",
|
||||||
bind_info.length));
|
bind_info.length));
|
||||||
|
@ -420,8 +420,12 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
|
|||||||
supported_extensions = bind_info.info.info24.supported_extensions;
|
supported_extensions = bind_info.info.info24.supported_extensions;
|
||||||
} else if (bind_info.length == 28) {
|
} else if (bind_info.length == 28) {
|
||||||
supported_extensions = bind_info.info.info28.supported_extensions;
|
supported_extensions = bind_info.info.info28.supported_extensions;
|
||||||
|
} else if (bind_info.length == 32) {
|
||||||
|
supported_extensions = bind_info.info.info32.supported_extensions;
|
||||||
} else if (bind_info.length == 48) {
|
} else if (bind_info.length == 48) {
|
||||||
supported_extensions = bind_info.info.info48.supported_extensions;
|
supported_extensions = bind_info.info.info48.supported_extensions;
|
||||||
|
} else if (bind_info.length == 52) {
|
||||||
|
supported_extensions = bind_info.info.info52.supported_extensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nc_dn) {
|
if (!nc_dn) {
|
||||||
|
@ -186,10 +186,35 @@ static void dreplsrv_out_drsuapi_bind_done(struct tevent_req *subreq)
|
|||||||
info28->repl_epoch = info48->repl_epoch;
|
info28->repl_epoch = info48->repl_epoch;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 28:
|
case 28: {
|
||||||
*info28 = state->bind_r.out.bind_info->info.info28;
|
*info28 = state->bind_r.out.bind_info->info.info28;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 32: {
|
||||||
|
struct drsuapi_DsBindInfo32 *info32;
|
||||||
|
info32 = &state->bind_r.out.bind_info->info.info32;
|
||||||
|
|
||||||
|
info28->supported_extensions = info32->supported_extensions;
|
||||||
|
info28->site_guid = info32->site_guid;
|
||||||
|
info28->pid = info32->pid;
|
||||||
|
info28->repl_epoch = info32->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 52: {
|
||||||
|
struct drsuapi_DsBindInfo52 *info52;
|
||||||
|
info52 = &state->bind_r.out.bind_info->info.info52;
|
||||||
|
|
||||||
|
info28->supported_extensions = info52->supported_extensions;
|
||||||
|
info28->site_guid = info52->site_guid;
|
||||||
|
info28->pid = info52->pid;
|
||||||
|
info28->repl_epoch = info52->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
DEBUG(1, ("Warning: invalid info length in bind info: %d\n",
|
||||||
|
state->bind_r.out.bind_info->length));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tevent_req_done(req);
|
tevent_req_done(req);
|
||||||
|
@ -1712,10 +1712,33 @@ static WERROR becomeDC_drsuapi_bind_recv(struct libnet_BecomeDC_state *s,
|
|||||||
drsuapi->remote_info28.repl_epoch = info48->repl_epoch;
|
drsuapi->remote_info28.repl_epoch = info48->repl_epoch;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 28:
|
case 28: {
|
||||||
drsuapi->remote_info28 = drsuapi->bind_r.out.bind_info->info.info28;
|
drsuapi->remote_info28 = drsuapi->bind_r.out.bind_info->info.info28;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 32: {
|
||||||
|
struct drsuapi_DsBindInfo32 *info32;
|
||||||
|
info32 = &drsuapi->bind_r.out.bind_info->info.info32;
|
||||||
|
drsuapi->remote_info28.supported_extensions = info32->supported_extensions;
|
||||||
|
drsuapi->remote_info28.site_guid = info32->site_guid;
|
||||||
|
drsuapi->remote_info28.pid = info32->pid;
|
||||||
|
drsuapi->remote_info28.repl_epoch = info32->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 52: {
|
||||||
|
struct drsuapi_DsBindInfo52 *info52;
|
||||||
|
info52 = &drsuapi->bind_r.out.bind_info->info.info52;
|
||||||
|
drsuapi->remote_info28.supported_extensions = info52->supported_extensions;
|
||||||
|
drsuapi->remote_info28.site_guid = info52->site_guid;
|
||||||
|
drsuapi->remote_info28.pid = info52->pid;
|
||||||
|
drsuapi->remote_info28.repl_epoch = info52->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
DEBUG(1, ("Warning: invalid info length in bind info: %d\n",
|
||||||
|
drsuapi->bind_r.out.bind_info->length));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return WERR_OK;
|
return WERR_OK;
|
||||||
|
@ -649,10 +649,33 @@ static void unbecomeDC_drsuapi_bind_recv(struct tevent_req *subreq)
|
|||||||
s->drsuapi.remote_info28.repl_epoch = info48->repl_epoch;
|
s->drsuapi.remote_info28.repl_epoch = info48->repl_epoch;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 28:
|
case 28: {
|
||||||
s->drsuapi.remote_info28 = s->drsuapi.bind_r.out.bind_info->info.info28;
|
s->drsuapi.remote_info28 = s->drsuapi.bind_r.out.bind_info->info.info28;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 32: {
|
||||||
|
struct drsuapi_DsBindInfo32 *info32;
|
||||||
|
info32 = &s->drsuapi.bind_r.out.bind_info->info.info32;
|
||||||
|
s->drsuapi.remote_info28.supported_extensions = info32->supported_extensions;
|
||||||
|
s->drsuapi.remote_info28.site_guid = info32->site_guid;
|
||||||
|
s->drsuapi.remote_info28.pid = info32->pid;
|
||||||
|
s->drsuapi.remote_info28.repl_epoch = info32->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 52: {
|
||||||
|
struct drsuapi_DsBindInfo52 *info52;
|
||||||
|
info52 = &s->drsuapi.bind_r.out.bind_info->info.info52;
|
||||||
|
s->drsuapi.remote_info28.supported_extensions = info52->supported_extensions;
|
||||||
|
s->drsuapi.remote_info28.site_guid = info52->site_guid;
|
||||||
|
s->drsuapi.remote_info28.pid = info52->pid;
|
||||||
|
s->drsuapi.remote_info28.repl_epoch = info52->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
DEBUG(1, ("Warning: invalid info length in bind info: %d\n",
|
||||||
|
s->drsuapi.bind_r.out.bind_info->length));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unbecomeDC_drsuapi_remove_ds_server_send(s);
|
unbecomeDC_drsuapi_remove_ds_server_send(s);
|
||||||
|
@ -246,9 +246,28 @@ static bool _test_DsBind(struct torture_context *tctx,
|
|||||||
b->peer_bind_info28.repl_epoch = info48->repl_epoch;
|
b->peer_bind_info28.repl_epoch = info48->repl_epoch;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 28:
|
case 28: {
|
||||||
b->peer_bind_info28 = b->req.out.bind_info->info.info28;
|
b->peer_bind_info28 = b->req.out.bind_info->info.info28;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
case 32: {
|
||||||
|
struct drsuapi_DsBindInfo32 *info32;
|
||||||
|
info32 = &b->req.out.bind_info->info.info32;
|
||||||
|
b->peer_bind_info28.supported_extensions= info32->supported_extensions;
|
||||||
|
b->peer_bind_info28.site_guid = info32->site_guid;
|
||||||
|
b->peer_bind_info28.pid = info32->pid;
|
||||||
|
b->peer_bind_info28.repl_epoch = info32->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 52: {
|
||||||
|
struct drsuapi_DsBindInfo52 *info52;
|
||||||
|
info52 = &b->req.out.bind_info->info.info52;
|
||||||
|
b->peer_bind_info28.supported_extensions= info52->supported_extensions;
|
||||||
|
b->peer_bind_info28.site_guid = info52->site_guid;
|
||||||
|
b->peer_bind_info28.pid = info52->pid;
|
||||||
|
b->peer_bind_info28.repl_epoch = info52->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
printf("DsBind - warning: unknown BindInfo length: %u\n",
|
printf("DsBind - warning: unknown BindInfo length: %u\n",
|
||||||
b->req.out.bind_info->length);
|
b->req.out.bind_info->length);
|
||||||
|
@ -244,9 +244,28 @@ static bool _test_DsaBind(struct torture_context *tctx,
|
|||||||
bi->srv_info48.repl_epoch = info28->repl_epoch;
|
bi->srv_info48.repl_epoch = info28->repl_epoch;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 48:
|
case 48: {
|
||||||
bi->srv_info48 = r.out.bind_info->info.info48;
|
bi->srv_info48 = r.out.bind_info->info.info48;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
case 32: {
|
||||||
|
struct drsuapi_DsBindInfo32 *info32;
|
||||||
|
info32 = &r.out.bind_info->info.info32;
|
||||||
|
bi->srv_info48.supported_extensions = info32->supported_extensions;
|
||||||
|
bi->srv_info48.site_guid = info32->site_guid;
|
||||||
|
bi->srv_info48.pid = info32->pid;
|
||||||
|
bi->srv_info48.repl_epoch = info32->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 52: {
|
||||||
|
struct drsuapi_DsBindInfo52 *info52;
|
||||||
|
info52 = &r.out.bind_info->info.info52;
|
||||||
|
bi->srv_info48.supported_extensions = info52->supported_extensions;
|
||||||
|
bi->srv_info48.site_guid = info52->site_guid;
|
||||||
|
bi->srv_info48.pid = info52->pid;
|
||||||
|
bi->srv_info48.repl_epoch = info52->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
torture_result(tctx, TORTURE_FAIL,
|
torture_result(tctx, TORTURE_FAIL,
|
||||||
"DsBind: unknown BindInfo length: %u",
|
"DsBind: unknown BindInfo length: %u",
|
||||||
|
@ -204,9 +204,28 @@ static bool _test_DsBind(struct torture_context *tctx,
|
|||||||
b->peer_bind_info28.repl_epoch = info48->repl_epoch;
|
b->peer_bind_info28.repl_epoch = info48->repl_epoch;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 28:
|
case 28: {
|
||||||
b->peer_bind_info28 = b->req.out.bind_info->info.info28;
|
b->peer_bind_info28 = b->req.out.bind_info->info.info28;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
case 32: {
|
||||||
|
struct drsuapi_DsBindInfo32 *info32;
|
||||||
|
info32 = &b->req.out.bind_info->info.info32;
|
||||||
|
b->peer_bind_info28.supported_extensions= info32->supported_extensions;
|
||||||
|
b->peer_bind_info28.site_guid = info32->site_guid;
|
||||||
|
b->peer_bind_info28.pid = info32->pid;
|
||||||
|
b->peer_bind_info28.repl_epoch = info32->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 52: {
|
||||||
|
struct drsuapi_DsBindInfo52 *info52;
|
||||||
|
info52 = &b->req.out.bind_info->info.info52;
|
||||||
|
b->peer_bind_info28.supported_extensions= info52->supported_extensions;
|
||||||
|
b->peer_bind_info28.site_guid = info52->site_guid;
|
||||||
|
b->peer_bind_info28.pid = info52->pid;
|
||||||
|
b->peer_bind_info28.repl_epoch = info52->repl_epoch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
printf("DsBind - warning: unknown BindInfo length: %u\n",
|
printf("DsBind - warning: unknown BindInfo length: %u\n",
|
||||||
b->req.out.bind_info->length);
|
b->req.out.bind_info->length);
|
||||||
|
Loading…
Reference in New Issue
Block a user