summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-03-17 20:28:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:05 -0500
commitef213b02482194a8fed7f37123e08624072694b2 (patch)
tree12e82a6e21263f07cf87432701dc7af776daef6f /source4/librpc/ndr
parent85943483fbcbe5e8a4cfb93eb65ac50f73eff28c (diff)
downloadsamba-ef213b02482194a8fed7f37123e08624072694b2.tar.gz
samba-ef213b02482194a8fed7f37123e08624072694b2.tar.bz2
samba-ef213b02482194a8fed7f37123e08624072694b2.zip
r5866: Add InitShutdown IDL and torture test.
Implement push side of NDR_LEN4|NDR_NOTERM strings (pull side was already present) (This used to be commit ea61ec1122841716ed5d90085ba79e7bf691bd6a)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/ndr_basic.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 3e192d03a2..8284375be5 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -918,6 +918,20 @@ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s)
ndr->offset += byte_mul*(c_len+1);
break;
+ case LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_NOTERM:
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, c_len));
+ NDR_PUSH_NEED_BYTES(ndr, byte_mul*c_len);
+ ret = convert_string(CH_UNIX, chset,
+ s, s_len,
+ ndr->data+ndr->offset, byte_mul*c_len);
+ if (ret == -1) {
+ return ndr_push_error(ndr, NDR_ERR_CHARCNV,
+ "Bad character conversion");
+ }
+ ndr->offset += byte_mul*c_len;
+ break;
+
case LIBNDR_FLAG_STR_SIZE4:
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, c_len + c_len_term));
NDR_PUSH_NEED_BYTES(ndr, byte_mul*(c_len+1));