[PATCH] s4:librpc/ndr: add new LIBNDR_FLAG_STR_RAW8 for ndr_pull_string

Andrew Bartlett abartlet at samba.org
Mon May 23 15:03:30 MDT 2011


On Mon, 2011-05-23 at 14:05 +0200, Sean Finney wrote:
> Introduce a new flag, LIBNDR_FLAG_STR_RAW8, which when combined with
> LIBNDR_FLAG_STR_NULLTERM will indicate that libndr should not attempt
> to convert the corresponding string, 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 NULL
> terminated, 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.
> 
> Signed-off-by: Sean Finney <seanius at seanius.net>
> ---
>  librpc/idl/idl_types.h  |    6 ++++++
>  librpc/ndr/libndr.h     |    1 +
>  librpc/ndr/ndr_string.c |   27 +++++++++++++++++++++++----
>  3 files changed, 30 insertions(+), 4 deletions(-)

This would seem to be exactly what we need.  

However, as you have changed the potential size that ndr_string objects
can be, you also need to update ndr_size_string_array().
(ndr_size_string() appears incorrect, unused, and can be removed rather
than fixed).

Andrew Bartltet

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list