diff options
author | David Disseldorp <ddiss@samba.org> | 2012-07-06 14:00:27 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2012-07-06 19:03:19 +0200 |
commit | 0d3249b927465fdca1765cbd7e17c947364b5ef0 (patch) | |
tree | c80963c820f9c196c7b627d8e2b742500ee8451a /buildtools/wafadmin | |
parent | 66514f8bbe5f9e2dcd8be90450ef339305a3161c (diff) | |
download | samba-0d3249b927465fdca1765cbd7e17c947364b5ef0.tar.gz samba-0d3249b927465fdca1765cbd7e17c947364b5ef0.tar.bz2 samba-0d3249b927465fdca1765cbd7e17c947364b5ef0.zip |
ndr: fix push/pull DATA_BLOB with NDR_NOALIGN
This change addresses bug 9026.
There are 3 use cases for DATA_BLOB marshalling/unmarshalling:
1)
ndr_push_DATA_BLOB and ndr_pull_DATA_BLOB when called with
LIBNDR_FLAG_ALIGN* alignment flags set, are used to push/pull padding
bytes _only_. The length is determined by the alignment required and
the current ndr offset.
e.g. dcerpc.idl:
typedef struct {
...
[flag(NDR_ALIGN8)] DATA_BLOB _pad;
} dcerpc_request;
2)
When called with the LIBNDR_FLAG_REMAINING flag, all remaining bytes in
the ndr buffer are pushed/pulled.
e.g. dcerpc.idl:
typedef struct {
...
[flag(NDR_REMAINING)] DATA_BLOB stub_and_verifier;
} dcerpc_request;
3)
When called without alignment flags, push/pull a uint32 length _and_ a
corresponding byte array to/from the ndr buffer.
e.g. drsblobs.idl
typedef [public] struct {
...
DATA_BLOB data;
} DsCompressedChunk;
The fix for bug 8373 changed the definition of "alignment flags", such
that when called with LIBNDR_FLAG_NOALIGN ndr_push/pull_DATA_BLOB
behaves as (1: padding bytes) rather than (3: uint32 length + byte
array).
This breaks marshalling/unmarshalling for the following structures.
eventlog.idl:
typedef [flag(NDR_NOALIGN|NDR_PAHEX),public] struct {
...
DATA_BLOB sid;
...
} eventlog_Record_tdb;
ntprinting.idl:
typedef [flag(NDR_NOALIGN),public] struct {
...
DATA_BLOB *nt_dev_private;
} ntprinting_devicemode;
typedef [flag(NDR_NOALIGN),public] struct {
...
DATA_BLOB data;
} ntprinting_printer_data;
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'buildtools/wafadmin')
0 files changed, 0 insertions, 0 deletions