summaryrefslogtreecommitdiff
path: root/librpc/rpc
Commit message (Collapse)AuthorAgeFilesLines
* librpc: add binding handle support for [smb1]Stefan Metzmacher2018-08-132-0/+3
| | | | | | | | | | This will be used to force smb1. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> (cherry picked from commit 062b518cabd9fb5f72f96cdf400c978c0b844619)
* librpc/dceprc_util.c: Move debug message to DBG_DEBUG()Andrew Bartlett2017-09-071-2/+2
| | | | | | | This message shows up a lot (every packet) at level 6 for the succesful case Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* source4 rpc: binding.c enable DCERPC_SCHANNEL_AUTO for schannel connectionsGary Lockyer2017-05-251-1/+1
| | | | | | | | | | Enable the DCERPC_SCHANNEL_AUTO option in dceprc bindings. If not enabled calls to netlogon.netlogon from python fail with NT_STATUS_DOWNGRADE_DETECTED if schannel bindings are specified. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
* librpc/rpc: fix regression in NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGE error ↵Stefan Metzmacher2017-02-211-5/+3
| | | | | | | | | | | | | mapping Commit 1eef70872930fa4f9d3dedd23476b34cae638428 changed the mapping for DCERPC_NCA_S_FAULT_INVALID_TAG from NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGE to NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12585 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* librpc/rpc: verify the passed table against the table on the handleStefan Metzmacher2016-10-261-2/+0
| | | | | | | Now that all callers of dcerpc_binding_handle_create() are fixed. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc/rpc: make sure we use the object from the handle in ↵Stefan Metzmacher2016-10-261-0/+16
| | | | | | | | | | | | dcerpc_binding_handle_raw_call_send() If there's an object set on the binding handle, we need to use that and disallow per request passing of object. The normal client code will always have the object on the binding handle. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc/rpc: no longer set FLAG_OBJECT_PRESENT and FLAG_BIGENDIAN for ↵Stefan Metzmacher2016-10-261-16/+0
| | | | | | | | | ndr_{pull,push}_ncacn_packet() This is no longer required, it's done inside. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc: support "packet" for packet level authentication in binding stringsGünther Deschner2016-10-262-0/+5
| | | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc: add dcerpc_ncacn_push_pkt_auth() helper functionStefan Metzmacher2016-10-262-0/+210
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc: add dcerpc_ncacn_pull_pkt_auth() helper functionStefan Metzmacher2016-10-262-0/+152
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc/rpc: make use of dcerpc_pull_ncacn_packet() in ↵Stefan Metzmacher2016-10-261-27/+5
| | | | | | | | dcerpc_read_ncacn_packet_done() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc/rpc: move dcerpc_pull_ncacn_packet() from source3/librpc/rpc/ to the ↵Stefan Metzmacher2016-10-262-0/+48
| | | | | | | | toplevel Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* dcerpc.idl: add DCERPC_FAULT_SERVER_UNAVAILABLEStefan Metzmacher2016-10-261-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc/rpc: ignore invalid auth_pad_length values in BIND, ALTER and AUTH3 pdusStefan Metzmacher2016-06-241-0/+16
| | | | | | | | | | This is a workarround for a bug in old Samba releases. For BIND_ACK <= 3.5.x and for ALTER_RESP <= 4.2.x (see bug #11061). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11982 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* librpc/rpc: let dcerpc_pull_auth_trailer() check that auth_pad_length fits ↵Stefan Metzmacher2016-06-241-0/+37
| | | | | | | | | within the whole pdu. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11982 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* librpc/rpc: let dcerpc_pull_auth_trailer() only accept auth_length!=NULL or ↵Stefan Metzmacher2016-06-241-0/+8
| | | | | | | | | auth_data_only=true BUG: https://bugzilla.samba.org/show_bug.cgi?id=11982 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* CVE-2015-5370: librpc/rpc: don't allow pkt->auth_length == 0 in ↵Stefan Metzmacher2016-04-121-0/+5
| | | | | | | | | | | dcerpc_pull_auth_trailer() All callers should have already checked that. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11344 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* CVE-2015-5370: librpc/rpc: add a dcerpc_verify_ncacn_packet_header() helper ↵Stefan Metzmacher2016-04-122-0/+78
| | | | | | | | | function BUG: https://bugzilla.samba.org/show_bug.cgi?id=11344 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* CVE-2015-5370: librpc/rpc: simplify and harden dcerpc_pull_auth_trailer()Stefan Metzmacher2016-04-122-18/+49
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11344 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* CVE-2016-2118: librpc: change the default auth level from ↵Stefan Metzmacher2016-04-121-1/+1
| | | | | | | | | | | DCERPC_AUTH_LEVEL_CONNECT to DCERPC_AUTH_LEVEL_INTEGRITY ncacn_ip_tcp:server should get the same protection as ncacn_np:server if authentication and smb signing is used. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11616 Signed-off-by: Stefan Metzmacher <metze@samba.org>
* librpc/rpc: add error mappings for NO_CALL_ACTIVE, OUT_OF_RESOURCES and ↵Stefan Metzmacher2016-03-101-2/+4
| | | | | | | | BAD_STUB_DATA Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* Add a new header file for functions in lib/util/util.c.Jelmer Vernooij2016-01-131-0/+1
| | | | | | | | | This allows public headers to not include samba_util.h, but rather specific header files under lib/util. Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-By: Andrew Bartlett <abartlet@samba.org> Reviewed-By: Stefan Metzmacher <metze@samba.org>
* librpc: Fix a possible array out of bounds accessAndreas Schneider2015-12-011-1/+1
| | | | | | | Reported by gcc 5.1.1. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc/rpc: add dcerpc_[extract|construct]_bind_time_features()Stefan Metzmacher2015-07-032-0/+93
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: add dcerpc_fault_from_nt_status()Stefan Metzmacher2015-07-032-0/+22
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: add faultcode to nt_status mappingsStefan Metzmacher2015-07-031-68/+75
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc: prevent invalid NULL pointer derref in dcerpc_binding_get_auth_info().Günther Deschner2015-07-021-2/+2
| | | | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jul 2 02:05:38 CEST 2015 on sn-devel-104
* librpc/rpc: add DCERPC_AUTH_PAD_LENGTH(stub_length) helper macroStefan Metzmacher2015-06-231-0/+5
| | | | | | | | | | | | This calculates the required padding DCERPC_AUTH_PAD_ALIGNMENT and the stub_length. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11061 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rpc: Simplify dcerpc_binding_handle_raw_call()Volker Lendecke2015-06-191-13/+6
| | | | | | | | | | Align it with dcerpc_binding_handle_call() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jose A. Rivera <jarrpa@samba.org> Autobuild-User(master): José A. Rivera <jarrpa@samba.org> Autobuild-Date(master): Fri Jun 19 20:17:24 CEST 2015 on sn-devel-104
* rpc: Use tevent_req_poll_ntstatusVolker Lendecke2015-02-241-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-winbindd: Attempt to connect to NETLOGON over NCACN_IP_TCP if we canAndrew Bartlett2014-10-081-0/+2
| | | | | | | | | | | | This is very helpful in the trusted domain situation, as we may not have a two-way trust but we can use our domain trust account to set up a connection to NETLOGON Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Oct 8 12:48:15 CEST 2014 on sn-devel-104
* librpc/rpc: try to use DCERPC_NCA_S_* constants for error mappingsStefan Metzmacher2014-03-281-4/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc/rpc: finally maintain only the object guidStefan Metzmacher2014-03-251-6/+5
| | | | | | | This has nothing to do with ndr_syntax_id... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc/rpc: maintain "abstract_syntax" as string option of dcerpc_bindingStefan Metzmacher2014-03-251-24/+37
| | | | | | | This should not be mixed with the object guid! They are different things! Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc/rpc: handle ipv6 addresses without transport in dcerpc_parse_binding()Stefan Metzmacher2014-03-251-0/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc/rpc: add "schannel" => DCERPC_SCHANNEL as ncacn_optionStefan Metzmacher2014-03-251-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc/rpc: use dcerpc_binding_set_string_option(b, "endpoint", NULL) to ↵Stefan Metzmacher2014-03-251-5/+6
| | | | | | | | | reset the endpoint We should always go through just one code path to [re]set a value. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc/rpc: let dcerpc_binding_set_transport() also reset the assoc_group_idStefan Metzmacher2014-03-251-0/+5
| | | | | | | This is transport/endpoint specific. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc: inline CHECK_SYNTAX macro logicDavid Disseldorp2014-03-241-20/+31
| | | | | | | | | | | The CHECK_SYNTAX macro is currently used to compare ndr_syntax_ids and return false on mismatch. Macros affecting control flow are evil! Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Mar 24 21:46:39 CET 2014 on sn-devel-104
* librpc: inline VT CHECK macro logicDavid Disseldorp2014-03-241-20/+32
| | | | | | | | The CHECK macro is currently used to dump error and return false on VT condition check failure. Macros affecting control flow are evil! Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc: split type specific VT checks into helpersDavid Disseldorp2014-03-241-26/+57
| | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc: dump correct ndr_syntax_id on VT check failureDavid Disseldorp2014-03-241-1/+1
| | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc/rpc: finaly make struct dcerpc_binding privateStefan Metzmacher2014-02-132-13/+15
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Feb 13 13:55:47 CET 2014 on sn-devel-104
* librpc/rpc: make use of dcerpc_binding_set*() in dcerpc_binding_from_tower()Stefan Metzmacher2014-02-131-26/+44
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: use dcerpc_binding_get_*() in dcerpc_default_transport_endpoint()Stefan Metzmacher2014-02-131-13/+26
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: avoid loosing data with dcerpc_binding_string() -> ↵Stefan Metzmacher2014-02-131-1/+54
| | | | | | | dcerpc_parse_binding() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: add dcerpc_binding_[g|s]et_abstract_syntax()Stefan Metzmacher2014-02-132-5/+60
| | | | | | | | | | | | | | | | | | | | | | For now this is just an alternate wrapper to access binding->object. Currently callers are reusing binding->object to store the abstract syntax id instead of just the object uuid. Some services on Windows use the same GUID for the 'object' and the 'abstract syntax', but they are completely different things! Most services use a null object guid, some reuse the guid of the abstract syntax and use it like a 'class' object. But the object guid is only really used by DCOM, in order to call functions relative to an object instance, which a dynamically allocated object guid. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: allow "assoc_group_id" in dcerpc_binding_[g|s]et_string()Stefan Metzmacher2014-02-132-0/+30
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: add dcerpc_binding_[g|s]et_assoc_group_id()Stefan Metzmacher2014-02-132-0/+15
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: add dcerpc_binding_[g|s]et_transport()Stefan Metzmacher2014-02-132-2/+37
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>