summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-06-10 13:42:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:55 -0500
commit46b829513a47dbb74fb0ea07ed85494da1480919 (patch)
tree23880ce2c9466b3e9abb72ab0435cf428b3bf02a /source4/librpc/ndr
parent6ef2a41aa1e6cfeb88ee621c63327593b51315ae (diff)
downloadsamba-46b829513a47dbb74fb0ea07ed85494da1480919.tar.gz
samba-46b829513a47dbb74fb0ea07ed85494da1480919.tar.bz2
samba-46b829513a47dbb74fb0ea07ed85494da1480919.zip
r7462: fix Enum* pushing, we need to send back a buffer of the same size as we got
in the recv code..., this makes the w2k3 printserver properties gui happy:-) metze (This used to be commit 0130b0d90223bb7278f924e1b1370778f25d0d91)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/ndr_spoolss_buf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_spoolss_buf.c b/source4/librpc/ndr/ndr_spoolss_buf.c
index 00958c2cb8..6ecaa49fcf 100644
--- a/source4/librpc/ndr/ndr_spoolss_buf.c
+++ b/source4/librpc/ndr/ndr_spoolss_buf.c
@@ -51,6 +51,10 @@
__r.in.count = r->out.count;\
__r.out.info = r->out.info;\
NDR_CHECK(ndr_push___##fn(_ndr_info, flags, &__r)); \
+ if (*r->in.buf_size > _ndr_info->offset) {\
+ uint32_t _padding_len = *r->in.buf_size - _ndr_info->offset;\
+ NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len));\
+ }\
_data_blob_info = ndr_push_blob(_ndr_info);\
_r.out.buffer = &_data_blob_info;\
}\
@@ -94,6 +98,11 @@
_ndr_info = ndr_pull_init_blob(_r.out.buffer, ndr);\
if (!_ndr_info) return NT_STATUS_NO_MEMORY;\
_ndr_info->flags= ndr->flags;\
+ if (*r->out.buf_size != _ndr_info->data_size) {\
+ return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\
+ "SPOOLSS Buffer: buf_size[%u] doesn't match length of buffer[%u]",\
+ *r->out.buf_size, _ndr_info->data_size);\
+ }\
__r.in.level = r->in.level;\
__r.in.count = r->out.count;\
__r.out.info = NULL;\