diff options
author | Matthieu Patou <mat@matws.net> | 2013-10-20 13:37:17 -0700 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-10-30 10:16:02 +0100 |
commit | 8dc931bafca00c1c61a4366ffb6cfa72a98bb412 (patch) | |
tree | 6c67fdbf279f1aeca244805700f75428c059967b /librpc/idl | |
parent | 5990de5d89f900b9f754357e9ca7afbc142e0e00 (diff) | |
download | samba-8dc931bafca00c1c61a4366ffb6cfa72a98bb412.tar.gz samba-8dc931bafca00c1c61a4366ffb6cfa72a98bb412.tar.xz samba-8dc931bafca00c1c61a4366ffb6cfa72a98bb412.zip |
librpc-idl: change the drsuapi_DsBindInfoCtr so that it match what is on the wire both in NDR32 and NDR64.
Previous implementation had a problem with NDR64 with uint32 and
uint3264 being in the wrong order
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Oct 30 10:16:02 CET 2013 on sn-devel-104
Diffstat (limited to 'librpc/idl')
-rw-r--r-- | librpc/idl/drsuapi.idl | 57 |
1 files changed, 48 insertions, 9 deletions
diff --git a/librpc/idl/drsuapi.idl b/librpc/idl/drsuapi.idl index 7e3d34317ec..f1c6cd6e911 100644 --- a/librpc/idl/drsuapi.idl +++ b/librpc/idl/drsuapi.idl @@ -115,14 +115,14 @@ interface drsuapi } drsuapi_SupportedExtensionsExt; /* this is used by w2k */ - typedef struct { + typedef [public] struct { drsuapi_SupportedExtensions supported_extensions; GUID site_guid; uint32 pid; } drsuapi_DsBindInfo24; /* this is used by w2k3 */ - typedef struct { + typedef [public] struct { drsuapi_SupportedExtensions supported_extensions; GUID site_guid; uint32 pid; @@ -130,7 +130,7 @@ interface drsuapi } drsuapi_DsBindInfo28; /* this is used by w2k8 */ - typedef struct { + typedef [public] struct { drsuapi_SupportedExtensions supported_extensions; GUID site_guid; uint32 pid; @@ -139,15 +139,21 @@ interface drsuapi GUID config_dn_guid; } drsuapi_DsBindInfo48; - typedef struct { + typedef [public] struct { [flag(NDR_REMAINING)] DATA_BLOB info; } drsuapi_DsBindInfoFallBack; - typedef [nodiscriminant] union { - [case(24)][subcontext(4)] drsuapi_DsBindInfo24 info24; - [case(28)][subcontext(4)] drsuapi_DsBindInfo28 info28; - [case(48)][subcontext(4)] drsuapi_DsBindInfo48 info48; - [default][subcontext(4)] drsuapi_DsBindInfoFallBack FallBack; + typedef [nopull, nopush, noprint] [nodiscriminant] union { + [case(24)][subcontext(0), subcontext_size(24)] drsuapi_DsBindInfo24 info24; + [case(28)][subcontext(0), subcontext_size(28)] drsuapi_DsBindInfo28 info28; + [case(48)][subcontext(0), subcontext_size(48)] drsuapi_DsBindInfo48 info48; + /* + * The size for the defaut case is a bit arbitrary it in fact the value + * of the switch but we can't reference it. + * As we hand(un-)marshall this structure it has 0 impact and makes + * pidl happy for wireshark too + */ + [default][subcontext(0), subcontext_size(48)] drsuapi_DsBindInfoFallBack Fallback; } drsuapi_DsBindInfo; /* the drsuapi_DsBindInfoCtr was this before @@ -160,11 +166,44 @@ interface drsuapi * so we're doing it here */ + /* + * MS-DRSR.pdf gives the following definition + typedef struct { + [range(1,10000)] DWORD cb; + [size_is(cb)] BYTE rgb[]; + } DRS_EXTENSIONS; + + But we use a subcontext which has a slighly different signification on how + data are laid out. + With the MS-DRSR definition we will have + size_is_cb cv rgb_array + with size_is_cb being a uint3264 and cv being a uint32 + + We used to have typedef struct { [range(1,10000)] uint32 length; [switch_is(length)] drsuapi_DsBindInfo info; } drsuapi_DsBindInfoCtr; + typedef [nodiscriminant] union { + [case(24)][subcontext(4)] drsuapi_DsBindInfo24 info24; + [case(28)][subcontext(4)] drsuapi_DsBindInfo28 info28; + [case(48)][subcontext(4)] drsuapi_DsBindInfo48 info48; + [default][subcontext(4)] drsuapi_DsBindInfoFallBack FallBack; + } drsuapi_DsBindInfo; + + With this definition data is laid out this way: + length subcontext_size drsuapi_DsBindInfoxx + with length being a uint32 and subcontext_size being a uint3264 + + It has clearly an impact on the way things are aligned when using NDR64 + */ + typedef [flag(NDR_NOALIGN)] struct { + [range(1,10000)] uint3264 length; + [value(length)] uint32 __ndr_length; + [switch_is(length)] drsuapi_DsBindInfo info; + } drsuapi_DsBindInfoCtr; + /* this is a magic guid you need to pass to DsBind to make drsuapi_DsWriteAccountSpn() work * * maybe the bind_guid could also be the invocation_id see drsuapi_DsReplicaConnection04 |