librpc/ndr: add new LIBNDR_FLAG_STR_RAW8 for ndr_pull_string
authorSean Finney <seanius@seanius.net>
Tue, 31 May 2011 07:49:19 +0000 (09:49 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 31 May 2011 22:30:40 +0000 (00:30 +0200)
commit08abd1f5e851c4f40a863f5c3ff6acc93d691efb
tree04bef33f02528f120dd726aaf3f959fb453501de
parentc51795c747198f9e002505ffa39ad710beff0358
librpc/ndr: add new LIBNDR_FLAG_STR_RAW8 for ndr_pull_string

Introduce a new flag, LIBNDR_FLAG_STR_RAW8, which indicates that libndr
should not attempt to convert the corresponding byte sequence, and place
the responsibility on the caller to do so later.

This is needed in cases where the string is known to be 8-bit and either
NULL terminated or of known length, but in an unspecified character set.
For example, when pulling PT_STRING8 properties from an exchange server
via libmapi + libndr, the codepage is neither known nor in the control
of the caller, and is determined by subsequent properties requested from
the server.  Therefore the client would like to fetch all properties in
one large batch, and convert the resulting strings locally.

This commit also includes some (basic) tests of each of the flags'
respective behaviors with the ndr push/pull string functions, in a new
source4 torture test suite ndr.ndr_string.

Signed-off-by: Sean Finney <seanius@seanius.net>
librpc/idl/idl_types.h
librpc/ndr/libndr.h
librpc/ndr/ndr_string.c
source4/torture/ndr/ndr.c
source4/torture/ndr/string.c [new file with mode: 0644]
source4/torture/wscript_build