samba.git
4 weeks agovfs: perform impersonation in smb_vfs_call_get_dos_attributes_done()
Ralph Boehme [Mon, 14 Jan 2019 12:51:23 +0000 (13:51 +0100)]
vfs: perform impersonation in smb_vfs_call_get_dos_attributes_done()

This is needed as the callback might be called in an arbitrary
impersonation state.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 weeks agovfs: use struct initializer in smb_vfs_call_get_dos_attributes_send
Ralph Boehme [Mon, 14 Jan 2019 12:50:31 +0000 (13:50 +0100)]
vfs: use struct initializer in smb_vfs_call_get_dos_attributes_send

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 weeks agonetcmd: Change domain backup commands to use s3 SMB Py bindings
Tim Beale [Thu, 13 Dec 2018 04:31:23 +0000 (17:31 +1300)]
netcmd: Change domain backup commands to use s3 SMB Py bindings

This means we can now backup a DC that has SMBv1 disabled.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Tim Beale <timbeale@samba.org>
Autobuild-Date(master): Mon Jan 14 06:49:09 CET 2019 on sn-devel-144

4 weeks agotests: Change ntaclsbackup tests over to use s3 Py bindings
Tim Beale [Thu, 13 Dec 2018 03:05:36 +0000 (16:05 +1300)]
tests: Change ntaclsbackup tests over to use s3 Py bindings

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 weeks agos3:pylibsmb: Add .get_acl() API to SMB py bindings
Tim Beale [Wed, 12 Dec 2018 03:14:43 +0000 (16:14 +1300)]
s3:pylibsmb: Add .get_acl() API to SMB py bindings

There is no obvious async-equivalent of cli_query_security_descriptor(),
so it will throw an error if anyone tries to use it in multi-threaded
mode. Currently only samba-tool and tests use the (s4) .get_acl() API,
both of which will be fine using the synchronous API.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 weeks agolib/ldb: Use new PYARG_ES format for parseTuple
Noel Power [Mon, 12 Nov 2018 16:06:10 +0000 (16:06 +0000)]
lib/ldb: Use new PYARG_ES format for parseTuple

While 'es' format works great for unicode (in python2) and
str (in python3) The behaviour with str (in python2) is unexpected.
In python2 the str type is (re-encoded) with the specified encoding.
In python2 the 'et' type would be a better match, that ensures 'str'
type is treated like it was with 's' (no reencoding) and unicode is
encoded with the specified encoding. However in python3 'et' allows
byte (or bytearray) params to be accepted (with no reencoding), we
don't want this. This patch adds a new PYARG_STR_UNI format code which
is a hybrid, in python2 it evaluates to 'et' and in python3 'es' and
so gives the desired behaviour for each python version.

Additionally remove the associated known fail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13616
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Sun Jan 13 03:53:00 CET 2019 on sn-devel-144

4 weeks agoselftest: Enable ldb.python for PY3
Noel Power [Mon, 12 Nov 2018 17:56:46 +0000 (17:56 +0000)]
selftest: Enable ldb.python for PY3

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 weeks agolib/ldb/tests/python: Add test to pass utf8 encoded bytes to ldb.Dn
Noel Power [Mon, 12 Nov 2018 17:42:51 +0000 (17:42 +0000)]
lib/ldb/tests/python: Add test to pass utf8 encoded bytes to ldb.Dn

This test should demonstrate an error with the 'es' format in python
where a 'str' byte-string is passed (containing utf8 encoded bytes)
with some characters that cannot be decoded as ascii. The same
code if run in python3 should generate an error (needs string not
bytes)

Also Add knownfail for ldb.Dn passed utf8 encoded byte string
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 weeks agos4/libnet: use 'et' as format for ParseTuple with python2
Noel Power [Tue, 11 Dec 2018 15:58:44 +0000 (15:58 +0000)]
s4/libnet: use 'et' as format for ParseTuple with python2

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 weeks agopython: use 'et' as format for ParseTuple with python2
Noel Power [Tue, 11 Dec 2018 15:58:07 +0000 (15:58 +0000)]
python: use 'et' as format for ParseTuple with python2

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 weeks agoauth/credentials: use 'et' as format for ParseTuple with python2
Noel Power [Tue, 11 Dec 2018 15:32:11 +0000 (15:32 +0000)]
auth/credentials: use 'et' as format for ParseTuple with python2

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 weeks agopython: Add new compat PYARG_STR_UNI format
Noel Power [Tue, 11 Dec 2018 15:18:10 +0000 (15:18 +0000)]
python: Add new compat PYARG_STR_UNI format

In python2 PYARG_STR_UNI evaluates to et which allows str type
(e.g bytes) pass through unencoded and accepts unicode objects
encoded as utf8
In python3 PYARG_STR_UNI evaluates to es which allows str type
encoded as named/specified encoding

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 weeks agopython: Fix memory leak with ParseTuple (using 'es' format)
Noel Power [Fri, 9 Nov 2018 16:47:00 +0000 (16:47 +0000)]
python: Fix memory leak with ParseTuple (using 'es' format)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agoselftest:Samba4: run fl2003dc without security context multiplexing
Stefan Metzmacher [Fri, 14 Dec 2018 12:36:39 +0000 (13:36 +0100)]
selftest:Samba4: run fl2003dc without security context multiplexing

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>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jan 12 06:25:37 CET 2019 on sn-devel-144

5 weeks agoselftest:Samba4: run the raw_protocol test with a limit of 8 auth contexts
Stefan Metzmacher [Fri, 14 Dec 2018 12:51:27 +0000 (13:51 +0100)]
selftest:Samba4: run the raw_protocol test with a limit of 8 auth contexts

This is much faster than exploring the limit of 2049 during autobuild.

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>
5 weeks agos4:rpc_server: implement security context multiplexing
Stefan Metzmacher [Thu, 8 Nov 2018 13:59:58 +0000 (14:59 +0100)]
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>
5 weeks agopy:dcerpc/raw_protocol: add tests to demonstrate how security context multiplexing...
Stefan Metzmacher [Wed, 21 Nov 2018 10:01:55 +0000 (11:01 +0100)]
py:dcerpc/raw_protocol: add tests to demonstrate how security context multiplexing works

Important things are this:
- It's not required to use the bind time feature negotiation in order
  to use it, it's only a hint for the client, but nothing is really
  negotiated, unlike the request multiplexing with the
  DCERPC_PFC_FLAG_CONC_MPX.
- There's special handling related to AUTH_LEVEL_CONNECT
  and requests without auth trailer
- An security context is identified by the unique
  tuple of auth_type, auth_level and auth_context_id (all together!),
  not just the auth_context_id.
- There's a limit of 2049 explicit authentication contexts.

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>
5 weeks agopy:dcerpc/raw_testcase: add assertEqualsStrLower()
Stefan Metzmacher [Mon, 26 Nov 2018 10:49:22 +0000 (11:49 +0100)]
py:dcerpc/raw_testcase: add assertEqualsStrLower()

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>
5 weeks agopidl/Python: use py_dcerpc_ndr_pointer_wrap/deref if multiple pointer levels are...
Stefan Metzmacher [Thu, 29 Nov 2018 12:25:21 +0000 (13:25 +0100)]
pidl/Python: use py_dcerpc_ndr_pointer_wrap/deref if multiple pointer levels are used

This will help the raw_protocol test to explore lsa_GetUserName.

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>
5 weeks agos4:pyrpc: add py_dcerpc_ndr_pointer_deref/wrap() infrastructure
Stefan Metzmacher [Thu, 29 Nov 2018 11:41:34 +0000 (12:41 +0100)]
s4:pyrpc: add py_dcerpc_ndr_pointer_deref/wrap() infrastructure

Some idl files use more than one layer of unique pointers. e.g.

    NTSTATUS lsa_GetUserName(
            [in,unique] [string,charset(UTF16)] uint16 *system_name,
            [in,out,ref] lsa_String **account_name,
            [in,out,unique] lsa_String **authority_name
            );

In order to specify *io.in.authority_name = NULL,
we need to wrap the pointer value (lsa_String or None)
into an base.ndr_pointer() object.

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>
5 weeks agos4:pyrpc: make use of pytalloc_get_type() in py_dcerpc_syntax_init_helper()
Stefan Metzmacher [Thu, 29 Nov 2018 15:47:15 +0000 (16:47 +0100)]
s4:pyrpc: make use of pytalloc_get_type() in py_dcerpc_syntax_init_helper()

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>
5 weeks agos4:rpc_server/lsa: specify \\pipe\lsass as ncacn_np_secondary_endpoint
Stefan Metzmacher [Wed, 12 Dec 2018 21:41:56 +0000 (22:41 +0100)]
s4:rpc_server/lsa: specify \\pipe\lsass as ncacn_np_secondary_endpoint

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>
5 weeks agos4:rpc_server: make it possible to specify ncacn_np_secondary_endpoint
Stefan Metzmacher [Wed, 12 Dec 2018 21:41:56 +0000 (22:41 +0100)]
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>
5 weeks agopy:dcerpc/raw_protocol: demonstrate that \\pipe\lsarpc returns \\pipe\lsass as second...
Stefan Metzmacher [Thu, 13 Dec 2018 09:13:03 +0000 (10:13 +0100)]
py:dcerpc/raw_protocol: demonstrate that \\pipe\lsarpc returns \\pipe\lsass as secondary_address

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>
5 weeks agos4:rpc_server: only share assoc group ids on the same transport
Stefan Metzmacher [Wed, 12 Dec 2018 12:49:35 +0000 (13:49 +0100)]
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>
5 weeks agopy:dcerpc/raw_protocol: add test_assoc_group_fail3()
Stefan Metzmacher [Wed, 12 Dec 2018 12:43:45 +0000 (13:43 +0100)]
py:dcerpc/raw_protocol: add test_assoc_group_fail3()

This demonstrates that assoc groups are only shared on the
same transport (endpoint).

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>
5 weeks agos4:rpc_server: don't replace '\\pipe\\' with '\\PIPE\\'
Stefan Metzmacher [Wed, 12 Dec 2018 12:48:05 +0000 (13:48 +0100)]
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>
5 weeks agopy:dcerpc/raw_protocol: add test_assoc_group_ok2 to check assoc groups over ncacn_np
Stefan Metzmacher [Wed, 12 Dec 2018 11:35:09 +0000 (12:35 +0100)]
py:dcerpc/raw_protocol: add test_assoc_group_ok2 to check assoc groups over ncacn_np

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>
5 weeks agoselftest:Samba4: allow dcerpc auth level connect:lsarpc = yes in chgdcpass
Stefan Metzmacher [Thu, 22 Nov 2018 23:23:23 +0000 (00:23 +0100)]
selftest:Samba4: allow dcerpc auth level connect:lsarpc = yes in chgdcpass

This is required to explore the details of security context multiplexing
using lsa_GetUserName().

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>
5 weeks agopy:dcerpc/raw_protocol: enable tests with the DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN bit
Stefan Metzmacher [Wed, 21 Nov 2018 08:38:46 +0000 (09:38 +0100)]
py:dcerpc/raw_protocol: enable tests with the DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN bit

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>
5 weeks agos4:rpc_server: fix DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN negotiation to match Windows
Stefan Metzmacher [Wed, 21 Nov 2018 08:39:36 +0000 (09:39 +0100)]
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>
5 weeks agopy:dcerpc/raw_protocol: consistently call self.recv_pdu(timeout=0.01) after auth3
Stefan Metzmacher [Wed, 21 Nov 2018 10:49:40 +0000 (11:49 +0100)]
py:dcerpc/raw_protocol: consistently call self.recv_pdu(timeout=0.01) after auth3

When we don't expect a FAULT, we should wait a little bit to check
there's no response to auth3 request. This reduces the raw_procol
test from 45s down to 35s total runtime against 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>
5 weeks agopy:dcerpc/raw_protocol: add tests for delayed header signing activation
Stefan Metzmacher [Wed, 21 Nov 2018 10:49:40 +0000 (11:49 +0100)]
py:dcerpc/raw_protocol: add tests for delayed header signing activation

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>
5 weeks agopy:dcerpc/raw_testcase: add pfc_flags_2nd and use_auth3 options to do_generic_bind()
Stefan Metzmacher [Wed, 21 Nov 2018 10:49:40 +0000 (11:49 +0100)]
py:dcerpc/raw_testcase: add pfc_flags_2nd and use_auth3 options to do_generic_bind()

This makes it more flexible and allows to write complex tests in an
easier fashion.

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>
5 weeks agos4:rpc_server: SMB_ASSERT(auth->auth_finished); in order to get auth details
Stefan Metzmacher [Fri, 23 Nov 2018 12:24:05 +0000 (13:24 +0100)]
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>
5 weeks agos4:rpc_server: only pass context to op_bind() hooks
Stefan Metzmacher [Wed, 21 Nov 2018 19:06:21 +0000 (20:06 +0100)]
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>
5 weeks agos4:rpc_server: only use context within op_bind() hooks and dcesrv_interface_bind_...
Stefan Metzmacher [Wed, 21 Nov 2018 19:06:21 +0000 (20:06 +0100)]
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>
5 weeks agos4:rpc_server: remove unused dcesrv_connection_context->private_date
Stefan Metzmacher [Mon, 10 Dec 2018 22:51:09 +0000 (23:51 +0100)]
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>
5 weeks agos4:rpc_server: remove unused dcesrv_assoc_group->proxied_id
Stefan Metzmacher [Wed, 21 Nov 2018 22:38:25 +0000 (23:38 +0100)]
s4:rpc_server: remove unused dcesrv_assoc_group->proxied_id

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>
5 weeks agos4:rpc_server/winreg: don't cache an ldb connection per presentation context
Stefan Metzmacher [Wed, 21 Nov 2018 19:05:01 +0000 (20:05 +0100)]
s4:rpc_server/winreg: don't cache an ldb connection per presentation context

We should do this per context handle, as these are available on all
connections of the association 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>
5 weeks agos4:rpc_server/remote: make use dcesrv_iface_state_{store,find}_{assoc,conn}() helpers
Stefan Metzmacher [Wed, 21 Nov 2018 18:28:30 +0000 (19:28 +0100)]
s4:rpc_server/remote: make use dcesrv_iface_state_{store,find}_{assoc,conn}() helpers

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>
5 weeks agos4:rpc_server/remote: introduce struct dcesrv_remote_call
Stefan Metzmacher [Fri, 23 Nov 2018 13:28:56 +0000 (14:28 +0100)]
s4:rpc_server/remote: introduce struct dcesrv_remote_call

This holds the state for async requests.

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>
5 weeks agos4:rpc_server/remote: defer the connect to the first client request
Stefan Metzmacher [Wed, 21 Nov 2018 18:19:15 +0000 (19:19 +0100)]
s4:rpc_server/remote: defer the connect to the first client request

This means we have a chance to use delegated credentials from the client
if available, as the authentication is already completed.

Before we only ever used the transport inherited credentials
via SMB or anonymous.

Note: most times we still fallback to anonymous...

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>
5 weeks agos4:rpc_server/remote: fail the connection if the remote server don't support MPX
Stefan Metzmacher [Fri, 23 Nov 2018 13:21:45 +0000 (14:21 +0100)]
s4:rpc_server/remote: fail the connection if the remote server don't support MPX

If we already negotiated with our client to support concurent multiplexing (MPX),
we need a remote connection that also supports it.

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>
5 weeks agoselftest: use "dcerpc_remote:allow_anonymous_fallback = yes" for rpc_proxy
Stefan Metzmacher [Fri, 23 Nov 2018 12:15:10 +0000 (13:15 +0100)]
selftest: use "dcerpc_remote:allow_anonymous_fallback = yes" for rpc_proxy

This already uses anonymous credentials as the remote connection is done
during the bind before the realm authentication has started.

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>
5 weeks agos4:rpc_server/remote: add dcerpc_remote:allow_anonymous_fallback option
Stefan Metzmacher [Fri, 23 Nov 2018 12:13:53 +0000 (13:13 +0100)]
s4:rpc_server/remote: add dcerpc_remote:allow_anonymous_fallback option

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>
5 weeks agos4:rpc_server/remote: reformat code to get "dcerpc_remote:use_machine_account"
Stefan Metzmacher [Wed, 21 Nov 2018 18:14:59 +0000 (19:14 +0100)]
s4:rpc_server/remote: reformat code to get "dcerpc_remote:use_machine_account"

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>
5 weeks agos4:rpc_server/remote: reformat code to get "dcerpc_remote:binding"
Stefan Metzmacher [Wed, 21 Nov 2018 18:13:50 +0000 (19:13 +0100)]
s4:rpc_server/remote: reformat code to get "dcerpc_remote:binding"

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>
5 weeks agos4:rpc_server/remote: remote_op_bind already has the table available
Stefan Metzmacher [Wed, 21 Nov 2018 18:08:59 +0000 (19:08 +0100)]
s4:rpc_server/remote: remote_op_bind already has the table available

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>
5 weeks agos4:rpc_server/remote: introduce remote_get_private()
Stefan Metzmacher [Wed, 21 Nov 2018 17:00:29 +0000 (18:00 +0100)]
s4:rpc_server/remote: introduce remote_get_private()

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>
5 weeks agos4:rpc_server/dnsserver: make use of dcesrv_iface_state_{create,find}_conn()
Stefan Metzmacher [Mon, 10 Dec 2018 21:42:51 +0000 (22:42 +0100)]
s4:rpc_server/dnsserver: make use of dcesrv_iface_state_{create,find}_conn()

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>
5 weeks agos4:rpc_server/netlogon: make use of dcesrv_iface_state_{create,find}_conn()
Stefan Metzmacher [Mon, 10 Dec 2018 21:42:51 +0000 (22:42 +0100)]
s4:rpc_server/netlogon: make use of dcesrv_iface_state_{create,find}_conn()

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>
5 weeks agos4:rpc_server: add dcesrv_iface_state_{store,find}_{assoc,conn}() helpers
Stefan Metzmacher [Mon, 10 Dec 2018 21:41:31 +0000 (22:41 +0100)]
s4:rpc_server: add dcesrv_iface_state_{store,find}_{assoc,conn}() helpers

They can be used instead of
dcesrv_connection_context->private_data and
dcesrv_assoc_group->proxied_id.

This is the first step to hide internal details of
the core dcerpc server from the interface implementations.

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>
5 weeks agos4:rpc_server: move bind_time_features to dcesrv_assoc_group
Stefan Metzmacher [Wed, 21 Nov 2018 22:39:11 +0000 (23:39 +0100)]
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>
5 weeks agos4:rpc_server: add a min_auth_level to context handles
Stefan Metzmacher [Wed, 21 Nov 2018 22:27:50 +0000 (23:27 +0100)]
s4:rpc_server: add a min_auth_level to context handles

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>
5 weeks agos4:rpc_server: replace dce_conn->allow_request with auth->auth_finished
Stefan Metzmacher [Thu, 22 Nov 2018 09:30:47 +0000 (10:30 +0100)]
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>
5 weeks agos4:rpc_server: replace dce_conn->allow_auth3 with auth->auth_started
Stefan Metzmacher [Thu, 22 Nov 2018 09:30:47 +0000 (10:30 +0100)]
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>
5 weeks agos4:rpc_server: set auth_invalid = true on disconnect
Stefan Metzmacher [Thu, 6 Dec 2018 16:03:25 +0000 (17:03 +0100)]
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>
5 weeks agos4:rpc_server: split out log_successful_dcesrv_authz_event()
Stefan Metzmacher [Thu, 22 Nov 2018 12:26:21 +0000 (13:26 +0100)]
s4:rpc_server: split out log_successful_dcesrv_authz_event()

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>
5 weeks agos4:rpc_server: add some protection checks to dcesrv_auth_prepare_gensec()
Stefan Metzmacher [Thu, 8 Nov 2018 15:36:52 +0000 (16:36 +0100)]
s4:rpc_server: add some protection checks to dcesrv_auth_prepare_gensec()

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>
5 weeks agos4:rpc_server: split out dcesrv_auth_prepare_gensec()
Stefan Metzmacher [Thu, 8 Nov 2018 15:36:13 +0000 (16:36 +0100)]
s4:rpc_server: split out dcesrv_auth_prepare_gensec()

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>
5 weeks agos4:rpc_server: allocate struct dcesrv_auth with talloc
Stefan Metzmacher [Thu, 8 Nov 2018 12:28:07 +0000 (13:28 +0100)]
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>
5 weeks agos4:rpc_server: make use of dcesrv_call_state->auth_state in dcerpc_server.c
Stefan Metzmacher [Wed, 31 Oct 2018 13:44:33 +0000 (14:44 +0100)]
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>
5 weeks agos4:rpc_server: make use of dcesrv_call_state->auth_state in common/reply.c
Stefan Metzmacher [Wed, 31 Oct 2018 13:44:33 +0000 (14:44 +0100)]
s4:rpc_server: make use of dcesrv_call_state->auth_state in common/reply.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>
5 weeks agos4:rpc_server: make use of dcesrv_call_state->auth_state in dcesrv_auth.c
Stefan Metzmacher [Wed, 31 Oct 2018 13:44:33 +0000 (14:44 +0100)]
s4:rpc_server: make use of dcesrv_call_state->auth_state in dcesrv_auth.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>
5 weeks agos4:rpc_server: introduce dcesrv_call_state->auth_state
Stefan Metzmacher [Wed, 31 Oct 2018 13:44:33 +0000 (14:44 +0100)]
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>
5 weeks agos4:rpc_server: use helper variables to access 'struct dcesrv_auth' in dcerpc_server.c
Stefan Metzmacher [Wed, 31 Oct 2018 16:12:02 +0000 (17:12 +0100)]
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>
5 weeks agos4:rpc_server: use helper variables to access 'struct dcesrv_auth' in common/reply.c
Stefan Metzmacher [Wed, 31 Oct 2018 16:12:02 +0000 (17:12 +0100)]
s4:rpc_server: use helper variables to access 'struct dcesrv_auth' in common/reply.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>
5 weeks agos4:rpc_server: use helper variables to access 'struct dcesrv_auth' in dcesrv_auth.c
Stefan Metzmacher [Wed, 31 Oct 2018 16:12:02 +0000 (17:12 +0100)]
s4:rpc_server: use helper variables to access 'struct dcesrv_auth' in dcesrv_auth.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>
5 weeks agos4:rpc_server/remote: make use of dcesrv_call_credentials()
Stefan Metzmacher [Thu, 8 Nov 2018 12:08:19 +0000 (13:08 +0100)]
s4:rpc_server/remote: make use of dcesrv_call_credentials()

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>
5 weeks agos4:rpc_server/netlogon: make use of dcesrv_call_auth_info()
Stefan Metzmacher [Thu, 8 Nov 2018 11:44:30 +0000 (12:44 +0100)]
s4:rpc_server/netlogon: make use of 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>
5 weeks agos4:rpc_server/netlogon: simplify logic of dcesrv_netr_creds_server_step_check()
Stefan Metzmacher [Thu, 8 Nov 2018 12:05:25 +0000 (13:05 +0100)]
s4:rpc_server/netlogon: simplify logic of dcesrv_netr_creds_server_step_check()

It's enough to check the auth_type for DCERPC_AUTH_TYPE_SCHANNEL,
there's no need to also check the auth_level for integrity or privacy.

The gensec layer already required at least DCERPC_AUTH_LEVEL_INTEGRITY,
see schannel_update_internal().

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>
5 weeks agos4:rpc_server/lsa: make use of dcesrv_call_auth_info()
Stefan Metzmacher [Thu, 8 Nov 2018 11:44:30 +0000 (12:44 +0100)]
s4:rpc_server/lsa: make use of dcesrv_call_auth_info()

It's enough to check the auth_type for DCERPC_AUTH_TYPE_SCHANNEL,
there's no need to also check the auth_level for integrity or privacy.

The gensec layer already required at least DCERPC_AUTH_LEVEL_INTEGRITY,
see schannel_update_internal().

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>
5 weeks agos4:rpc_server/samr: make use of dcesrv_call_auth_info()
Stefan Metzmacher [Thu, 8 Nov 2018 11:44:30 +0000 (12:44 +0100)]
s4:rpc_server/samr: make use of 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>
5 weeks agos4:rpc_server: add dcesrv_call_auth_info()
Stefan Metzmacher [Thu, 8 Nov 2018 11:44:30 +0000 (12:44 +0100)]
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>
5 weeks agos4:rpc_server/handles: make use dcesrv_call_session_info()
Stefan Metzmacher [Sat, 3 Nov 2018 00:19:51 +0000 (01:19 +0100)]
s4:rpc_server/handles: make use 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>
5 weeks agos4:rpc_server: remove the old dcesrv_handle_{new,fetch}() api
Stefan Metzmacher [Thu, 8 Nov 2018 11:20:44 +0000 (12:20 +0100)]
s4:rpc_server: remove the old dcesrv_handle_{new,fetch}() api

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>
5 weeks agos4:rpc_server: only use the new dcesrv_handle_{create,lookup}() api
Stefan Metzmacher [Thu, 8 Nov 2018 11:20:44 +0000 (12:20 +0100)]
s4:rpc_server: only use the new dcesrv_handle_{create,lookup}() api

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>
5 weeks agos4:rpc_server/winreg: make use of dcesrv_handle_create()
Stefan Metzmacher [Thu, 8 Nov 2018 11:20:44 +0000 (12:20 +0100)]
s4:rpc_server/winreg: make use of dcesrv_handle_create()

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>
5 weeks agos4:rpc_server/samr: make use of dcesrv_handle_create()
Stefan Metzmacher [Thu, 8 Nov 2018 11:20:44 +0000 (12:20 +0100)]
s4:rpc_server/samr: make use of dcesrv_handle_create()

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>
5 weeks agos4:rpc_server/lsa: make use of dcesrv_handle_create()
Stefan Metzmacher [Thu, 8 Nov 2018 11:20:44 +0000 (12:20 +0100)]
s4:rpc_server/lsa: make use of dcesrv_handle_create()

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>
5 weeks agos4:rpc_server/eventlog: make use of dcesrv_handle_create()
Stefan Metzmacher [Thu, 8 Nov 2018 11:20:44 +0000 (12:20 +0100)]
s4:rpc_server/eventlog: make use of dcesrv_handle_create()

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>
5 weeks agos4:rpc_server/drsuapi: make use of dcesrv_handle_create()
Stefan Metzmacher [Thu, 8 Nov 2018 11:20:44 +0000 (12:20 +0100)]
s4:rpc_server/drsuapi: make use of dcesrv_handle_create()

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>
5 weeks agos4:rpc_server: add dcesrv_handle_{create,lookup}() functions
Stefan Metzmacher [Thu, 8 Nov 2018 10:48:46 +0000 (11:48 +0100)]
s4:rpc_server: add dcesrv_handle_{create,lookup}() functions

They take struct dcesrv_call_state as argument and will replace
dcesrv_handle_{new,fetch}() which take dcesrv_connection_context
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>
5 weeks agos4:rpc_server: add some const to dcesrv_handle_fetch()
Stefan Metzmacher [Thu, 8 Nov 2018 11:14:05 +0000 (12:14 +0100)]
s4:rpc_server: add some const to dcesrv_handle_fetch()

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>
5 weeks agos4:rpc_server: merge dcesrv_fetch_session_key() into dcesrv_transport_session_key()
Stefan Metzmacher [Thu, 8 Nov 2018 10:52:29 +0000 (11:52 +0100)]
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>
5 weeks agos4:rpc_server: remove unused dcesrv_inherited_session_key()
Stefan Metzmacher [Thu, 8 Nov 2018 10:52:29 +0000 (11:52 +0100)]
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>
5 weeks agos4:rpc_server: only pass dcesrv_auth to auth_state.session_key_fn()
Stefan Metzmacher [Thu, 8 Nov 2018 10:14:41 +0000 (11:14 +0100)]
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>
5 weeks agos4:rpc_server: only setup the auth_state.session_key fn in dcesrv_endpoint_connect()
Stefan Metzmacher [Thu, 8 Nov 2018 10:14:41 +0000 (11:14 +0100)]
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>
5 weeks agos4:rpc_server: make dcesrv_endpoint_connect() static
Stefan Metzmacher [Thu, 8 Nov 2018 10:14:41 +0000 (11:14 +0100)]
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>
5 weeks agos4:rpc_server: only AUTH_TYPE_NONE should get a transport session key
Stefan Metzmacher [Thu, 8 Nov 2018 08:45:15 +0000 (09:45 +0100)]
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>
5 weeks agos4:rpc_server: split out a dcesrv_session_info_session_key() helper function
Stefan Metzmacher [Thu, 8 Nov 2018 08:45:15 +0000 (09:45 +0100)]
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>
5 weeks agos4:rpc_server: allow a NULL function pointer in dcesrv_fetch_session_key()
Stefan Metzmacher [Thu, 8 Nov 2018 08:45:15 +0000 (09:45 +0100)]
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>
5 weeks agos4:rpc_server/drsuapi: make use of dcesrv_auth_session_key()
Stefan Metzmacher [Thu, 8 Nov 2018 10:52:29 +0000 (11:52 +0100)]
s4:rpc_server/drsuapi: make use of dcesrv_auth_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>
5 weeks agos4:rpc_server/samr: make use of dcesrv_transport_session_key()
Stefan Metzmacher [Thu, 8 Nov 2018 10:52:29 +0000 (11:52 +0100)]
s4:rpc_server/samr: make use of 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>
5 weeks agos4:rpc_server/lsa: make use of dcesrv_transport_session_key()
Stefan Metzmacher [Thu, 8 Nov 2018 10:52:29 +0000 (11:52 +0100)]
s4:rpc_server/lsa: make use of 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>
5 weeks agos4:rpc_server: add dcesrv_{auth,transport}_session_key() functions
Stefan Metzmacher [Thu, 8 Nov 2018 10:48:46 +0000 (11:48 +0100)]
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>
5 weeks agos4:rpc_server/common: make use dcesrv_call_session_info()
Stefan Metzmacher [Sat, 3 Nov 2018 00:19:51 +0000 (01:19 +0100)]
s4:rpc_server/common: make use 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>
5 weeks agos4:rpc_server/winreq: make use dcesrv_call_session_info()
Stefan Metzmacher [Sat, 3 Nov 2018 00:19:51 +0000 (01:19 +0100)]
s4:rpc_server/winreq: make use 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>
5 weeks agos4:rpc_server/srvsvc: make use dcesrv_call_session_info()
Stefan Metzmacher [Sat, 3 Nov 2018 00:19:51 +0000 (01:19 +0100)]
s4:rpc_server/srvsvc: make use 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>