samba.git
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>
7 years agolibrpc/rpc: make use of dcerpc_pull_ncacn_packet() in dcerpc_read_ncacn_packet_done()
Stefan Metzmacher [Wed, 28 Oct 2015 11:27:43 +0000 (12:27 +0100)]
librpc/rpc: make use of dcerpc_pull_ncacn_packet() in dcerpc_read_ncacn_packet_done()

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 agolibrpc/rpc: move dcerpc_pull_ncacn_packet() from source3/librpc/rpc/ to the toplevel
Stefan Metzmacher [Wed, 28 Oct 2015 11:23:00 +0000 (12:23 +0100)]
librpc/rpc: move dcerpc_pull_ncacn_packet() from source3/librpc/rpc/ to the toplevel

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:librpc: move NDR_PRINT_DEBUG() into the caller of dcerpc_pull_ncacn_packet()
Stefan Metzmacher [Wed, 28 Oct 2015 11:21:43 +0000 (12:21 +0100)]
s3:librpc: move NDR_PRINT_DEBUG() into the caller 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>
7 years agos3:librpc: remove bigendian argument from dcerpc_pull_ncacn_packet()
Stefan Metzmacher [Wed, 28 Oct 2015 11:16:05 +0000 (12:16 +0100)]
s3:librpc: remove bigendian argument from dcerpc_pull_ncacn_packet()

We should get this from the packet itself.

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 agodcerpc.idl: add DCERPC_FAULT_SERVER_UNAVAILABLE
Stefan Metzmacher [Tue, 27 Sep 2016 16:17:42 +0000 (18:17 +0200)]
dcerpc.idl: add DCERPC_FAULT_SERVER_UNAVAILABLE

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agodcerpc.idl: remove unused dcerpc_request._pad
Stefan Metzmacher [Tue, 6 Sep 2016 13:41:30 +0000 (15:41 +0200)]
dcerpc.idl: remove unused dcerpc_request._pad

typedef struct {
        uint32 alloc_hint;
        uint16 context_id;
        uint16 opnum;
        /*
         * NDR_DCERPC_REQUEST_OBJECT_PRESENT
         * is defined differently for ndr_dcerpc.c and py_dcerpc.c
         */
        [switch_is(NDR_DCERPC_REQUEST_OBJECT_PRESENT)] dcerpc_object object;
        [flag(NDR_REMAINING)] DATA_BLOB stub_and_verifier;
} dcerpc_request;

- the generic dcerpc header has a size of 16 bytes.

- alloc_hint, context_id and opnum are 8 bytes together.

- dcerpc_object is 0 or 16 bytes.

That means stub_and_verifier is always aligned to 8 bytes
(either at offset 24 or 40).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agodcerpc.idl: replace dcerpc_response._pad with a uint8 reserved
Stefan Metzmacher [Tue, 13 Oct 2015 14:00:40 +0000 (16:00 +0200)]
dcerpc.idl: replace dcerpc_response._pad with a uint8 reserved

typedef struct {
        uint32 alloc_hint;
        uint16 context_id;
        uint8 cancel_count;
        [value(0)] uint8 reserved;
        [flag(NDR_REMAINING)] DATA_BLOB stub_and_verifier;
} dcerpc_response;

- the generic dcerpc header has a size of 16 bytes

- alloc_hint, context_id, cancel_count and reserved are 8 bytes together

So stub_and_verifier is 8 byte aligned at offset 24.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:rpc_server: skip setting of dcerpc_request._pad
Stefan Metzmacher [Tue, 6 Sep 2016 13:38:14 +0000 (15:38 +0200)]
s4:rpc_server: skip setting of dcerpc_request._pad

This is marked as [flag(NDR_ALIGN8)] DATA_BLOB _pad;
and ndr_push_dcerpc_request() will just ignore the content
and align to 8 bytes with zero padding.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agodcerpc.idl: add dcerpc_fault_flags bitmap
Stefan Metzmacher [Tue, 20 Sep 2016 01:26:22 +0000 (03:26 +0200)]
dcerpc.idl: add dcerpc_fault_flags bitmap

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 agodcerpc.idl: split the padding from a possible fault buffer in dcerpc_fault
Stefan Metzmacher [Fri, 9 Oct 2015 04:51:16 +0000 (06:51 +0200)]
dcerpc.idl: split the padding from a possible fault buffer in dcerpc_fault

The 4 bytes of padding are always present and part of the header.

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 agodcerpc.idl: remove unused DCERPC_AUTH_LEVEL_DEFAULT
Stefan Metzmacher [Wed, 28 Oct 2015 15:11:22 +0000 (16:11 +0100)]
dcerpc.idl: remove unused DCERPC_AUTH_LEVEL_DEFAULT

Also the default should not be DCERPC_AUTH_LEVEL_CONNECT

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 agoauth/gensec: handle DCERPC_AUTH_LEVEL_PACKET similar to DCERPC_AUTH_LEVEL_INTEGRITY
Stefan Metzmacher [Wed, 31 Aug 2016 19:57:31 +0000 (21:57 +0200)]
auth/gensec: handle DCERPC_AUTH_LEVEL_PACKET similar to DCERPC_AUTH_LEVEL_INTEGRITY

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 agoauth/gensec: only require GENSEC_FEATURE_SIGN for DCERPC_AUTH_LEVEL_INTEGRITY as...
Stefan Metzmacher [Thu, 1 Sep 2016 09:00:54 +0000 (11:00 +0200)]
auth/gensec: only require GENSEC_FEATURE_SIGN for DCERPC_AUTH_LEVEL_INTEGRITY as client

On the server this check is deferred to the first request.

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 agoauth/gensec: always verify the wanted SIGN/SEAL flags
Stefan Metzmacher [Thu, 1 Sep 2016 08:54:17 +0000 (10:54 +0200)]
auth/gensec: always verify the wanted SIGN/SEAL flags

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:ldap_server: don't use gensec_want_feature(gensec_security, GENSEC_FEATURE_{SIGN...
Stefan Metzmacher [Thu, 1 Sep 2016 08:58:16 +0000 (10:58 +0200)]
s4:ldap_server: don't use gensec_want_feature(gensec_security, GENSEC_FEATURE_{SIGN,SEAL}) as server

They're always supported and using gensec_want_feature() on them would require
them 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 agos3:ntlm_auth: don't use gensec_want_feature(gensec_security, GENSEC_FEATURE_{SIGN...
Stefan Metzmacher [Thu, 1 Sep 2016 08:58:16 +0000 (10:58 +0200)]
s3:ntlm_auth: don't use gensec_want_feature(gensec_security, GENSEC_FEATURE_{SIGN,SEAL}) as server

They're always supported and using gensec_want_feature() on them would require
them 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 agoauth/ntlmssp: always allow NTLMSSP_NEGOTIATE_{SIGN,SEAL} in gensec_ntlmssp_server_start()
Stefan Metzmacher [Thu, 1 Sep 2016 08:56:57 +0000 (10:56 +0200)]
auth/ntlmssp: always allow NTLMSSP_NEGOTIATE_{SIGN,SEAL} in gensec_ntlmssp_server_start()

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:gse: pass gss_got_flags to gssapi_get_sig_size()
Stefan Metzmacher [Fri, 2 Sep 2016 06:20:37 +0000 (08:20 +0200)]
s3:gse: pass gss_got_flags to gssapi_get_sig_size()

We need to calculate the signature length based on the negotiated
flags. This is most important on the server side where,
gss_accept_sec_context() doesn't get gss_want_flags, but fills
gss_got_flags.

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:gensec_gssapi: pass gss_got_flags to gssapi_get_sig_size()
Stefan Metzmacher [Fri, 2 Sep 2016 06:20:37 +0000 (08:20 +0200)]
s4:gensec_gssapi: pass gss_got_flags to gssapi_get_sig_size()

We need to calculate the signature length based on the negotiated
flags. This is most important on the server side where,
gss_accept_sec_context() doesn't get gss_want_flags, but fills
gss_got_flags.

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:gensec_krb5: also report support for GENSEC_FEATURE_SIGN as krb5_mk_priv() provide...
Stefan Metzmacher [Mon, 5 Sep 2016 07:00:30 +0000 (09:00 +0200)]
s4:gensec_krb5: also report support for GENSEC_FEATURE_SIGN as krb5_mk_priv() provides sign and seal

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 agogensec/spnego: remember the wanted features also on the main gensec context
Stefan Metzmacher [Thu, 1 Sep 2016 08:52:34 +0000 (10:52 +0200)]
gensec/spnego: remember the wanted features also on the main gensec context

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 agolibcli/smb: handle a talloc_free() on an unsent smb1 request
Stefan Metzmacher [Thu, 15 Sep 2016 09:46:33 +0000 (11:46 +0200)]
libcli/smb: handle a talloc_free() on an unsent smb1 request

When a the higher level does a TALLOC_FREE() on an already
queued request, we need to check whether we already sent a byte,
if not we can try to unwind the smb1 signing sequence number,
if there was only one pending request, in all other cases
we need to disconnect the connection.

I noticed that when seeing during an smb1cli_close()
from tstream_smbXcli_np_destructor().

TODO: we may want to have a similar smbXcli_conn_cancel_read_req() in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolib/async_req: add writev_cancel()
Stefan Metzmacher [Thu, 15 Sep 2016 09:41:56 +0000 (11:41 +0200)]
lib/async_req: add writev_cancel()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: do not use stack allocated variables for async requests
Matthieu Patou [Wed, 25 Sep 2013 23:41:03 +0000 (16:41 -0700)]
s4:librpc/rpc: do not use stack allocated variables for async requests

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibsmb: fix leak in opendir error path
David Disseldorp [Tue, 25 Oct 2016 16:25:02 +0000 (18:25 +0200)]
libsmb: fix leak in opendir error path

Fixes CID 242325 - dir state and the talloc frame are leaked on
user_auth_info_init() failure.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct 26 00:58:41 CEST 2016 on sn-devel-144

7 years agowaf: Cleanup deps list for smbd
Andreas Schneider [Tue, 18 Oct 2016 17:06:13 +0000 (19:06 +0200)]
waf: Cleanup deps list for smbd

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
Autobuild-User(master): Jim McDonough <jmcd@samba.org>
Autobuild-Date(master): Tue Oct 25 21:10:37 CEST 2016 on sn-devel-144

7 years agowaf: Cleanup deps list for smbregistry
Andreas Schneider [Tue, 18 Oct 2016 14:05:07 +0000 (16:05 +0200)]
waf: Cleanup deps list for smbregistry

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
7 years agoRevert "ctdb-common: Use SCHED_RESET_ON_FORK when setting SCHED_FIFO"
Amitay Isaacs [Mon, 24 Oct 2016 07:24:54 +0000 (18:24 +1100)]
Revert "ctdb-common: Use SCHED_RESET_ON_FORK when setting SCHED_FIFO"

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

Feature SCHED_RESET_ON_FORK is completely broken on RHEL6 and RHEL7
distributions.  So do not rely on SCHED_RESET_ON_FORK for now.

This reverts commit 1be8564e553ce044426dbe7b3987edf514832940.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Oct 25 11:28:28 CEST 2016 on sn-devel-144

7 years agos3:smbd: only pass UCF_PREP_CREATEFILE to filename_convert() if we may create a new...
Stefan Metzmacher [Thu, 13 Oct 2016 10:42:59 +0000 (12:42 +0200)]
s3:smbd: only pass UCF_PREP_CREATEFILE to filename_convert() if we may create a new file

This fixes a regression introduced by commit
f98d10af2a05f0261611f4cabdfe274cd9fe91c0
(smbd: Always use UCF_PREP_CREATEFILE for filename_convert calls to resolve a path for open)

The main problem was that Windows client seem to verify
the access to user.V2\ntuser.ini is rejected with NT_STATUS_ACCESS_DENIED,
using the machine credentials.

Passing UCF_PREP_CREATEFILE to filename_convert() triggers a code path
that implements a dropbox behaviour. A dropbox is a directory with only -wx permissions,
so get_real_filename fails with EACCESS, it needs to list the directory.
EACCESS is ignored with UCF_PREP_CREATEFILE.

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

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): Tue Oct 25 05:33:36 CEST 2016 on sn-devel-144