diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-29 03:17:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:20 -0500 |
commit | 2c0a1f53910a6be9515e4f456426a73a9aa72308 (patch) | |
tree | e9b8e02e8e2e9b405417765d453da66f35686805 /source4 | |
parent | 087fb574b25c814a0e491c121b77305006f8d865 (diff) | |
download | samba-2c0a1f53910a6be9515e4f456426a73a9aa72308.tar.gz samba-2c0a1f53910a6be9515e4f456426a73a9aa72308.tar.bz2 samba-2c0a1f53910a6be9515e4f456426a73a9aa72308.zip |
r5084: - handle arbitrary data in the NULL record reply type for nbt name queries
- fixed unaligned pulls at the end of the packet in the ndr lib
(This used to be commit 61c43509f7a538541d87bd505ca241e08a50f605)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/librpc/idl/nbt.idl | 6 | ||||
-rw-r--r-- | source4/librpc/ndr/libndr.h | 2 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr.c | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/source4/librpc/idl/nbt.idl b/source4/librpc/idl/nbt.idl index e12ec6290a..429a35267c 100644 --- a/source4/librpc/idl/nbt.idl +++ b/source4/librpc/idl/nbt.idl @@ -142,13 +142,13 @@ interface nbt } nbt_rdata_status; typedef struct { - nbt_operation operation; - } nbt_rdata_wack; + [flag(NDR_REMAINING)] DATA_BLOB data; + } nbt_rdata_data; typedef [nodiscriminant] union { [case(NBT_QTYPE_NETBIOS)] nbt_rdata_netbios netbios; [case(NBT_QTYPE_STATUS)] nbt_rdata_status status; - [case(NBT_QTYPE_NULL)] nbt_rdata_wack wack; + [default] nbt_rdata_data data; } nbt_rdata; typedef [flag(LIBNDR_PRINT_ARRAY_HEX)] struct { diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 7070ae80ec..5485c232b4 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -185,7 +185,7 @@ enum ndr_err_code { } \ ndr->offset = (ndr->offset + (n-1)) & ~(n-1); \ } \ - if (ndr->offset >= ndr->data_size) { \ + if (ndr->offset > ndr->data_size) { \ return ndr_pull_error(ndr, NDR_ERR_BUFSIZE, "Pull align %u", n); \ } \ } while(0) diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index 6947cc8ee6..032c743bef 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -436,6 +436,8 @@ static NTSTATUS ndr_pull_subcontext_header(struct ndr_pull *ndr, size_t sub_size, struct ndr_pull *ndr2) { + ndr2->flags = ndr->flags; + switch (sub_size) { case 0: { uint32_t size = ndr->data_size - ndr->offset; |