1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

58 Commits

Author SHA1 Message Date
David Disseldorp
ee292bf5f3 ndr: add ndr_pull_charset_to_null()
The same as ndr_pull_charset(), however only perform character
conversion on bytes prior to and including the null terminator.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-01-13 09:37:37 -08:00
Volker Lendecke
27d95cc8a6 librpc: Add support for struct timeval 2011-12-02 22:43:05 +01:00
Volker Lendecke
de1cd125ad librpc: Add support for struct timespec 2011-12-02 22:43:05 +01:00
Andrew Bartlett
d40fe50a67 build: avoid util.h as a public header name due to conflict with MacOS 2011-09-23 09:24:03 +02:00
Andrew Tridgell
1c25f5ebca libndr: moved the NDR_* flags to have less overlap
We have 3 different types of flags values in our NDR layer. We've
recently found bugs where these types of flags have been mixed up,
especially by people adding hand written ndr code for tricky
structures. We previously got away with this because (for example)
NDR_SCALARS and NDR_IN had the same value, so mixing up the two
concepts sometimes worked. Unfortunately it also led to bugs where we
didn't do what was expected, such as in our smbtorture ndr test suite,
where passing a ndr_flags value of zero led to only checking that two
empty structures were equal.

This changes the values of the NDR_IN|NDR_OUT and
NDR_SCALARS|NDR_BUFFERS values to be in different bit ranges, and adds
macros for checking the validity of passed in flags. A followup patch
modifies the ndr calls to use these macros, and pidl to generate
them. This should catch misuse of the APIs.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-08 03:35:27 +02:00
Andrew Bartlett
c1f8a74320 librpc/ndr remove _SAMBA_BUILD_ conditionals 2011-07-06 12:23:40 +10:00
Sean Finney
08abd1f5e8 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>
2011-06-01 00:30:40 +02:00
Andrew Bartlett
41b3c38587 librpc/ndr Merge ndr_print_sockaddr_storage() into common code
There is no longer a reason to leave this source3 specific, and this
brings it into a library (avoiding duplicate symbols).

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Stefan Metzmacher
2a47ed8106 librpc/ndr: add ndr_push_pipe_chunk_trailer() and ndr_check_pipe_chunk_trailer()
metze
2011-03-10 14:31:15 +01:00
Stefan Metzmacher
eceea8641e librpc/ndr: add ndr_interface_call_pipe
metze
2011-03-10 14:31:14 +01:00
Andrew Bartlett
646aefd998 pidl Add support for uid_t and gid_t types
These are mapped to uint64_t, which should be big enough.  This is
proposed to be used for internal Samba representations, where it would
be more painful to convert all the callers to an uint64_t calling
convention.

Andrew Bartlett
2011-03-01 06:29:03 +01:00
Günther Deschner
0aed229710 libndr: remove prototype for nonexisting function ndr_print_ipv4_addr().
Guenther
2011-02-17 00:54:16 +01:00
Günther Deschner
947ba448a4 libndr: apply some const and make is_valid_policy_hnd a callback to policy_handle_empty.
Guenther
2011-02-08 14:05:36 +01:00
Günther Deschner
be5edba117 libndr: share some uuid helpers.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Feb  8 09:52:56 CET 2011 on sn-devel-104
2011-02-08 09:52:56 +01:00
Günther Deschner
84dbc2a82d ndr: merge ndr_map_error2string and ndr_errstr.
Guenther
2011-02-08 08:58:31 +01:00
Günther Deschner
8b55ae1785 ndr: move null_ndr_syntax_id to the common libndr location.
Guenther
2011-02-08 08:58:21 +01:00
Günther Deschner
7eac3100ea libndr: move ndr_print_bool to ndr_basic.c
Guenther
2011-01-25 11:42:46 +01:00
Andrew Bartlett
d9b7123cb7 librpc Make ndrdump use printf() rather than having to mess with DEBUG()
This means it no longer needs to force the debug level etc.

(this builds on the fine work by Volker to create dump_data_cb())

Andrew Bartlett
2010-10-27 04:42:06 +00:00
Kai Blin
719a6bbfed ndr dns: Add simple parser 2010-10-23 10:17:05 +00:00
Günther Deschner
b75674c2eb Revert "libndr: fix "excess elements in struct initializer" warning."
This reverts commit a416ff26d6.
2010-10-05 22:55:30 +02:00
Günther Deschner
a416ff26d6 libndr: fix "excess elements in struct initializer" warning.
Guenther
2010-10-05 13:09:05 +00:00
Kai Blin
ee7ee2c4c2 ndr: Implement push function for IPv6 addresses
Thanks to Julien Kerihuel for providing the patch that pushed me to
finish my own IPv6 patches.
2010-10-04 20:59:59 +02:00
Kai Blin
013780b1e1 ndr: Add support for pulling/printing an ipv6address type 2010-10-04 20:59:59 +02:00
Stefan Metzmacher
bffa192bfe librpc/ndr: remove 'async' from ndr_interface_call
metze
2010-09-28 23:06:47 +02:00
Andrew Tridgell
83a24ff2ef pidl: prevent ndr_print_*() dying on NULL pointers
when using ndrdump you can get uninitialised structures containing
pointers. Don't segfault when trying to print them
2010-09-16 21:09:17 +10:00
Andrew Tridgell
3828c76c76 ndr: allow ndr_print to print DATA_BLOB
this prints DATA_BLOB structures using the ndr->print() calls

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-08-14 11:58:13 +10:00
Günther Deschner
7bcd9c5583 libndr: add support for relative_rap_convert.
Will not harm anyone, is only used for rare short (2byte) relative pointers, and
relative_rap_convert is always 0 so far (as all init functions using struct
ndr_pull will zero the struct).

Guenther
2010-05-27 23:25:15 +02:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Stefan Metzmacher
31c7780c16 libndr: implement LIBNDR_RELATIVE_REVERSE handling
This is based on Guenther's initial code.

metze
2010-02-18 13:44:03 +01:00
Günther Deschner
05347754ee libndr: store a subcontext buffer size in ndr_push_subcontext_start.
Guenther
2010-02-18 13:44:03 +01:00
Günther Deschner
a2c34296fa libndr: add LIBNDR_FLAG_NO_RELATIVE_REVERSE so that relative reverse processing
can be disabled for single structure elements.

Guenther
2010-02-18 13:44:02 +01:00
Günther Deschner
ee13a51b05 libndr: add LIBNDR_FLAG_RELATIVE_REVERSE flag.
Guenther
2010-02-18 13:44:02 +01:00
Stefan Metzmacher
98e143cd31 librpc/ndr: make ndr_push_relative_ptr2() static
metze
2010-02-18 13:44:01 +01:00
Günther Deschner
bc20d3446a libndr: add ndr_push_relative_ptr2_start and ndr_push_relative_ptr2_end.
Guenther
2010-02-18 13:43:59 +01:00
Brian Lu
a3b7e84a65 librpc/ndr: avoid comparison_fn_t to fix the openchange build on solaris
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-12-14 11:08:45 +01:00
Stefan Metzmacher
05effef1aa librpc/ndr: add missing prototypes for relative_short functions
metze
2009-12-14 10:58:31 +01:00
Andrew Tridgell
3ce800dcbe libndr: added a GUID_to_ndr_blob() helper function
This can be used in many places that deal with GUIDs
2009-12-10 17:51:28 +11:00
Andrew Tridgell
effff54426 librpc: split out a separate GUID_from_ndr_blob() function
This will simplify many of the places that deal with NDR formatted
GUIDs
2009-12-10 17:51:26 +11:00
Stefan Metzmacher
4b6c03a108 librpc/ndr: remember the highest offset we parsed with relative pointer buffers
ndr_*_pull_blob_all() will now work if relative pointers are used.

metze
2009-11-20 13:48:35 +01:00
Andrew Tridgell
2bf8a7485c pidl: get the alignment right for uint1632 enums (NDR64)
The default enum in NDR63 is 32 bits, not 16 bits. We need a uint1632
type to get the alignment right.
2009-10-07 09:56:22 +11:00
Günther Deschner
76feeb1b97 libndr: add int3264 ndr prototype.
Guenther
2009-10-05 15:10:35 +02:00
Andrew Tridgell
9eb78be4a6 ndr64: added support for trailing gap alignment
NDR64 has a 'trailing gap' alignment, which aligns the end of a
structure on the overall structure alignment.

This explains the discrepancy we had with the RPC-SAMR test and NDR64
2009-10-02 12:05:59 +10:00
Andrew Tridgell
64e08fef16 pidl: added union padding for NDR64
This fixes the problem with samr UserInfo16 when NDR64 is enabled
2009-09-29 18:08:22 +10:00
Andrew Tridgell
1a1cb92583 ndr: split out ndr enum functions
This allows for easier implementation of the NDR32/NDR64 split
2009-09-17 15:19:30 -07:00
Andrew Tridgell
056cbf7f81 ndr: added support for NDR64
This adds NDR64 support for the push functions in libndr
2009-09-17 15:19:27 -07:00
Andrew Tridgell
9407ab573e ndr: added --ndr64 flag to ndrdump
This only does pull, but it is useful for w2k8-r2 <-> w2k8-r2 ndrdump
usage, which is always 64bit.
2009-09-16 23:59:53 -07:00
Andrew Tridgell
5c33042498 s4-ndr: fixed memory leaks in ndr_pull_*_blob()
We needed to free the ndr structures, both on error and normal return
2009-09-12 15:21:33 +10:00
Günther Deschner
b1ee4c14d4 libndr: add missing protoypes for double type.
Guenther
2009-08-24 14:31:22 +02:00
Andrew Tridgell
011f103501 when we get an NDR error in the logs, it is useful to know where it happened 2009-08-12 15:33:37 +10:00
Günther Deschner
35f1e02ca4 librpc: add ndr_size_string_array().
Guenther
2009-02-03 15:42:29 +01:00