summaryrefslogtreecommitdiff
path: root/source4/rpc_server/dcerpc_server.c
Commit message (Collapse)AuthorAgeFilesLines
* s4:rpc_server: add missing newline to error debug messageBjörn Baumbach2019-04-031-1/+1
| | | | | | | | Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Apr 3 00:13:10 UTC 2019 on sn-devel-144
* s4:rpc_server: implement security context multiplexingStefan Metzmacher2019-01-121-3/+95
| | | | | | | | | | | | | | | | | There're some systems like Cisco ISE use security multiplexing without checking (via bind time feature negotiation) the server supports it. Others like VMWare View, fallback to NT4 style netlogon connections without using netlogon secure channel, which then triggers an error, with "server schannel = yes", see https://bugzilla.samba.org/show_bug.cgi?id=13464. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: make it possible to specify ncacn_np_secondary_endpointStefan Metzmacher2019-01-121-1/+26
| | | | | | | | | | | Even a connect to \\pipe\lsarpc should return a secondary_address of '\\pipe\\lsass'. But that will be implemented in a following commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: only share assoc group ids on the same transportStefan Metzmacher2019-01-121-13/+30
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: don't replace '\\pipe\\' with '\\PIPE\\'Stefan Metzmacher2019-01-121-17/+1
| | | | | | | | | | This is not what Windows returns (at least for \\pipe\lsass). BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: fix DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN negotiation to match ↵Stefan Metzmacher2019-01-121-2/+7
| | | | | | | | | | Windows BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: SMB_ASSERT(auth->auth_finished); in order to get auth detailsStefan Metzmacher2019-01-121-1/+9
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: only pass context to op_bind() hooksStefan Metzmacher2019-01-121-1/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: only use context within op_bind() hooks and ↵Stefan Metzmacher2019-01-121-28/+10
| | | | | | | | | | dcesrv_interface_bind_*() functions BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: remove unused dcesrv_connection_context->private_dateStefan Metzmacher2019-01-121-1/+0
| | | | | | | | | | dcesrv_iface_state_{create,find}_{assoc,conn}() should be used instead. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: move bind_time_features to dcesrv_assoc_groupStefan Metzmacher2019-01-121-1/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: replace dce_conn->allow_request with auth->auth_finishedStefan Metzmacher2019-01-121-4/+2
| | | | | | | | | | | They both had the same lifetime and the disconnect case is now caught by auth->auth_invalid = true. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: replace dce_conn->allow_auth3 with auth->auth_startedStefan Metzmacher2019-01-121-3/+1
| | | | | | | | | | auth3 is allowed if auth_started is true and auth_finished is false. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: set auth_invalid = true on disconnectStefan Metzmacher2019-01-121-0/+4
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: allocate struct dcesrv_auth with tallocStefan Metzmacher2019-01-121-23/+45
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: make use of dcesrv_call_state->auth_state in dcerpc_server.cStefan Metzmacher2019-01-121-13/+13
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: introduce dcesrv_call_state->auth_stateStefan Metzmacher2019-01-121-0/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: use helper variables to access 'struct dcesrv_auth' in ↵Stefan Metzmacher2019-01-121-19/+24
| | | | | | | | | | dcerpc_server.c BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: add dcesrv_call_auth_info()Stefan Metzmacher2019-01-121-0/+17
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: merge dcesrv_fetch_session_key() into ↵Stefan Metzmacher2019-01-121-19/+8
| | | | | | | | | | dcesrv_transport_session_key() BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: remove unused dcesrv_inherited_session_key()Stefan Metzmacher2019-01-121-8/+0
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: only pass dcesrv_auth to auth_state.session_key_fn()Stefan Metzmacher2019-01-121-8/+20
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: only setup the auth_state.session_key fn in ↵Stefan Metzmacher2019-01-121-3/+19
| | | | | | | | | | dcesrv_endpoint_connect() BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: make dcesrv_endpoint_connect() staticStefan Metzmacher2019-01-121-1/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: only AUTH_TYPE_NONE should get a transport session keyStefan Metzmacher2019-01-121-0/+4
| | | | | | | | | | | | There's only a logic change for NCALRPC and NCACN_UNIX_STREAM. dcesrv_generic_session_key() already returned NT_STATUS_NO_USER_SESSION_KEY for all other cases. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: split out a dcesrv_session_info_session_key() helper functionStefan Metzmacher2019-01-121-6/+21
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: allow a NULL function pointer in dcesrv_fetch_session_key()Stefan Metzmacher2019-01-121-1/+8
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: add dcesrv_{auth,transport}_session_key() functionsStefan Metzmacher2019-01-121-0/+25
| | | | | | | | | | | | They take struct dcesrv_call_state as argument and will replace dcesrv_{inherited,fetch}_session_key() which take dcesrv_connection as argument. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: add dcesrv_call_session_info()Stefan Metzmacher2019-01-121-0/+8
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* source4 dcerpc_server: remove irpc_add_nameGary Lockyer2018-11-231-2/+0
| | | | | | | | Remove the irpc_add_name from dcesrv_sock_accept, as it results in two identical names being registered for a process. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix spelling s/woks/worksGarming Sam2018-05-121-1/+1
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: Fix size typesAndreas Schneider2018-03-201-2/+2
| | | | | | | This fixes compilation with -Wstrict-overflow=2 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: fix call_id truncation in dcesrv_find_fragmented_call()Stefan Metzmacher2018-02-211-1/+1
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13289 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Feb 21 19:02:56 CET 2018 on sn-devel-144
* source4/smbd: refactor the process model for preforkGary Lockyer2017-10-191-18/+38
| | | | | | | | | | | | | | | | | | Refactor the process model code to allow the addition of a prefork process model. - Add a process context to contain process model specific state - Add a service details structure to allow service to indicate which process model options they can support. In the new code the services advertise the features they support to the process model. The process model context is plumbed through to allow the process model to keep track of the supported options, and any state the process model may require. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-rpc_server: Improve debug of new endpointsAndrew Bartlett2017-07-281-3/+11
| | | | | | | | | | | | This helps us know what process model is required and what one is in use. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12939 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jul 28 04:12:08 CEST 2017 on sn-devel-144
* s4-rpc_server: ensure we get a new endpoint for netlogonAndrew Bartlett2017-07-281-1/+8
| | | | | | | | | | If we share the single process RPC servers with the multi-process RPC servers on the same endpoint, they will default to running in an single process BUG: https://bugzilla.samba.org/show_bug.cgi?id=12939 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* rpc: use symbolic constant to replace /root/ncalrpc_as_systemGary Lockyer2017-07-241-1/+1
| | | | | | | | | | | Modified to use constant AS_SYSTEM_MAGIC_PATH_TOKEN instead of string literal "/root/ncalrpc_as_system" BUG: https://bugzilla.samba.org/show_bug.cgi?id=12865 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s4:rpc_server: implement async AUTH3 using gensec_update_send/recvStefan Metzmacher2017-05-211-7/+33
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: implement async ALTER_CONTEXT using gensec_update_send/recvStefan Metzmacher2017-05-211-6/+32
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: implement async BIND using gensec_update_send/recvStefan Metzmacher2017-05-211-6/+119
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: make use of dcesrv_auth_prepare_auth3() in dcesrv_auth3()Stefan Metzmacher2017-05-211-4/+36
| | | | | | | | | It means we also need to call gensec_update_ev() and dcesrv_auth_complete() directly in dcesrv_auth3(). Doing that will make it easier to make dcesrv_auth3() async in the next commits. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: make use of dcesrv_auth_prepare_alter_ack() in dcesrv_alter()Stefan Metzmacher2017-05-211-1/+16
| | | | | | | | | It means we also need to call gensec_update_ev() and dcesrv_auth_complete() directly in dcesrv_alter(). Doing that will make it easier to make dcesrv_alter() async in the next commits. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: make use of dcesrv_auth_prepare_bind_ack() in dcesrv_bind()Stefan Metzmacher2017-05-211-2/+16
| | | | | | | | | It means we also need to call gensec_update_ev() and dcesrv_auth_complete() directly in dcesrv_bind(). Doing that will make it easier to make dcesrv_bind() async in the next commits. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: make use of dcesrv_auth_reply() in dcesrv_alter()Stefan Metzmacher2017-05-211-23/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: split out dcesrv_auth_reply() from dcesrv_bind()Stefan Metzmacher2017-05-211-1/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: remove useless TALLOC_FREE(call->context) from dcesrv_bind()Stefan Metzmacher2017-05-211-6/+0
| | | | | | | This is not needed if we're terminating the connection anyway. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: add wait_send/recv infrastructureStefan Metzmacher2017-05-211-0/+63
| | | | | | | | This will be used to implement async BIND/ALTER_CONTEXT/AUTH3 using gensec_update_send/recv. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:rpc_server: introduce call->ack_pkt and avoid pkt variable for the ↵Stefan Metzmacher2017-05-211-32/+32
| | | | | | | | | response on the stack This will be needed when we use async authentication using gensec_update_send/recv. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib: modules: Change XXX_init interface from XXX_init(void) to ↵Jeremy Allison2017-04-221-3/+3
| | | | | | | | | | | | | | | | | | | | XXX_init(TALLOC_CTX *) Not currently used - no logic changes inside. This will make it possible to pass down a long-lived talloc context from the loading function for modules to use instead of having them internally all use talloc_autofree_context() which is a hidden global. Updated all known module interface numbers, and added a WHATSNEW. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144
* s4-rpc_server: Correct comment about where the current iface can be foundAndrew Bartlett2017-03-291-3/+6
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>