summaryrefslogtreecommitdiffstats
path: root/librpc/ndr
Commit message (Collapse)AuthorAgeFilesLines
* ntprinting: mark the final 4 byte null pointer for printer data in ↵Günther Deschner2012-07-061-0/+1
| | | | | | ndr_pull_ntprinting_printer as read. Guenther
* ndr: fix push/pull DATA_BLOB with NDR_NOALIGNDavid Disseldorp2012-07-061-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change addresses bug 9026. There are 3 use cases for DATA_BLOB marshalling/unmarshalling: 1) ndr_push_DATA_BLOB and ndr_pull_DATA_BLOB when called with LIBNDR_FLAG_ALIGN* alignment flags set, are used to push/pull padding bytes _only_. The length is determined by the alignment required and the current ndr offset. e.g. dcerpc.idl: typedef struct { ... [flag(NDR_ALIGN8)] DATA_BLOB _pad; } dcerpc_request; 2) When called with the LIBNDR_FLAG_REMAINING flag, all remaining bytes in the ndr buffer are pushed/pulled. e.g. dcerpc.idl: typedef struct { ... [flag(NDR_REMAINING)] DATA_BLOB stub_and_verifier; } dcerpc_request; 3) When called without alignment flags, push/pull a uint32 length _and_ a corresponding byte array to/from the ndr buffer. e.g. drsblobs.idl typedef [public] struct { ... DATA_BLOB data; } DsCompressedChunk; The fix for bug 8373 changed the definition of "alignment flags", such that when called with LIBNDR_FLAG_NOALIGN ndr_push/pull_DATA_BLOB behaves as (1: padding bytes) rather than (3: uint32 length + byte array). This breaks marshalling/unmarshalling for the following structures. eventlog.idl: typedef [flag(NDR_NOALIGN|NDR_PAHEX),public] struct { ... DATA_BLOB sid; ... } eventlog_Record_tdb; ntprinting.idl: typedef [flag(NDR_NOALIGN),public] struct { ... DATA_BLOB *nt_dev_private; } ntprinting_devicemode; typedef [flag(NDR_NOALIGN),public] struct { ... DATA_BLOB data; } ntprinting_printer_data; Signed-off-by: Günther Deschner <gd@samba.org>
* librpc/ndr: Initilaise the remainder of struct dom_sid after a pullAndrew Bartlett2012-06-281-0/+1
| | | | | | | | This copes with the fact that r->sub_auths is a fixed-size array, not an allocated pointer, and so will still have some bytes no filled in if the sid did not have a MAX_SUB_AUTHS sub-authorities. Andrew Bartlett
* Revert "s3: Fix bug 8371"Stefan Metzmacher2012-06-031-2/+0
| | | | | | | | | | This reverts commit 2642f385887fbd3aecd4286a4d6223a21d981714. This is not needed anymore, as 035342c11719d1daa647c0b2ae7cec27a969f83a "Fix bug #8373 - Can't join XP Pro workstations to 3.6.1 DC." is the more generic fix for the problem. metze
* librpc: Fix an incompatible pointer type warningVolker Lendecke2012-05-301-2/+4
| | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com>
* librpc: Fix some typosVolker Lendecke2012-05-301-3/+3
| | | | Signed-off-by: Kai Blin <kai@samba.org>
* Fix bug #8373 - Can't join XP Pro workstations to 3.6.1 DC.Jeremy Allison2012-05-252-5/+11
| | | | | | | Treat LIBNDR_FLAG_NOALIGN and LIBNDR_FLAG_REMAINING the same as the other align flags - make them mutually exclusive. Combined work from Metze, Günther and Jeremy.
* Move NS_GUID_string and NS_GUID_from_string to dsdb-common.Jelmer Vernooij2012-03-202-54/+0
|
* libndr: Define trivial is_valid_policy_hnd as macro.Jelmer Vernooij2012-03-202-6/+1
| | | This makes the NDR namespace a bit clearer, in preparation of ABI checking.
* libndr: Rename policy_handle_empty to ndr_policy_handle_empty.Jelmer Vernooij2012-03-202-3/+3
| | | This makes the NDR namespace a bit clearer, in preparation of ABI checking.
* libndr: Rename policy_handle_equal to ndr_policy_handle_equal.Jelmer Vernooij2012-03-202-2/+2
| | | This makes the NDR namespace a bit clearer, in preparation of ABI checking.
* libndr: Rename ndr64_transfer_syntax and null_ndr_syntax_id so they have a ↵Jelmer Vernooij2012-03-202-10/+11
| | | | | ndr_ prefix. This makes the NDR namespace a bit clearer, in preparation of ABI checking.
* ndr: dnsserver: Add pull and push functions for DNS_RPC_RECORD_STRINGAmitay Isaacs2012-03-021-0/+37
|
* ndr: Add NDR pull, push, print functions for dnsp_string_listAmitay Isaacs2012-03-021-0/+53
|
* ndr: Fix NDR push function for dnsp_stringAmitay Isaacs2012-03-021-3/+2
| | | | Push the actual length of the string not including null-termination.
* ndr: Fix the error messages, add correct data type nameAmitay Isaacs2012-03-021-6/+6
|
* libndr: Add ndr_map_error2errnoVolker Lendecke2012-02-132-0/+26
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Mon Feb 13 15:06:29 CET 2012 on sn-devel-104
* ndr: add ndr_pull_charset_to_null()David Disseldorp2012-01-132-0/+32
| | | | | | | 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>
* librpc: Add support for struct timevalVolker Lendecke2011-12-022-0/+41
|
* librpc: Add support for struct timespecVolker Lendecke2011-12-022-0/+41
|
* s3: Fix bug 8371Volker Lendecke2011-11-181-0/+2
| | | | | | | | | ndr_set_flag or's in the given flag (ALIGN4). At this point, ndr->flags contains NOALIGN, which will persist. In ndr_push_DATA_BLOB NOALIGN overrides everything else, so that the ALIGN4 is not respected. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Nov 18 09:33:37 CET 2011 on sn-devel-104
* dns: Fix offset check in ndr_pull_componentKai Blin2011-11-041-1/+1
| | | | | Autobuild-User: Kai Blin <kai@samba.org> Autobuild-Date: Fri Nov 4 17:25:16 CET 2011 on sn-devel-104
* nbt: Fix offset check in ndr_pull_componentKai Blin2011-11-041-1/+1
|
* nbt: create standard ndr_pull/push interface for common netlogon samlogon ↵Günther Deschner2011-11-032-1/+61
| | | | | | replies. Guenther
* nbt: move netlogon_samlogon_response into librpc/ndr/ndr_nbt.h.Günther Deschner2011-11-031-0/+11
| | | | Guenther
* nbt: move nbt_string ndr functions to ndr/ndr_nbt.c helper.Günther Deschner2011-11-032-0/+186
| | | | Guenther
* nbt: merge in LIBCLI_NDR_NETLOGON helper into NDR_NBT.Günther Deschner2011-11-032-0/+242
| | | | Guenther
* s4-dns: Added support for multiple DNS_RPC_RECORDS structuresAmitay Isaacs2011-10-202-0/+88
| | | | | | | | | | Windows returns multiple DNS_RPC_RECORDS structures, but there is no well defined structure in [MS-DNSP] doc. Added hand-written code to parse ndr. Pair-Programmed-With: Andrew Tridgell <tridge@samba.org> Signed-off-by: Andrew Tridgell <tridge@samba.org>
* build: avoid util.h as a public header name due to conflict with MacOSAndrew Bartlett2011-09-231-1/+1
|
* libndr: add checking to all pull/push functions of base typesAndrew Tridgell2011-09-081-0/+34
| | | | | | this checks that the passed in ndr_flags are valid Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* libndr: moved the NDR_* flags to have less overlapAndrew Tridgell2011-09-081-8/+36
| | | | | | | | | | | | | | | | | | | | 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>
* ndr: range check on push of dom_sid blobAndrew Tridgell2011-09-051-1/+4
| | | | | | | this ensures we get an error if we try to push a dom_sid with too many sub_auths Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* drsblobs: fixed alignment of drs blobs authentication informationAndrew Tridgell2011-09-051-5/+5
| | | | | | | the two types of ndr flags were being mixed up, so NDR_BUFFERS was being interpreted as LIBNDR_FLAG_NOALIGN Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* ndr_drsuapi: fix compiler warningStefan Metzmacher2011-08-091-2/+3
| | | | metze
* librpc/ndr remove _SAMBA_BUILD_ conditionalsAndrew Bartlett2011-07-063-8/+0
|
* lib/util/charset: Remove 'display charset'Andrew Bartlett2011-06-231-1/+0
| | | | | | | | | | | | | | | | | As discussed in 'CH_DISPLAY and gettext' on the samba-technical list: http://lists.samba.org/archive/samba-technical/2011-June/078190.html Setting this to a value other than 'unix charset' does not make sense, as any system where the filesytem charset does not equal the terminal charset will already have problems with programs as simple as 'ls'. It also means that our output could not be pasted as our input in interactive programs or onto our command line, as we never did translate in the DISPLAY -> UNIX direction. The d_printf() calls are retained in case we need to revisit this, and to support display_set_stderr(). Andrew Bartlett
* librpc: fix buildwarning in NDR_WMI.Günther Deschner2011-06-152-0/+25
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Jun 15 17:23:49 CEST 2011 on sn-devel-104
* librpc/ndr/ndr_table.h: fix licence/copyrightGünther Deschner2011-06-101-0/+22
| | | | Guenther
* librpc/ndr/ndr_spoolss_buf.h: fix licence/copyrightGünther Deschner2011-06-101-0/+23
| | | | Guenther
* librpc/ndr/ndr_dns.h: fix licence/copyrightGünther Deschner2011-06-101-0/+25
| | | | Guenther
* librpc/ndr/ndr_compression.h: fix licence/copyrightGünther Deschner2011-06-101-0/+22
| | | | Guenther
* librpc/ndr/ndr_backupkey.h: fix licence/copyrightGünther Deschner2011-06-101-0/+21
| | | | Guenther
* Fix type mixing warnings.Jeremy Allison2011-06-011-2/+2
|
* librpc/ndr: Use converted_size to determine if NULL termination was sentAndrew Bartlett2011-06-011-4/+10
| | | | | | | | | | This is better than doing a strlen() on the string, as that huristic only worked for ASCII strings. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Jun 1 01:42:22 CEST 2011 on sn-devel-104
* librpc/ndr: add new LIBNDR_FLAG_STR_RAW8 for ndr_pull_stringSean Finney2011-06-012-8/+39
| | | | | | | | | | | | | | | | | | | | 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/ndr: consolidate string conversion logic in ndr_pull_stringSean Finney2011-06-011-171/+44
| | | | | | | | | | | | | Reduce the amount of duplicate code in ndr_pull_string by moving the almost duplicate conversion calls and their corresponding NDR pulls and checks to a single location. In the place of the removed calls is logic allowing the conversion to be generalized, and and any specific pulls/checks that do not apply to the general case. This is similar to what has already been done in the switch statement for ndr_push_string. Signed-off-by: Sean Finney <seanius@seanius.net>
* librpc/ndr Merge ndr_print_sockaddr_storage() into common codeAndrew Bartlett2011-05-182-0/+34
| | | | | | | There is no longer a reason to leave this source3 specific, and this brings it into a library (avoiding duplicate symbols). Andrew Bartlett
* auth: Move auth_session_info into IDLAndrew Bartlett2011-04-052-0/+76
| | | | | | | | | | This changes auth_session_info_transport to just be a wrapper, rather than a copy that has to be kept in sync. As auth_session_info was already wrapped in python, this required changes to the existing pyauth wrapper and it's users. Andrew Bartlett
* Fix convert_string() to take a *converted_size arg. and return a bool.Jeremy Allison2011-03-301-6/+6
| | | | | | | | Makes these interfaces much harder to misuse and easier to ensure error checking. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Mar 30 23:59:37 CEST 2011 on sn-devel-104
* This doesn't look like it has anything to do with character set conversion, ↵Jeremy Allison2011-03-301-7/+10
| | | | | | | | | | | | | | | | | | | but it does :-). Turns out one of the *really* significant differences between convert_string() in source4 and source3, is that the one in source3 will return 0 for byte length converted when called with dest_len = 0 whereas the one in source4 returns (size_t)-1 and sets errno to E2BIG. Allow the ndr_string code to cope with the (arguably correct) way that the source4 implementation works. This code only gets excercised in the print spooler tests, which aren't run in source4, which is why this bug has lasted for so long. You don't want to know how long it took me to find this :-). Jeremy.