samba.git
7 years agoctdb-tool: Simplify using tdb_storev
Amitay Isaacs [Wed, 12 Oct 2016 04:37:47 +0000 (15:37 +1100)]
ctdb-tool: Simplify using tdb_storev

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-client: Simplify using tdb_storev
Amitay Isaacs [Wed, 12 Oct 2016 04:32:29 +0000 (15:32 +1100)]
ctdb-client: Simplify using tdb_storev

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-client: Simplify using a local variable
Amitay Isaacs [Wed, 12 Oct 2016 04:32:17 +0000 (15:32 +1100)]
ctdb-client: Simplify using a local variable

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Simplify code using tdb_storev
Amitay Isaacs [Fri, 2 Sep 2016 07:53:32 +0000 (17:53 +1000)]
ctdb-daemon: Simplify code using tdb_storev

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-common: Simplify code using tdb_storev
Amitay Isaacs [Fri, 2 Sep 2016 07:22:26 +0000 (17:22 +1000)]
ctdb-common: Simplify code using tdb_storev

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Simplify code using local variable
Amitay Isaacs [Fri, 2 Sep 2016 07:51:36 +0000 (17:51 +1000)]
ctdb-daemon: Simplify code using local variable

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-common: Simplify code using local variables
Amitay Isaacs [Fri, 2 Sep 2016 07:11:17 +0000 (17:11 +1000)]
ctdb-common: Simplify code using local variables

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agos3-waf: Add winbindd to its own wscript_build file (already exists)
Günther Deschner [Mon, 26 Sep 2016 22:49:45 +0000 (00:49 +0200)]
s3-waf: Add winbindd to its own wscript_build file (already exists)

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 26 19:45:17 CEST 2016 on sn-devel-144

7 years agos3-waf: Add wscript_build for nmbd
Günther Deschner [Mon, 26 Sep 2016 22:39:53 +0000 (00:39 +0200)]
s3-waf: Add wscript_build for nmbd

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-waf: Create a wscript_build for the utils subdir
Günther Deschner [Mon, 26 Sep 2016 22:25:07 +0000 (00:25 +0200)]
s3-waf: Create a wscript_build for the utils subdir

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoidl: Remove unused DCERPC_FAULT_UNK_IF
Andreas Schneider [Wed, 26 Oct 2016 07:28:01 +0000 (09:28 +0200)]
idl: Remove unused DCERPC_FAULT_UNK_IF

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 26 15:06:44 CEST 2016 on sn-devel-144

7 years agos4-rpc_server: Use DCERPC_NCA_S_UNKNOWN_IF for fault code
Andreas Schneider [Wed, 26 Oct 2016 07:27:03 +0000 (09:27 +0200)]
s4-rpc_server: Use DCERPC_NCA_S_UNKNOWN_IF for fault code

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
7 years agopython/tests: add simple dcerpc orphaned tests
Stefan Metzmacher [Sun, 11 Sep 2016 21:25:49 +0000 (23:25 +0200)]
python/tests: add simple dcerpc orphaned tests

ORPHANED is mostly ignored. It's up to the application server
implementation to install a orphaned handler.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: add simple dcerpc co_cancel tests
Stefan Metzmacher [Sun, 11 Sep 2016 21:25:49 +0000 (23:25 +0200)]
python/tests: add simple dcerpc co_cancel tests

CO_CANCEL is mostly ignored. It's up to the application server
implementation to install a cancel handler.

The only implementation I found so far is the witness server
(see [MS-SWN] WitnessrAsyncNotify), which triggers a FAULT
with DCERPC_FAULT_SERVER_UNAVAILABLE.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: add simple dcerpc association group tests
Stefan Metzmacher [Tue, 27 Sep 2016 06:52:14 +0000 (08:52 +0200)]
python/tests: add simple dcerpc association group tests

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: add a second_connection() helper function
Stefan Metzmacher [Tue, 27 Sep 2016 06:33:31 +0000 (08:33 +0200)]
python/tests: add a second_connection() helper function

This can be used to create a 2nd connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: check context_id values of responses correctly
Stefan Metzmacher [Tue, 13 Sep 2016 22:27:02 +0000 (00:27 +0200)]
python/tests: check context_id values of responses correctly

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: make use of self.get_auth_context_creds() and self.do_generic_bind...
Stefan Metzmacher [Mon, 26 Sep 2016 05:46:43 +0000 (07:46 +0200)]
python/tests: make use of self.get_auth_context_creds() and self.do_generic_bind() in _test_spnego_bind_auth_level()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: make use of self.get_anon_creds() and self.get_user_creds()
Stefan Metzmacher [Mon, 26 Sep 2016 05:46:43 +0000 (07:46 +0200)]
python/tests: make use of self.get_anon_creds() and self.get_user_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: make use of get_auth_context_creds() in _test_auth_type_level_bind_nak()
Stefan Metzmacher [Fri, 16 Sep 2016 09:13:14 +0000 (11:13 +0200)]
python/tests: make use of get_auth_context_creds() in _test_auth_type_level_bind_nak()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: make use of prepare_presentation() in _get_netlogon_ctx()
Stefan Metzmacher [Tue, 20 Sep 2016 19:07:13 +0000 (21:07 +0200)]
python/tests: make use of prepare_presentation() in _get_netlogon_ctx()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: make it possible to specific TARGET_HOSTNAME to raw_protocol.py
Stefan Metzmacher [Tue, 20 Sep 2016 19:06:39 +0000 (21:06 +0200)]
python/tests: make it possible to specific TARGET_HOSTNAME to raw_protocol.py

SMB_CONF_PATH=/dev/null \
  SERVER=w2012r2-188.w2012r2-l6.base \
  USERNAME=administrator PASSWORD=A1b2C3d4 \
  python/samba/tests/dcerpc/raw_protocol.py -v -f TestDCERPC_BIND

or

SMB_CONF_PATH=/dev/null \
  SERVER=172.31.9.188 TARGET_HOSTNAME=w2012r2-188.w2012r2-l6.base \
  USERNAME=administrator PASSWORD=A1b2C3d4 \
  python/samba/tests/dcerpc/raw_protocol.py -v -f TestDCERPC_BIND

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython:tests: add more helper functions to RawDCERPCTest
Stefan Metzmacher [Fri, 16 Sep 2016 09:11:58 +0000 (11:11 +0200)]
python:tests: add more helper functions to RawDCERPCTest

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: we now pass test_no_auth_request_bind_pfc_CONC_MPX()
Stefan Metzmacher [Wed, 14 Sep 2016 23:18:28 +0000 (01:18 +0200)]
python/tests: we now pass test_no_auth_request_bind_pfc_CONC_MPX()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: add PyTypeObject objects for function structs
Stefan Metzmacher [Mon, 12 Sep 2016 07:20:44 +0000 (09:20 +0200)]
pidl:Python: add PyTypeObject objects for function structs

They provide get/set methods for the in_* and out_* elements
and the magic __ndr_{push,pull,print}_{in,out}__ hooks to enable
the marshalling via ndr_{push,pull,print}_{in,out}().

This provides an easy way to generate and parse the payload of
DCERPC requests and responses, which is very useful for writing
tests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: split out a PythonElementGetSet() helper function
Stefan Metzmacher [Mon, 12 Sep 2016 07:20:04 +0000 (09:20 +0200)]
pidl:Python: split out a PythonElementGetSet() helper function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:NDR: add ReturnTypeElement() helper function
Stefan Metzmacher [Tue, 13 Sep 2016 07:06:50 +0000 (09:06 +0200)]
pidl:NDR: add ReturnTypeElement() helper function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython:ndr: add ndr_{pack,unpack,print}_{in,out} helper functions
Stefan Metzmacher [Tue, 13 Sep 2016 03:51:42 +0000 (05:51 +0200)]
python:ndr: add ndr_{pack,unpack,print}_{in,out} helper functions

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython:ndr: verify the object type ndr_print() and ndr_unpack()
Stefan Metzmacher [Tue, 13 Sep 2016 03:51:42 +0000 (05:51 +0200)]
python:ndr: verify the object type ndr_print() and ndr_unpack()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: the py_{import,export}_*() functions can be static now.
Stefan Metzmacher [Mon, 12 Sep 2016 23:06:18 +0000 (01:06 +0200)]
pidl:Python: the py_{import,export}_*() functions can be static now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:pyrpc: remove unused py_{import,export}_netr_* prototypes
Stefan Metzmacher [Tue, 13 Sep 2016 02:48:13 +0000 (04:48 +0200)]
s4:pyrpc: remove unused py_{import,export}_netr_*  prototypes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: make use of the pyrpc_{import,export}_union() functions
Stefan Metzmacher [Mon, 12 Sep 2016 14:33:38 +0000 (16:33 +0200)]
pidl:Python: make use of the pyrpc_{import,export}_union() functions

This avoids the linking problems at C shared object level.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: provide a PyTypeObject with METH_CLASS __import__() and __export__(...
Stefan Metzmacher [Mon, 12 Sep 2016 14:33:38 +0000 (16:33 +0200)]
pidl:Python: provide a PyTypeObject with METH_CLASS __import__() and __export__() hooks

These are wrappers around the currently public C functions
'py_import_*() and 'py_export_*().

In order to let other python module use these function, we should
resolve the needed type object and call the __import__() or __export__()
hooks instead of linking to the other shared module at C level.

We already do the same for structs.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:pyrpc: add pyrpc_{im,ex}port_union() helper functions
Stefan Metzmacher [Tue, 13 Sep 2016 02:48:13 +0000 (04:48 +0200)]
s4:pyrpc: add pyrpc_{im,ex}port_union() helper functions

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: provide the abstract syntax as <module>.<interface>_abstract_syntax
Stefan Metzmacher [Sat, 24 Sep 2016 22:48:29 +0000 (00:48 +0200)]
pidl:Python: provide the abstract syntax as <module>.<interface>_abstract_syntax

The <module>.abstract_syntax alias is only kept as legacy for
the first interface in a module.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: prettify names of constants
Stefan Metzmacher [Fri, 23 Sep 2016 04:49:13 +0000 (06:49 +0200)]
pidl:Python: prettify names of constants

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:NDR: keep interface->{ORIGINAL}
Stefan Metzmacher [Tue, 13 Sep 2016 05:57:25 +0000 (07:57 +0200)]
pidl:NDR: keep interface->{ORIGINAL}

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: improve the .doc string for the get/set elements
Stefan Metzmacher [Tue, 13 Sep 2016 07:07:32 +0000 (09:07 +0200)]
pidl:Python: improve the .doc string for the get/set elements

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: make use of NDR_ERR_CODE_IS_SUCCESS()
Stefan Metzmacher [Mon, 12 Sep 2016 13:12:24 +0000 (15:12 +0200)]
pidl:Python: make use of NDR_ERR_CODE_IS_SUCCESS()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: __ndr_print__ functions don't get arguments and need METH_NOARGS
Stefan Metzmacher [Sat, 24 Sep 2016 23:07:14 +0000 (01:07 +0200)]
pidl:Python: __ndr_print__ functions don't get arguments and need METH_NOARGS

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl:Python: check the return values of talloc_ptrtype()
Stefan Metzmacher [Mon, 12 Sep 2016 13:12:50 +0000 (15:12 +0200)]
pidl:Python: check the return values of talloc_ptrtype()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:selftest: run rpc.echo with an object based binding string
Stefan Metzmacher [Sat, 24 Sep 2016 06:47:44 +0000 (08:47 +0200)]
s4:selftest: run rpc.echo with an object based binding string

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: pass the object guid to the binding handle if required
Stefan Metzmacher [Fri, 23 Sep 2016 22:22:41 +0000 (00:22 +0200)]
s4:librpc/rpc: pass the object guid to the binding handle if required

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc/rpc: verify the passed table against the table on the handle
Stefan Metzmacher [Sat, 24 Sep 2016 00:24:11 +0000 (02:24 +0200)]
librpc/rpc: verify the passed table against the table on the handle

Now that all callers of dcerpc_binding_handle_create() are fixed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc/rpc: make sure we use the object from the handle in dcerpc_binding_handle_raw_...
Stefan Metzmacher [Fri, 23 Sep 2016 22:22:12 +0000 (00:22 +0200)]
librpc/rpc: make sure we use the object from the handle in dcerpc_binding_handle_raw_call_send()

If there's an object set on the binding handle, we need to use that
and disallow per request passing of object.

The normal client code will always have the object on the binding handle.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:rpc_server: pass the full ndr_interface_table to rpc_pipe_open_internal()
Stefan Metzmacher [Sat, 24 Sep 2016 00:08:47 +0000 (02:08 +0200)]
s3:rpc_server: pass the full ndr_interface_table to rpc_pipe_open_internal()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: no longer set FLAG_OBJECT_PRESENT and FLAG_BIGENDIAN for ndr_push_ncac...
Stefan Metzmacher [Tue, 20 Sep 2016 19:19:28 +0000 (21:19 +0200)]
s4:librpc/rpc: no longer set FLAG_OBJECT_PRESENT and FLAG_BIGENDIAN for ndr_push_ncacn_packet()

This is no longer required, it's done inside.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc/rpc: no longer set FLAG_OBJECT_PRESENT and FLAG_BIGENDIAN for ndr_{pull,push...
Stefan Metzmacher [Tue, 20 Sep 2016 19:19:28 +0000 (21:19 +0200)]
librpc/rpc: no longer set FLAG_OBJECT_PRESENT and FLAG_BIGENDIAN for ndr_{pull,push}_ncacn_packet()

This is no longer required, it's done inside.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agodcerpc.idl: set LIBNDR_FLAG_* flags based on DCERPC_PFC_FLAG_OBJECT_UUID and DCERPC_D...
Stefan Metzmacher [Tue, 13 Sep 2016 15:03:47 +0000 (17:03 +0200)]
dcerpc.idl: set LIBNDR_FLAG_* flags based on DCERPC_PFC_FLAG_OBJECT_UUID and DCERPC_DREP_LE

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: implement DCERPC_PFC_FLAG_CONC_MPX ordering restrictions
Stefan Metzmacher [Fri, 16 Sep 2016 10:35:54 +0000 (12:35 +0200)]
s4:rpc_server: implement DCERPC_PFC_FLAG_CONC_MPX ordering restrictions

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server/remote: pass through DCERPC_PFC_FLAG_CONC_MPX if it was used by the...
Stefan Metzmacher [Thu, 15 Sep 2016 16:18:46 +0000 (18:18 +0200)]
s4:rpc_server/remote: pass through DCERPC_PFC_FLAG_CONC_MPX if it was used by the client

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: support DCESRV_CALL_STATE_FLAG_MULTIPLEXED by default
Stefan Metzmacher [Thu, 15 Sep 2016 16:18:01 +0000 (18:18 +0200)]
s4:rpc_server: support DCESRV_CALL_STATE_FLAG_MULTIPLEXED by default

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: make sure the DCERPC_CONCURRENT_MULTIPLEX and DCERPC_PFC_FLAG_CONC_MPX...
Stefan Metzmacher [Thu, 15 Sep 2016 16:17:44 +0000 (18:17 +0200)]
s4:librpc/rpc: make sure the DCERPC_CONCURRENT_MULTIPLEX and DCERPC_PFC_FLAG_CONC_MPX are in sync

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:torture/rpc: concurrent dcerpc_echo_TestSleep requests require a connection with...
Stefan Metzmacher [Thu, 15 Sep 2016 06:45:51 +0000 (08:45 +0200)]
s4:torture/rpc: concurrent dcerpc_echo_TestSleep requests require a connection with DCERPC_CONCURRENT_MULTIPLEX

Concurrent requests are only allowed if the client asked for
DCERPC_PFC_FLAG_CONC_MPX in the DCERPC_BIND.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:torture/rpc: add extra_flags to torture_rpc_connection_transport()
Stefan Metzmacher [Thu, 15 Sep 2016 06:36:32 +0000 (08:36 +0200)]
s4:torture/rpc: add extra_flags to torture_rpc_connection_transport()

This can be used to pass DCERPC_CONCURRENT_MULTIPLEX, which
sends DCERPC_PFC_FLAG_CONC_MPX in the DCERPC_BIND.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: return the context_id of a RESPONSE in the same way as windows
Stefan Metzmacher [Tue, 13 Sep 2016 23:17:19 +0000 (01:17 +0200)]
s4:rpc_server: return the context_id of a RESPONSE in the same way as windows

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: return the context_id of a FAULT in a same way as windows
Stefan Metzmacher [Tue, 13 Sep 2016 23:17:19 +0000 (01:17 +0200)]
s4:rpc_server: return the context_id of a FAULT in a same way as windows

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: fill call->context on the first fragment
Stefan Metzmacher [Tue, 13 Sep 2016 23:16:19 +0000 (01:16 +0200)]
s4:rpc_server: fill call->context on the first fragment

This allows us to get fault responses right.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: add DCERPC_BIND_TIME_KEEP_CONNECTION_ON_ORPHAN tests to dcerpc raw...
Stefan Metzmacher [Fri, 23 Oct 2015 13:39:34 +0000 (15:39 +0200)]
python/tests: add DCERPC_BIND_TIME_KEEP_CONNECTION_ON_ORPHAN tests to dcerpc raw protocol tests

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: implement DCERPC_BIND_TIME_KEEP_CONNECTION_ON_ORPHAN support
Stefan Metzmacher [Tue, 6 Oct 2015 08:18:06 +0000 (10:18 +0200)]
s4:rpc_server: implement DCERPC_BIND_TIME_KEEP_CONNECTION_ON_ORPHAN support

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: ignore CO_CANCEL and ORPHANED PDUs
Stefan Metzmacher [Fri, 26 Jun 2015 06:10:46 +0000 (08:10 +0200)]
s4:rpc_server: ignore CO_CANCEL and ORPHANED PDUs

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: list all connection oriented pdu types explicitly
Stefan Metzmacher [Tue, 13 Oct 2015 12:36:56 +0000 (14:36 +0200)]
s4:rpc_server: list all connection oriented pdu types explicitly

See DCE-RPC-1.1.pdf Section 12.6 Connection-oriented RPC PDUs Page 588.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:selftest: run some rpcclient tests with "packet"
Stefan Metzmacher [Fri, 23 Sep 2016 02:30:03 +0000 (04:30 +0200)]
s3:selftest: run some rpcclient tests with "packet"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:selftest: run some tests with "packet"
Stefan Metzmacher [Mon, 19 Sep 2016 05:29:59 +0000 (07:29 +0200)]
s4:selftest: run some tests with "packet"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-rpcclient: add packet auth level command
Günther Deschner [Tue, 6 Sep 2016 15:11:29 +0000 (17:11 +0200)]
s3-rpcclient: add packet auth level command

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-rpcclient: support [packet] in rpcclient binding strings.
Günther Deschner [Tue, 6 Sep 2016 15:07:32 +0000 (17:07 +0200)]
s3-rpcclient: support [packet] in rpcclient binding strings.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:rpc_server: add support for DCERPC_AUTH_LEVEL_PACKET
Stefan Metzmacher [Thu, 22 Sep 2016 22:16:13 +0000 (00:16 +0200)]
s3:rpc_server: add support for DCERPC_AUTH_LEVEL_PACKET

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:cli_pipe: add support for DCERPC_AUTH_LEVEL_PACKET
Günther Deschner [Tue, 30 Aug 2016 13:52:41 +0000 (15:52 +0200)]
s3:cli_pipe: add support for DCERPC_AUTH_LEVEL_PACKET

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:dcerpc_helpers: correctly support DCERPC_AUTH_LEVEL_PACKET
Stefan Metzmacher [Thu, 22 Sep 2016 22:11:03 +0000 (00:11 +0200)]
s3:dcerpc_helpers: correctly support DCERPC_AUTH_LEVEL_PACKET

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: add support for DCERPC_AUTH_LEVEL_PACKET
Günther Deschner [Tue, 30 Aug 2016 13:52:41 +0000 (15:52 +0200)]
s4:librpc/rpc: add support for DCERPC_AUTH_LEVEL_PACKET

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4-torture: test support for [packet] binding string option.
Günther Deschner [Wed, 31 Aug 2016 15:51:12 +0000 (17:51 +0200)]
s4-torture: test support for [packet] binding string option.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc: support "packet" for packet level authentication in binding strings
Günther Deschner [Tue, 30 Aug 2016 13:44:40 +0000 (15:44 +0200)]
librpc: support "packet" for packet level authentication in binding strings

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: convert dcesrv_auth_response() into a generic dcesrv_auth_pkt_push()
Stefan Metzmacher [Fri, 23 Oct 2015 14:06:17 +0000 (16:06 +0200)]
s4:rpc_server: convert dcesrv_auth_response() into a generic dcesrv_auth_pkt_push()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: make use of dcerpc_ncacn_push_pkt_auth() in dcesrv_auth_response()
Stefan Metzmacher [Fri, 23 Oct 2015 14:06:17 +0000 (16:06 +0200)]
s4:rpc_server: make use of dcerpc_ncacn_push_pkt_auth() in dcesrv_auth_response()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: convert dcesrv_auth_request() into a generic dcesrv_auth_pkt_pull()
Stefan Metzmacher [Wed, 28 Oct 2015 12:04:38 +0000 (13:04 +0100)]
s4:rpc_server: convert dcesrv_auth_request() into a generic dcesrv_auth_pkt_pull()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: make use of dcerpc_ncacn_pull_pkt_auth() in dcesrv_auth_request()
Stefan Metzmacher [Wed, 28 Oct 2015 12:04:38 +0000 (13:04 +0100)]
s4:rpc_server: make use of dcerpc_ncacn_pull_pkt_auth() in dcesrv_auth_request()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: make use of dcerpc_ncacn_push_pkt_auth() in ncacn_push_request_sign()
Stefan Metzmacher [Thu, 8 Sep 2016 13:07:36 +0000 (15:07 +0200)]
s4:librpc/rpc: make use of dcerpc_ncacn_push_pkt_auth() in ncacn_push_request_sign()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: convert ncacn_pull_request_auth() into a generic ncacn_pull_pkt_auth()
Stefan Metzmacher [Tue, 13 Oct 2015 13:42:32 +0000 (15:42 +0200)]
s4:librpc/rpc: convert ncacn_pull_request_auth() into a generic ncacn_pull_pkt_auth()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: make use of dcerpc_ncacn_pull_pkt_auth() in ncacn_pull_request_auth()
Stefan Metzmacher [Tue, 13 Oct 2015 13:42:32 +0000 (15:42 +0200)]
s4:librpc/rpc: make use of dcerpc_ncacn_pull_pkt_auth() in ncacn_pull_request_auth()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc: add dcerpc_ncacn_push_pkt_auth() helper function
Stefan Metzmacher [Tue, 6 Sep 2016 15:17:36 +0000 (17:17 +0200)]
librpc: add dcerpc_ncacn_push_pkt_auth() helper function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc: add dcerpc_ncacn_pull_pkt_auth() helper function
Stefan Metzmacher [Tue, 6 Sep 2016 14:43:53 +0000 (16:43 +0200)]
librpc: add dcerpc_ncacn_pull_pkt_auth() helper function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: do tests to verify spnego various auth_levels
Stefan Metzmacher [Wed, 31 Aug 2016 11:15:01 +0000 (13:15 +0200)]
python/tests: do tests to verify spnego various auth_levels

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: add bind time feature related tests to dcerpc raw protocol tests
Stefan Metzmacher [Fri, 23 Oct 2015 13:39:34 +0000 (15:39 +0200)]
python/tests: add bind time feature related tests to dcerpc raw protocol tests

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: implement bind time feature negotiation
Stefan Metzmacher [Tue, 6 Oct 2015 08:18:06 +0000 (10:18 +0200)]
s4:rpc_server: implement bind time feature negotiation

For now we don't really support any negotiated features.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: add presentation context related tests to dcerpc raw protocol tests
Stefan Metzmacher [Fri, 23 Oct 2015 13:39:34 +0000 (15:39 +0200)]
python/tests: add presentation context related tests to dcerpc raw protocol tests

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopython/tests: remove unused code in _test_auth_none_level_bind()
Stefan Metzmacher [Wed, 31 Aug 2016 13:05:37 +0000 (15:05 +0200)]
python/tests: remove unused code in _test_auth_none_level_bind()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: process all provided presentation contexts
Stefan Metzmacher [Tue, 6 Oct 2015 08:18:06 +0000 (10:18 +0200)]
s4:rpc_server: process all provided presentation contexts

We should respond with an explicit result for each presentation context,
while we also accept one new context per BIND/ALTER_CONTEXT.

For now we still only support NDR32, but adding NDR64 should
be fairly easy now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: it's not a protocol error to do an alter context with an unknown trans...
Stefan Metzmacher [Tue, 30 Aug 2016 12:35:34 +0000 (14:35 +0200)]
s4:rpc_server: it's not a protocol error to do an alter context with an unknown transfer syntax

Windows 2012R2 only returns a protocol error if the client wants to change
between supported transfer syntaxes, e.g. from NDR32 to NDR64.

If the proposed transfer syntax is not known to the server,
the request will be silently ignored.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: split out a dcesrv_check_or_create_context() function
Stefan Metzmacher [Sun, 28 Jun 2015 11:15:33 +0000 (13:15 +0200)]
s4:rpc_server: split out a dcesrv_check_or_create_context() function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: use call->conn instead of call->context->conn
Stefan Metzmacher [Tue, 16 Aug 2016 04:40:21 +0000 (06:40 +0200)]
s4:rpc_server: use call->conn instead of call->context->conn

It's the same, but call->context might be NULL in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: move dcesrv_alter_resp
Stefan Metzmacher [Tue, 16 Aug 2016 04:33:41 +0000 (06:33 +0200)]
s4:rpc_server: move dcesrv_alter_resp

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: add DCERPC_AUTH_LEVEL_PACKET support
Stefan Metzmacher [Wed, 31 Aug 2016 19:43:14 +0000 (21:43 +0200)]
s4:rpc_server: add DCERPC_AUTH_LEVEL_PACKET support

This is basically an alias for DCERPC_AUTH_LEVEL_INTEGRITY
in the context of connection oriented DCERPC.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: check the auth_pad_length overflow before calling gensec_[check,unseal...
Stefan Metzmacher [Thu, 1 Sep 2016 08:35:13 +0000 (10:35 +0200)]
s4:rpc_server: check the auth_pad_length overflow before calling gensec_[check,unseal]_packet()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: let dcesrv_auth_request() set a fault_code
Stefan Metzmacher [Thu, 1 Sep 2016 08:31:04 +0000 (10:31 +0200)]
s4:rpc_server: let dcesrv_auth_request() set a fault_code

gensec_check_packet() and gensec_unseal_packet() failures
should generate DCERPC_FAULT_SEC_PKG_ERROR.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: set the full DCERPC_BIND_NAK_REASON_* in dcesrv_bind()
Stefan Metzmacher [Wed, 31 Aug 2016 19:39:25 +0000 (21:39 +0200)]
s4:rpc_server: set the full DCERPC_BIND_NAK_REASON_* in dcesrv_bind()

This is required in order to support DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE
vs. DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: set DCERPC_PFC_FLAG_DID_NOT_EXECUTE for DCERPC_FAULT_OP_RNG_ERROR
Stefan Metzmacher [Mon, 29 Aug 2016 16:37:00 +0000 (18:37 +0200)]
s4:rpc_server: set DCERPC_PFC_FLAG_DID_NOT_EXECUTE for DCERPC_FAULT_OP_RNG_ERROR

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: a fault with UNKNOWN_IF should have DID_NOT_EXECUTE set
Stefan Metzmacher [Thu, 18 Aug 2016 12:17:58 +0000 (14:17 +0200)]
s4:rpc_server: a fault with UNKNOWN_IF should have DID_NOT_EXECUTE set

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: implement bind_time_feature negotiation
Stefan Metzmacher [Tue, 6 Oct 2015 10:25:53 +0000 (12:25 +0200)]
s4:librpc/rpc: implement bind_time_feature negotiation

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: force printing in dcerpc_bh_do_ndr_print() log level >= 11
Stefan Metzmacher [Tue, 17 Feb 2015 07:38:36 +0000 (08:38 +0100)]
s4:librpc/rpc: force printing in dcerpc_bh_do_ndr_print() log level >= 11

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: make use of dcerpc_pull_ncacn_packet()
Stefan Metzmacher [Wed, 28 Oct 2015 15:06:30 +0000 (16:06 +0100)]
s4:librpc/rpc: make use of dcerpc_pull_ncacn_packet()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>