summaryrefslogtreecommitdiffstats
path: root/source3/librpc
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-09-21 18:37:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:00:58 -0500
commit3a60a6743262ab2ab221e0fe13ef6b510424ca3f (patch)
tree7029367395949ad4ce03813c2a7361e934a1cf4d /source3/librpc
parentc8ef27a3c3db3f04d592652fd6103c5b5cf83d03 (diff)
downloadsamba-3a60a6743262ab2ab221e0fe13ef6b510424ca3f.tar.gz
samba-3a60a6743262ab2ab221e0fe13ef6b510424ca3f.tar.xz
samba-3a60a6743262ab2ab221e0fe13ef6b510424ca3f.zip
r18793: Fix BE string handling in the auto-generated
code. Should now work again with ASU. Jeremy. (This used to be commit 53e97bf92817b6cfc3f93c999a81ef8ad49a1609)
Diffstat (limited to 'source3/librpc')
-rw-r--r--source3/librpc/ndr/ndr_string.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source3/librpc/ndr/ndr_string.c b/source3/librpc/ndr/ndr_string.c
index 8f2ec10a59d..2aa86de0bbb 100644
--- a/source3/librpc/ndr/ndr_string.c
+++ b/source3/librpc/ndr/ndr_string.c
@@ -31,7 +31,7 @@ NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s)
uint32_t len1, ofs, len2;
uint16_t len3;
int ret;
- charset_t chset = CH_UCS2;
+ charset_t chset = CH_UTF16LE;
unsigned byte_mul = 2;
unsigned flags = ndr->flags;
unsigned c_len_term = 0;
@@ -40,7 +40,9 @@ NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s)
return NT_STATUS_OK;
}
- SMB_ASSERT(!NDR_BE(ndr));
+ if (NDR_BE(ndr)) {
+ chset = CH_UTF16BE;
+ }
if (flags & LIBNDR_FLAG_STR_ASCII) {
chset = CH_DOS;
@@ -282,7 +284,7 @@ NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s)
NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s)
{
ssize_t s_len, c_len, d_len;
- charset_t chset = CH_UCS2;
+ charset_t chset = CH_UTF16LE;
unsigned flags = ndr->flags;
unsigned byte_mul = 2;
uint8_t *dest = NULL;
@@ -291,7 +293,9 @@ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s)
return NT_STATUS_OK;
}
- SMB_ASSERT(!NDR_BE(ndr));
+ if (NDR_BE(ndr)) {
+ chset = CH_UTF16BE;
+ }
s_len = s?strlen(s):0;
@@ -557,7 +561,9 @@ NTSTATUS ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, const char **var,
return NT_STATUS_OK;
}
- SMB_ASSERT (!NDR_BE(ndr) || chset != CH_UCS2);
+ if (NDR_BE(ndr) && chset == CH_UTF16) {
+ chset = CH_UTF16BE;
+ }
NDR_PULL_NEED_BYTES(ndr, length*byte_mul);
@@ -580,7 +586,9 @@ NTSTATUS ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var,
{
ssize_t ret, required;
- SMB_ASSERT(!NDR_BE(ndr) || chset != CH_UCS2);
+ if (NDR_BE(ndr) && chset == CH_UTF16) {
+ chset = CH_UTF16BE;
+ }
required = byte_mul * length;