summaryrefslogtreecommitdiffstats
path: root/source4/librpc
Commit message (Collapse)AuthorAgeFilesLines
* librpc/idl: Merge wbint.idl with winbind.idl so we can forward IRPC requests ↵Andrew Bartlett2014-06-112-14/+3
| | | | | | | | to internal winbind calls Change-Id: Iba3913d5a1c7f851b93f37e9beb6dbb20fbf7e55 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc: Fix a "ignoring asprintf return" warningVolker Lendecke2014-06-051-4/+5
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date(master): Thu Jun 5 22:28:16 CEST 2014 on sn-devel-104
* s4:librpc/rpc: allow a shortcut in dcerpc_pipe_connect_ncacn_np_smb[2]_send()Stefan Metzmacher2014-05-261-0/+10
| | | | | | | | | | | If the caller provided smbXcli * pointers of an existing connection, we can use it. This will be used later in order to allow multiple dcerpc connections over the same smb connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: split out continue_smb_open()Stefan Metzmacher2014-05-261-28/+11
| | | | | | | The smb and smb2 code pathes are the same. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: remove pipe_np_smb2_state and use pipe_np_smb_stateStefan Metzmacher2014-05-261-10/+4
| | | | | | | There's no need for two almost identical structures. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: remember some smbXcli_* pointers within struct ↵Stefan Metzmacher2014-05-261-33/+27
| | | | | | | | | dcerpc_pipe_connect This will simplify further improvements. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: use DCERPC_REQUEST_TIMEOUT for smb opensStefan Metzmacher2014-05-262-16/+8
| | | | | | | | There's no need to make the connect timeout dynamic. We implicitly used SMB_REQUEST_TIMEOUT which is also 60 seconds before. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: remove some unused functions and structures from dcerpc_sock.cStefan Metzmacher2014-05-261-46/+5
| | | | | | | | | Now we just dcerpc_sock.c doesn't need to maintain 'struct sock_private' in p->transport.private_data anymore, we're just using a raw tstream_context as p->transport.stream. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: avoid using dcerpc_socket_peer_addr()Stefan Metzmacher2014-05-261-9/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use information stored in the dcerpc_binding in order to open a secondary connection. The goals are: - dcerpc_secondary_connection_* should just use the dcerpc_binding information for the first connection and just call dcerpc_pipe_connect_* - Get rid of dcerpc_pipe->transport.* and just use a tstream_context. All other details should be maintained only by the higher levels. - Hide dcerpc_pipe and dcecli_connection behind dcerpc_binding_handle. - Have just one entry point to create a new connection. For source4/librpc this will be dcerpc_pipe_connect_*. For source3/rpc_client we need a similar function. - We'll have a new dcerpc_connection layer, with also just one entry point to create a new connection. - Replace dcerpc_pipe and dcecli_connection with the new dcerpc_connection layer. - Replace rpc_pipe_client with the new dcerpc_connection layer. - When the client side is unified we can change the server as it needs to act as a client in order to register the endpoint mappings. - Then the core of the server will be changed to use the new dcerpc_connection layer. As dcerpc_socket_peer_addr() uses p->transport.private_data as 'struct sock_private', we should avoid it. We can then remove dcerpc_unix_socket_path() and 'struct sock_private'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: set "localaddress" and reset "host" for ncacn_ip_tcpStefan Metzmacher2014-05-262-5/+34
| | | | | | | | | | | | We should remember local and remote ip address in dcerpc_pipe->binding. Note: that we still have the "target_hostname" unmodified, if present. This way dcerpc_pipe->binding can be used to create a secondary connection that is a additional connection for the existing association group. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: return the local/remote ip from dcerpc_pipe_open_tcp_recv()Stefan Metzmacher2014-05-263-6/+29
| | | | | | | | | It's important that the caller can remember the ips, so that a secondary connection can use the same addresses in order to get association group binding to work. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: optionally return the local address from ↵Stefan Metzmacher2014-05-261-5/+23
| | | | | | | | | | dcerpc_pipe_open_socket_recv() The caller should be able to remember the local address that was used for the connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: avoid using dcerpc_unix_socket_path()Stefan Metzmacher2014-05-261-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use information stored in the dcerpc_binding in order to open a secondary connection. The goals are: - dcerpc_secondary_connection_* should just use the dcerpc_binding information for the first connection and just call dcerpc_pipe_connect_* - Get rid of dcerpc_pipe->transport.* and just use a tstream_context. All other details should be maintained only by the higher levels. - Hide dcerpc_pipe and dcecli_connection behind dcerpc_binding_handle. - Have just one entry point to create a new connection. For source4/librpc this will be dcerpc_pipe_connect_*. For source3/rpc_client we need a similar function. - We'll have a new dcerpc_connection layer, with also just one entry point to create a new connection. - Replace dcerpc_pipe and dcecli_connection with the new dcerpc_connection layer. - Replace rpc_pipe_client with the new dcerpc_connection layer. - When the client side is unified we can change the server as it needs to act as a client in order to register the endpoint mappings. - Then the core of the server will be changed to use the new dcerpc_connection layer. As dcerpc_unix_socket_path() uses p->transport.private_data as 'struct sock_private', we should avoid it. We can then remove dcerpc_unix_socket_path() and 'struct sock_private'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:pyrpc: explicitly use dcerpc_binding_handle_set_sync_ev() for irpcAndrew Bartlett2014-05-131-0/+6
| | | | | | | | | | | | This indicates that we may use nested event loops... Andrew Bartlett Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Change-Id: Id014dcc68699c86cb99015a91a6979e30795f727 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s4:librpc: explicitly use allow_warnings=True where neededStefan Metzmacher2014-04-021-0/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: remember "ncalrpc_dir" on the dcerpc_pipe->bindingStefan Metzmacher2014-03-281-3/+11
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Mar 28 10:34:51 CET 2014 on sn-devel-104
* s4:pyrpc: add base.transfer_syntax_ndr*()Stefan Metzmacher2014-03-281-0/+52
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:pyrpc: add py_dcerpc_syntax_init_helper()Stefan Metzmacher2014-03-282-0/+26
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc: compile python bindings for dcerpc.idlStefan Metzmacher2014-03-282-0/+10
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc: make use of gensec_update_ev()Stefan Metzmacher2014-03-271-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: use dcerpc_binding_get_object() in order to pass the object ↵Stefan Metzmacher2014-03-251-2/+3
| | | | | | | | | | | | | | to the epmapper This way we'll be able to do epmapper lookups for the DFS-R (MS-FRS2) endpoint, by using "5bc1ed07-f5f5-485f-9dfd-6fd0acf9a23c@ncacn_ip_tcp:hostname.exmple.com[krb5,seal]" as binding. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Mar 25 02:43:39 CET 2014 on sn-devel-104
* s4:librpc/tests: assert the the abstract syntax has the expected value (null)Stefan Metzmacher2014-03-251-0/+4
| | | | | | | This makes sure that it's not mixed with the object guid anymore. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/tests: reset the object on the binding created from the towerStefan Metzmacher2014-03-251-0/+7
| | | | | | | | The tower doesn't contain information about the object only about the abstract syntax. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/test: test ipv6 addresses in dcerpc_binding stringsStefan Metzmacher2014-03-251-0/+22
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/tests: add more no transport testsStefan Metzmacher2014-03-251-3/+16
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: correctly map the fault code of alter context to NTSTATUSStefan Metzmacher2014-03-251-1/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc/rpc: remove unused dcecli_connection->binding_stringStefan Metzmacher2014-03-253-5/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* winbind4: Remove unused winbind_get_idmap irpc operationVolker Lendecke2014-03-051-22/+2
| | | | | | | Change-Id: Ia5e62d30b277f8a7074d451cfb8675eee8e9d21f Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* Revert "winbind4: Remove unused winbind_get_idmap irpc operation"Volker Lendecke2014-02-181-2/+22
| | | | | | | This reverts commit 41ff0f4454ef23d0ac3e31560d78a2b966769fea. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:pyrpc: let dcerpc_interface_new() use py_dcerpc_interface_init_helper()Stefan Metzmacher2014-02-171-74/+26
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Feb 17 21:39:30 CET 2014 on sn-devel-104
* s4:pyrpc: fix talloc hierachy in py_dcerpc_interface_init_helper()Stefan Metzmacher2014-02-171-35/+76
| | | | | | | | | | | | | | The tevent_context is cached under the connection, so we need to make sure it stays arround as long as the connection. Otherwise it will segfault while dereferencing the tevent_context on deallocation if a secondary connection is arround. This completes commit 4cc3388c034fa43c855fba802a30bbd2e78122be, which only fixed it in dcerpc_interface_new(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:librpc/rpc: make dcerpc_pipe->binding constStefan Metzmacher2014-02-133-8/+14
| | | | | | | | This should not be changed after the connection is ready for requests. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: pass dcerpc_binding arround as 'const'Stefan Metzmacher2014-02-134-13/+13
| | | | | | | This should only be modified by the owner. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: only pass down dcecli_connection to the low level connect ↵Stefan Metzmacher2014-02-131-16/+16
| | | | | | | | | functions They don't need dcerpc_pipe. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: don't create a ncacn_np: bindingStefan Metzmacher2014-02-131-26/+0
| | | | | | | It's up to the caller to store the dcerpc_pipe->binding. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: use dcerpc_binding_get_string_option() for "host" and ↵Stefan Metzmacher2014-02-132-17/+17
| | | | | | | "target_hostname" Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: use dcerpc_binding_get_string_option("target_principal")Stefan Metzmacher2014-02-131-4/+8
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: make use of dcerpc_binding_get_string_option("endpoint")Stefan Metzmacher2014-02-133-21/+62
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: make use of dcerpc_binding_get_flags()Stefan Metzmacher2014-02-133-16/+31
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: make use of dcerpc_binding_get_*() in dcerpc_connect.cStefan Metzmacher2014-02-131-21/+24
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: remove unused dcerpc_pipe->assoc_group_idStefan Metzmacher2014-02-132-3/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: make use of dcerpc_binding_[g|s]et_assoc_group_id()Stefan Metzmacher2014-02-131-2/+8
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: make use of dcerpc_binding_[g|s]et_* functions in ↵Stefan Metzmacher2014-02-131-23/+50
| | | | | | | dcerpc_epm_map_binding_send() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: always call dcerpc_binding_set_abstract_syntax() in ↵Stefan Metzmacher2014-02-131-3/+6
| | | | | | | | | | | | | | dcerpc_epm_map_binding_send() We should always set the abstract syntax even if we don't ask the endpoint mapper. By using dcerpc_binding_set_abstract_syntax() instead of calling binding->object = table->syntax_id, we will be able to separate the abstract_syntax from the object uuid in future. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/rpc: the table argument to dcerpc_epm_map_binding_send() isn't ↵Stefan Metzmacher2014-02-131-27/+23
| | | | | | | | | optional We already dereference it unchecked later, so we can avoid some indentation. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/tests: add dcerpc_binding assoc_group_id testsStefan Metzmacher2014-02-131-0/+19
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/tests: add dcerpc_binding target_hostname/target_principal testsStefan Metzmacher2014-02-131-0/+19
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:librpc/tests: use dcerpc_binding_get*() functionsStefan Metzmacher2014-02-131-21/+63
| | | | | | | We should not dereference struct dcerpc_binding. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: remove dcerpc_binding->localaddress and store it in the options ↵Stefan Metzmacher2014-02-131-2/+3
| | | | | | | array Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>