summaryrefslogtreecommitdiffstats
path: root/librpc/ndr
Commit message (Collapse)AuthorAgeFilesLines
* libndr: Use GUID_compare in GUID_equalVolker Lendecke2014-06-101-9/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dcerpc.idl: hide (ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT) logic behind a defineStefan Metzmacher2014-03-281-0/+4
| | | | | | | | | This way we can alter the define depending on the generated code. E.g python bindings won't have an 'ndr' struct available. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc/nbt: increase MAX_COMPONENTS limit for nbt_names.Günther Deschner2014-02-131-1/+1
| | | | | | | | | | | | | | domains with more then 10 subdomains are not so uncommon. https://bugzilla.samba.org/show_bug.cgi?id=10439 Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Feb 13 16:30:50 CET 2014 on sn-devel-104
* librpc/ndr: add ndr_table_by_syntax()Stefan Metzmacher2014-02-112-0/+15
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: add ndr_syntax_id_[from|to]_string()Stefan Metzmacher2014-02-112-0/+49
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: add ndr_pull_append/pop()Stefan Metzmacher2014-02-112-0/+107
| | | | | | | | | | | | | | | They can be used to parse a fragmented NDR byte stream. ndr_pull_append() appends more data that can be processed and ndr_pull_pop() removed already processed data. This will be used to implement dcerpc pipes, where we can get a verify large amount of pipe chunks, once we processed a chunk we can forget about the related data, but we may need to keep some bytes in order to get the alignment right. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: add support for a shallow copy to ndr_pull_subcontext_start/endStefan Metzmacher2014-02-111-1/+20
| | | | | | | | This will be usefull to try parsing DCERPC pipe chunks for LIBNDR_FLAG_INCOMPLETE_BUFFER. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: remember INCOMPLETE_BUFFER missing bytes in relative_highest_offsetStefan Metzmacher2014-02-111-0/+9
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: add NDR_ERR_INCOMPLETE_BUFFER and LIBNDR_FLAG_INCOMPLETE_BUFFERStefan Metzmacher2014-02-112-1/+20
| | | | | | | | | | | | If we pull a pipe chunk we need a way to check if we have enough bytes to parse the complete chunk. Setting ndr_pull->flags |= LIBNDR_FLAG_INCOMPLETE_BUFFER would change NDR_ERR_BUFSIZE (and later maybe others) into NDR_ERR_INCOMPLETE_BUFFER. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: fix headers in ndr_dcerpc.cGregor Beck2014-02-111-3/+1
| | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: add ndr_pop_dcerpc_sec_verification_trailer()Gregor Beck2014-01-082-0/+146
| | | | | | | | | | | | | | This extracts the dcerpc_sec_verification_trailer from the end of an ndr_pull structure, it found it reduces ndr->data_size. NDR_ERR_ALLOC is the only possible error, all other errors are ignored and a trailer with command count = 0 is returned. Pair-Programmed-With: Gregor Beck <gbeck@sernet.de> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc: fix possible memory leakGregor Beck2014-01-071-0/+1
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* dcerpc.idl: add dcerpc_sec_verification_trailerStefan Metzmacher2014-01-071-0/+66
| | | | | | | | | | See [MS-RPCE] 2.2.2.13 Verification Trailer for details. Pair-Programmed-With: Gregor Beck <gbeck@sernet.de> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc/ndr: add LIBNDR_FLAG_SUBCONTEXT_NO_UNREAD_BYTESStefan Metzmacher2014-01-072-0/+26
| | | | | | | | This lets ndr_pull_subcontext_end() make sure that all subcontext bytes are consumed otherwise it returns NDR_ERR_UNREAD_BYTES. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc-idl: change the drsuapi_DsBindInfoCtr so that it match what is on the ↵Matthieu Patou2013-10-301-0/+156
| | | | | | | | | | | | | wire both in NDR32 and NDR64. Previous implementation had a problem with NDR64 with uint32 and uint3264 being in the wrong order Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Oct 30 10:16:02 CET 2013 on sn-devel-104
* libndr: Avoid ommitting display of unset bitmap flags.Günther Deschner2013-10-091-4/+4
| | | | | | | | | | | | | | In 816e68f94fe500b9d68fd29021d432b84d3139b7 the display of unset bits has been effectively disabled while only the check for 0 bits was supposed to be avoided (because it creates the infite loop). Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Oct 9 19:56:39 CEST 2013 on sn-devel-104
* librpc: Fix blank line endingsVolker Lendecke2013-10-021-8/+8
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Oct 2 15:02:07 CEST 2013 on sn-devel-104
* libndr: Fix ndr_print_bitmap_flag for value=0Volker Lendecke2013-10-021-0/+4
| | | | | | | Don't endlessly loop Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* librpc: return a ndr_pull_error instead of just NDR_ERR_NDR64 when upper ↵Matthieu Patou2013-10-021-1/+2
| | | | | | | bits of 64 bit value are not 0 Signed-off-by: Matthieu Patou <mat@matws.net> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* librpc/ndr: make use of ndr_dump_data() in ndr_print_array_uint8()Stefan Metzmacher2013-09-241-2/+11
| | | | | | | | It's much easier to look at hexdump -C style output than a few thousand lines with 1 byte each. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Matthieu Patou <mat@matws.net>
* librpc/ndr: make ndr_pull/push_DATA_BLOB NDR64 awareStefan Metzmacher2013-09-241-4/+4
| | | | | | | Pair-Programmed-With: Matthieu Patou <mat@matws.net> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Matthieu Patou <mat@matws.net>
* librpc/ndr: make sure ndr_table_list() always calls ndr_init_table() first.Günther Deschner2013-09-201-0/+1
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* librpc/ndr: call ndr_table_list() from all ndr_X functions.Günther Deschner2013-09-201-3/+3
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* librpc: Fix some "ignored asprint result" warningsVolker Lendecke2013-06-111-18/+9
| | | | | | | While there, it removes some alloc/free calls Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc: Add NDR_PRINT_DEBUGC to ndr print to a debug classKai Blin2013-05-182-0/+54
| | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ndr: Pass down string_flags in ndr_pull_ntprinting_printer().Andreas Schneider2013-03-151-0/+2
| | | | Reviewed-by: Günther Deschner <gd@samba.org>
* ndr: Add ndr_ntprinting_string_flags() function.Andreas Schneider2013-03-152-0/+17
| | | | | | It defaults to utf8string. Reviewed-by: Günther Deschner <gd@samba.org>
* ndr: Comparing an array to null is always true.Andreas Schneider2013-02-221-1/+1
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* krb5pac: make sure to correctly store the highest relative pointer offset.Günther Deschner2013-02-011-0/+3
| | | | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Fri Feb 1 21:19:28 CET 2013 on sn-devel-104
* ndr: Check return code of ndr_pull_advance().Andreas Schneider2012-12-211-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* 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
|