4142bde7e5
s4: rename source4/smbd/ to source4/samba/
...
Signed-off-by: Ralph Boehme <slow@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Autobuild-User(master): Ralph Böhme <slow@samba.org >
Autobuild-Date(master): Fri Nov 27 10:07:18 UTC 2020 on sn-devel-184
2020-11-27 10:07:18 +00:00
6c94ebf77f
s4:rpc_server: Use cli_credentials_init_server()
...
Signed-off-by: Andreas Schneider <asn@samba.org >
2020-09-07 12:02:15 +00:00
6a6546b565
librpc:core: Allocate struct dcesrv_interface with talloc
...
The S3 implementation needs to reinit the dcesrv_context and free the
endpoints list with their registered interfaces.
Signed-off-by: Samuel Cabrero <scabrero@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:37 +00:00
491102b5b2
s4:rpc_server: Move core functions to core library
...
Signed-off-by: Samuel Cabrero <scabrero@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:37 +00:00
480dd6163b
s4:rpc_server: Make functions public
...
These functions will be moved to core dcerpc library and called from
s4 and s3 implementations.
Signed-off-by: Samuel Cabrero <scabrero@suse.de >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:37 +00:00
0523f0b4d2
s4:rpc_server: Add public function dcesrv_connection_loop_start
...
This function starts the server loop and will be called from s3 and s4
implementations.
Signed-off-by: Samuel Cabrero <scabrero@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:37 +00:00
85de73354d
s4:rpc_server: Add transport termination function pointer
...
As the dcesrv_terminate_connection function will be moved to the shared
rpc server core library, hide the stream_terminate_connection call behind
a function pointer.
The s3 implementation will define its own termination function.
Signed-off-by: Samuel Cabrero <scabrero@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:37 +00:00
55ad4ae7ff
s4:rpc_server: Find association groups through context callbacks
...
Split the association group management from the server code, the s3 and
s4 implementation will handle differently.
Signed-off-by: Samuel Cabrero <scabrero@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:37 +00:00
b0ecc8ef55
s4:rpc_server: inline the dcesrv_assoc_group_find function
...
Signed-off-by: Samuel Cabrero <scabrero@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:37 +00:00
6fe23fa071
s4:rpc_server: Hide gensec prepare behind function pointer
...
This function will be different for s3 and s4
Signed-off-by: Samuel Cabrero <scabrero@suse.de >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:36 +00:00
bf09771953
s4:rpc_server: Add dcesrv_context_callbacks to dcesrv_context
...
Add a new struct dcesrv_context_callbacks in dcesrv_context to hold pointers
to functions whose implementation will differ between S3 and S4.
The log_successful_dcesrv_authz_event implementation will differ as it
requires an imessaging_context.
Signed-off-by: Samuel Cabrero <scabrero@suse.de >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:36 +00:00
6fcf8038e4
s4:rpc_server: Do not include s4 librpc headers in dcerpc core
...
Signed-off-by: Samuel Cabrero <scabrero@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:36 +00:00
b6c8afa98c
s4:librpc: Rename ncacn_push_auth to dcerpc_ncacn_push_auth
...
Next commit will move this function to common librpc
Signed-off-by: Samuel Cabrero <scabrero@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:36 +00:00
83def9a945
s4:rpc_server: Split dcerpc_generic_session_key for server and client
...
Split the common bits of dcerpc_generic_session_key to librpc and rename
client the specific part to dcecli_generic_session_key.
Signed-off-by: Samuel Cabrero <scabrero@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:36 +00:00
f402b937f4
s4:rpc_server: Remove server_id from dcerpc core structs
...
Add a helper function to retrieve it from the stream connection.
Signed-off-by: Samuel Cabrero <scabrero@suse.de >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:36 +00:00
3d7167f4f4
s4:rpc_server: Remove imessaging_context from dcerpc core structs
...
Add a helper function to retrieve the imessaging_context from the
stream connection.
Signed-off-by: Samuel Cabrero <scabrero@suse.de >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:36 +00:00
4d7a916189
s4:rpc_server: Cleanup includes
...
Signed-off-by: Samuel Cabrero <scabrero@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:36 +00:00
d572219e1b
s4:rpc_server: Fix debug string printing duplicated function name
...
Signed-off-by: Samuel Cabrero <scabrero@suse.de >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
Reviewed-by: Andreas Schneider <asn@samba.org >
2019-10-18 16:07:35 +00:00
3378a561ef
s4:rpc_server: add missing newline to error debug message
...
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
2019-04-03 00:13:10 +00:00
7bc6ec81c8
s4:rpc_server: implement security context multiplexing
...
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 >
2019-01-12 03:13:41 +01:00
98d5872293
s4:rpc_server: make it possible to specify ncacn_np_secondary_endpoint
...
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 >
2019-01-12 03:13:41 +01:00
b3659fb52d
s4:rpc_server: only share assoc group ids on the same transport
...
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 >
2019-01-12 03:13:41 +01:00
c192dc1c9d
s4:rpc_server: don't replace '\\pipe\\' with '\\PIPE\\'
...
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 >
2019-01-12 03:13:40 +01:00
975e8e1f25
s4:rpc_server: fix DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN negotiation to match 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 >
2019-01-12 03:13:40 +01:00
6f53c99372
s4:rpc_server: SMB_ASSERT(auth->auth_finished); in order to get auth details
...
Signed-off-by: Stefan Metzmacher <metze@samba.org >
Reviewed-by: Jeremy Allison <jra@samba.org >
2019-01-12 03:13:39 +01:00
e9eb8e6a44
s4:rpc_server: only pass context to op_bind() hooks
...
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 >
2019-01-12 03:13:39 +01:00
70b00c7567
s4:rpc_server: only use context within op_bind() hooks and 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 >
2019-01-12 03:13:39 +01:00
28f4cb442c
s4:rpc_server: remove unused dcesrv_connection_context->private_date
...
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 >
2019-01-12 03:13:39 +01:00
38e0c06abc
s4:rpc_server: move bind_time_features to dcesrv_assoc_group
...
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 >
2019-01-12 03:13:37 +01:00
d8293acdb4
s4:rpc_server: replace dce_conn->allow_request with auth->auth_finished
...
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 >
2019-01-12 03:13:37 +01:00
13e52cc929
s4:rpc_server: replace dce_conn->allow_auth3 with auth->auth_started
...
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 >
2019-01-12 03:13:37 +01:00
0191516efc
s4:rpc_server: set auth_invalid = true on disconnect
...
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 >
2019-01-12 03:13:37 +01:00
e2a05c3ad8
s4:rpc_server: allocate struct dcesrv_auth with talloc
...
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 >
2019-01-12 03:13:37 +01:00
5802161258
s4:rpc_server: make use of dcesrv_call_state->auth_state in 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 >
2019-01-12 03:13:36 +01:00
9a3ea90cc5
s4:rpc_server: introduce dcesrv_call_state->auth_state
...
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 >
2019-01-12 03:13:36 +01:00
93ae817a02
s4:rpc_server: use helper variables to access 'struct dcesrv_auth' in 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 >
2019-01-12 03:13:36 +01:00
62d45e16e0
s4:rpc_server: add dcesrv_call_auth_info()
...
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 >
2019-01-12 03:13:35 +01:00
ace0672968
s4:rpc_server: merge dcesrv_fetch_session_key() into 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 >
2019-01-12 03:13:34 +01:00
b8eae043dd
s4:rpc_server: remove unused dcesrv_inherited_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 >
2019-01-12 03:13:34 +01:00
57edc9a0d5
s4:rpc_server: only pass dcesrv_auth to auth_state.session_key_fn()
...
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 >
2019-01-12 03:13:34 +01:00
e0a963a7ce
s4:rpc_server: only setup the auth_state.session_key fn in 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 >
2019-01-12 03:13:34 +01:00
00e9204567
s4:rpc_server: make dcesrv_endpoint_connect() static
...
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 >
2019-01-12 03:13:34 +01:00
d2aecd8755
s4:rpc_server: only AUTH_TYPE_NONE should get a transport session key
...
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 >
2019-01-12 03:13:34 +01:00
6df7143606
s4:rpc_server: split out a dcesrv_session_info_session_key() helper function
...
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 >
2019-01-12 03:13:33 +01:00
851c06f40b
s4:rpc_server: allow a NULL function pointer in dcesrv_fetch_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 >
2019-01-12 03:13:33 +01:00
13c534bd93
s4:rpc_server: add dcesrv_{auth,transport}_session_key() functions
...
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 >
2019-01-12 03:13:33 +01:00
961ebf229a
s4:rpc_server: add dcesrv_call_session_info()
...
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 >
2019-01-12 03:13:32 +01:00
0c10c0e17a
source4 dcerpc_server: remove irpc_add_name
...
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 >
2018-11-23 08:25:20 +01:00
454d8148a6
Fix spelling s/woks/works
...
Signed-off-by: Garming Sam <garming@catalyst.net.nz >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
2018-05-12 02:09:29 +02:00
a877018ebe
s4:rpc_server: Fix size types
...
This fixes compilation with -Wstrict-overflow=2
Signed-off-by: Andreas Schneider <asn@samba.org >
Reviewed-by: Andrew Bartlett <abartlet@samba.org >
2018-03-20 23:16:15 +01:00