metze/samba/wip.git
4 years agoTODO s4:librpc/rpc: prepare LIBNDR_FLAG_INCOMPLETE_BUFFER support...
Stefan Metzmacher [Sat, 31 Aug 2013 09:59:10 +0000 (11:59 +0200)]
TODO s4:librpc/rpc: prepare LIBNDR_FLAG_INCOMPLETE_BUFFER support...

4 years agolibrpc/rpc/binding_handle.c remember missing
Stefan Metzmacher [Sat, 21 Sep 2013 21:51:47 +0000 (23:51 +0200)]
librpc/rpc/binding_handle.c remember missing

4 years agolibrpc/rpc/binding_handle.c cleanup
Stefan Metzmacher [Sat, 21 Sep 2013 21:51:25 +0000 (23:51 +0200)]
librpc/rpc/binding_handle.c cleanup

4 years agolibrpc/rpc/binding_handle.c cleanups
Stefan Metzmacher [Sat, 21 Sep 2013 20:05:23 +0000 (22:05 +0200)]
librpc/rpc/binding_handle.c cleanups

4 years agolibrpc/rpc/binding_handle.c cleanups
Stefan Metzmacher [Sat, 21 Sep 2013 20:00:29 +0000 (22:00 +0200)]
librpc/rpc/binding_handle.c cleanups

4 years agoTODO cleanup incomplete_buffer librpc/rpc/binding_handle.c
Stefan Metzmacher [Sat, 21 Sep 2013 10:31:51 +0000 (12:31 +0200)]
TODO cleanup incomplete_buffer librpc/rpc/binding_handle.c

4 years agolibrpc/rpc/binding_handle.c unused vars
Stefan Metzmacher [Sat, 21 Sep 2013 10:31:32 +0000 (12:31 +0200)]
librpc/rpc/binding_handle.c unused vars

4 years agolibrpc/rpc/binding_handle.c
Stefan Metzmacher [Sat, 21 Sep 2013 08:19:14 +0000 (10:19 +0200)]
librpc/rpc/binding_handle.c

4 years agolibrpc/rpc/binding_handle.c disconnect pipe before error
Stefan Metzmacher [Sat, 21 Sep 2013 07:49:15 +0000 (09:49 +0200)]
librpc/rpc/binding_handle.c disconnect pipe before error

4 years agolibrpc/rpc/binding_handle.c ...
Stefan Metzmacher [Sat, 21 Sep 2013 07:25:32 +0000 (09:25 +0200)]
librpc/rpc/binding_handle.c ...

4 years agolibrpc/rpc/binding_handle.c...
Stefan Metzmacher [Sat, 21 Sep 2013 06:10:59 +0000 (08:10 +0200)]
librpc/rpc/binding_handle.c...

4 years agolibrpc/rpc/binding_handle.c cleanup incomplete
Stefan Metzmacher [Sat, 21 Sep 2013 00:59:51 +0000 (02:59 +0200)]
librpc/rpc/binding_handle.c cleanup incomplete

4 years agolibrpc/rpc/binding_handle.c deadlock...
Stefan Metzmacher [Sat, 21 Sep 2013 00:59:24 +0000 (02:59 +0200)]
librpc/rpc/binding_handle.c deadlock...

4 years agolibrpc/rpc/binding_handle.c dcerpc_binding_handle_call_params_done
Stefan Metzmacher [Sat, 21 Sep 2013 00:30:03 +0000 (02:30 +0200)]
librpc/rpc/binding_handle.c dcerpc_binding_handle_call_params_done

4 years agolibrpc/rpc/binding_handle.c sq dcerpc_binding_handle_call_params_in_done
Stefan Metzmacher [Fri, 20 Sep 2013 21:11:48 +0000 (23:11 +0200)]
librpc/rpc/binding_handle.c sq dcerpc_binding_handle_call_params_in_done

4 years agosq librpc/rpc/binding_handle.c PIPE support
Stefan Metzmacher [Fri, 20 Sep 2013 17:23:00 +0000 (19:23 +0200)]
sq librpc/rpc/binding_handle.c PIPE support

4 years agoTODO librpc/rpc: add DCERPC pipe support to dcerpc_binding_handle_call_params_send...
Stefan Metzmacher [Sat, 31 Aug 2013 08:16:11 +0000 (10:16 +0200)]
TODO librpc/rpc: add DCERPC pipe support to dcerpc_binding_handle_call_params_send/recv()

4 years agolibrpc/rpc: add dcerpc_binding_handle_raw_call_in_*
Stefan Metzmacher [Fri, 30 Aug 2013 09:56:18 +0000 (11:56 +0200)]
librpc/rpc: add dcerpc_binding_handle_raw_call_in_*

The binding handle backend can support LIBNDR_FLAG_INCOMPLETE_BUFFER
with this change and implement the raw_call_in_send/recv functions
to get more data from the caller. The final chunk clears the
LIBNDR_FLAG_INCOMPLETE_BUFFER flag in the in_flags of raw_call_in_send().

If LIBNDR_FLAG_INCOMPLETE_BUFFER was indicated in the in_flags of raw_call_send()
the backend can deliver partial results to the caller,
in raw_call_recv() by specifying LIBNDR_FLAG_INCOMPLETE_BUFFER in the out_flags.
In that case the caller should not call TALLOC_FREE(subreq)
as there's more to come. The backend continues to delivers results by
raw_call_recv() and clears LIBNDR_FLAG_INCOMPLETE_BUFFER on the last chunk.

This will be used to implement support for DCERPC pipes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agolibrpc/rpc: add dcerpc_binding_handle_call_params*
Stefan Metzmacher [Fri, 1 Oct 2010 06:54:54 +0000 (08:54 +0200)]
librpc/rpc: add dcerpc_binding_handle_call_params*

This function will allow to add dcerpc pipes support later.

metze

4 years agolibrpc/rpc/pipe_handle.c
Stefan Metzmacher [Sat, 21 Sep 2013 08:18:31 +0000 (10:18 +0200)]
librpc/rpc/pipe_handle.c

4 years agolibrpc/rpc/pipe_handle.c
Stefan Metzmacher [Sat, 21 Sep 2013 07:48:59 +0000 (09:48 +0200)]
librpc/rpc/pipe_handle.c

4 years agolibrpc/rpc/pipe_handle.c
Stefan Metzmacher [Sat, 21 Sep 2013 06:11:22 +0000 (08:11 +0200)]
librpc/rpc/pipe_handle.c

4 years agolibrpc/rpc: add dcerpc_pipe_handle* infrastructure
Stefan Metzmacher [Sat, 2 Oct 2010 03:54:21 +0000 (05:54 +0200)]
librpc/rpc: add dcerpc_pipe_handle* infrastructure

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agolibrpc/rpc: make the dcerpc_binding_handle_raw_call_send/recv() wrapper more thin
Stefan Metzmacher [Fri, 30 Aug 2013 09:56:18 +0000 (11:56 +0200)]
librpc/rpc: make the dcerpc_binding_handle_raw_call_send/recv() wrapper more thin

The allows better passthrough to the ops->raw_call_send/recv functions.

The important change is that the ops->raw_call_recv() function is deferred to
the dcerpc_binding_handle_raw_call_recv() function, which means
that 'req' and 'subreq' have the same lifetime.
This will be important in the following commits, which will add
dcerpc_binding_handle_raw_call_in_send/recv and LIBNDR_FLAG_INCOMPLETE_BUFFER
support for DCERPC pipes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agoRevert "debug"
Stefan Metzmacher [Mon, 20 Oct 2014 06:54:10 +0000 (08:54 +0200)]
Revert "debug"

This reverts commit 2dfd75cdbeb2ec0f69a8e3c54564e1adecc64567.

4 years agodebug
Stefan Metzmacher [Fri, 17 Oct 2014 11:50:28 +0000 (13:50 +0200)]
debug

4 years agoRevert "source4/torture/smb2/durable_open.c" master4-dcerpc
Stefan Metzmacher [Mon, 14 Apr 2014 20:55:35 +0000 (22:55 +0200)]
Revert "source4/torture/smb2/durable_open.c"

This reverts commit 3f42beed778b2523f9be88834d510095482acecb.

4 years agosource4/torture/smb2/durable_open.c
Stefan Metzmacher [Mon, 14 Apr 2014 20:32:30 +0000 (22:32 +0200)]
source4/torture/smb2/durable_open.c

4 years agoRevert "librpc/rpc: reset the assoc_group_id when setting the binding endpoint"
Stefan Metzmacher [Tue, 18 Mar 2014 12:23:58 +0000 (13:23 +0100)]
Revert "librpc/rpc: reset the assoc_group_id when setting the binding endpoint"

This reverts commit 6b96669dfed2e18a2c07e83559e3965c2777330b.

4 years agolibrpc/rpc: reset the assoc_group_id when setting the binding endpoint
Stefan Metzmacher [Tue, 18 Mar 2014 06:05:36 +0000 (07:05 +0100)]
librpc/rpc: reset the assoc_group_id when setting the binding endpoint

The assoc_group_id is transport/endpoint specific.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agoRevert "TODO timeout? libcli/smb: avoid sync close requests in tstream_smbXcli_np_des...
Stefan Metzmacher [Mon, 18 Apr 2016 00:11:05 +0000 (02:11 +0200)]
Revert "TODO timeout? libcli/smb: avoid sync close requests in tstream_smbXcli_np_destructor"

This reverts commit 1fa97ac96729f8bc5e4bdcaf20e6658d7d521515.

4 years agoRevert "s4:librpc/rpc: remove dcerpc_shutdown_pipe() layer"
Stefan Metzmacher [Tue, 18 Mar 2014 05:50:50 +0000 (06:50 +0100)]
Revert "s4:librpc/rpc: remove dcerpc_shutdown_pipe() layer"

This reverts commit f9dfae142d580c288951c41eccbe481c326c7ca1.

4 years agos4:librpc/rpc: remove dcerpc_shutdown_pipe() layer
Stefan Metzmacher [Sun, 16 Mar 2014 20:54:55 +0000 (21:54 +0100)]
s4:librpc/rpc: remove dcerpc_shutdown_pipe() layer

This is only called from dcerpc_connection_dead()
mostly via dcerpc_connection_destructor().

Calling tstream_disconnect_send(), triggers a smb*cli_close_send(),
but we implicitly call talloc_free() on the returned 'req',
before it's send into the low-level tcp socket, which means
the SMB signing gets out of sync. For now we just rely on
the tstream destructor to close the smb open.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agoTODO timeout? libcli/smb: avoid sync close requests in tstream_smbXcli_np_destructor
Stefan Metzmacher [Sun, 16 Mar 2014 10:50:39 +0000 (11:50 +0100)]
TODO timeout? libcli/smb: avoid sync close requests in tstream_smbXcli_np_destructor

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agoRevert "debug"
Stefan Metzmacher [Sun, 11 Sep 2016 20:30:55 +0000 (22:30 +0200)]
Revert "debug"

This reverts commit cd2183082846af788a3fb55a5f4d9bb8f901160d.

4 years agodebug
Stefan Metzmacher [Fri, 24 Jan 2014 13:14:47 +0000 (14:14 +0100)]
debug

4 years agoRevert "TODO PANIC/NONE sq s4:librpc/rpc: make use of dcerpc_binding_get_string_optio...
Stefan Metzmacher [Wed, 12 Feb 2014 11:58:25 +0000 (12:58 +0100)]
Revert "TODO PANIC/NONE sq s4:librpc/rpc: make use of dcerpc_binding_get_string_option("endpoint")"

This reverts commit ac3cc2a59e8d1cc9a9399fc5921031af2e44eb72.

4 years agoTODO PANIC/NONE sq s4:librpc/rpc: make use of dcerpc_binding_get_string_option("endpo...
Stefan Metzmacher [Wed, 12 Feb 2014 09:54:42 +0000 (10:54 +0100)]
TODO PANIC/NONE sq s4:librpc/rpc: make use of dcerpc_binding_get_string_option("endpoint")

4 years agoRevert "debug"
Stefan Metzmacher [Mon, 20 Oct 2014 06:54:10 +0000 (08:54 +0200)]
Revert "debug"

This reverts commit 2dfd75cdbeb2ec0f69a8e3c54564e1adecc64567.

4 years agodebug
Stefan Metzmacher [Fri, 17 Oct 2014 11:50:28 +0000 (13:50 +0200)]
debug

4 years agos->pipe->binding = talloc_move(s->pipe, &s->binding);
Stefan Metzmacher [Sat, 18 Oct 2014 08:26:53 +0000 (10:26 +0200)]
s->pipe->binding = talloc_move(s->pipe, &s->binding);

4 years agos->pipe->binding = dcerpc_binding_dup(s->pipe, s->binding);
Stefan Metzmacher [Fri, 17 Oct 2014 11:20:26 +0000 (13:20 +0200)]
s->pipe->binding = dcerpc_binding_dup(s->pipe, s->binding);

4 years agoRevert "s->pipe->binding = dcerpc_binding_dup(s->pipe, s->binding);"
Stefan Metzmacher [Fri, 17 Oct 2014 11:22:49 +0000 (13:22 +0200)]
Revert "s->pipe->binding = dcerpc_binding_dup(s->pipe, s->binding);"

This reverts commit 5bc42fe2122cbd2adbef69df9c11c97f8c0984f4.

4 years agos->pipe->binding = dcerpc_binding_dup(s->pipe, s->binding);
Stefan Metzmacher [Fri, 17 Oct 2014 11:20:26 +0000 (13:20 +0200)]
s->pipe->binding = dcerpc_binding_dup(s->pipe, s->binding);

4 years agosq dcerpc_binding_string_ex
Stefan Metzmacher [Sat, 18 Oct 2014 08:53:42 +0000 (10:53 +0200)]
sq dcerpc_binding_string_ex

4 years agosq TODO _dcerpc_binding_set_pointer_option
Stefan Metzmacher [Sat, 18 Oct 2014 08:23:30 +0000 (10:23 +0200)]
sq TODO _dcerpc_binding_set_pointer_option

4 years agoTODO _dcerpc_binding_set_pointer_option
Stefan Metzmacher [Fri, 17 Oct 2014 11:11:32 +0000 (13:11 +0200)]
TODO _dcerpc_binding_set_pointer_option

4 years agoRevert "TODO _dcerpc_binding_set_pointer_option"
Stefan Metzmacher [Fri, 17 Oct 2014 11:23:37 +0000 (13:23 +0200)]
Revert "TODO _dcerpc_binding_set_pointer_option"

This reverts commit 628f6a8b0cfdfac9a2cefde78e080e3852b735b9.

4 years agoTODO _dcerpc_binding_set_pointer_option
Stefan Metzmacher [Fri, 17 Oct 2014 11:11:32 +0000 (13:11 +0200)]
TODO _dcerpc_binding_set_pointer_option

4 years agoOK - HACK smb_panic invalid options
Stefan Metzmacher [Fri, 24 Jan 2014 06:32:48 +0000 (07:32 +0100)]
OK - HACK smb_panic invalid options

OK as f61ebcb19c05cae3308b7b088958c7c985329284

4 years agos4:librpc/rpc: remove unused dcerpc_secondary_smb_send/recv()
Stefan Metzmacher [Wed, 12 Mar 2014 07:29:00 +0000 (08:29 +0100)]
s4:librpc/rpc: remove unused dcerpc_secondary_smb_send/recv()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agos4:librpc/rpc: remove unused dcerpc_pipe_open_smb[2]()
Stefan Metzmacher [Fri, 17 Jan 2014 08:10:03 +0000 (09:10 +0100)]
s4:librpc/rpc: remove unused dcerpc_pipe_open_smb[2]()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agos4:librpc/rpc: remove unused dcerpc_bind_auth_none()
Stefan Metzmacher [Fri, 17 Jan 2014 12:18:42 +0000 (13:18 +0100)]
s4:librpc/rpc: remove unused dcerpc_bind_auth_none()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agos4:librpc/rpc: remove unused dcerpc_bind_auth()
Stefan Metzmacher [Fri, 17 Jan 2014 13:13:05 +0000 (14:13 +0100)]
s4:librpc/rpc: remove unused dcerpc_bind_auth()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agosq dcerpc_binding_set_smbXcli_pointers s4:torture/samba3rpc: split out pipe_bind_smbX...
Stefan Metzmacher [Mon, 6 Oct 2014 08:24:57 +0000 (10:24 +0200)]
sq dcerpc_binding_set_smbXcli_pointers s4:torture/samba3rpc: split out pipe_bind_smbXcli() and go via dcerpc_pipe_connect_b()

4 years agos4:torture/samba3rpc: split out pipe_bind_smbXcli() and go via dcerpc_pipe_connect_b()
Stefan Metzmacher [Thu, 16 Jan 2014 07:21:39 +0000 (08:21 +0100)]
s4:torture/samba3rpc: split out pipe_bind_smbXcli() and go via dcerpc_pipe_connect_b()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agosq dcerpc_binding_set_smbXcli_pointers s4:libcli/clilsa: make use of dcerpc_pipe_conn...
Stefan Metzmacher [Mon, 6 Oct 2014 08:17:28 +0000 (10:17 +0200)]
sq dcerpc_binding_set_smbXcli_pointers s4:libcli/clilsa: make use of dcerpc_pipe_connect_b()

4 years agos4:libcli/clilsa: make use of dcerpc_pipe_connect_b()
Stefan Metzmacher [Thu, 16 Jan 2014 07:59:30 +0000 (08:59 +0100)]
s4:libcli/clilsa: make use of dcerpc_pipe_connect_b()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agoRevert "debug..."
Stefan Metzmacher [Tue, 7 Oct 2014 09:07:05 +0000 (11:07 +0200)]
Revert "debug..."

This reverts commit 97b69b94e3e4e5426ce9c4765ffdf4ff05bd6169.

4 years agodebug...
Stefan Metzmacher [Tue, 7 Oct 2014 09:06:58 +0000 (11:06 +0200)]
debug...

4 years agoHACK fix...
Stefan Metzmacher [Tue, 7 Oct 2014 09:06:42 +0000 (11:06 +0200)]
HACK fix...

4 years agosq dcerpc_binding_set_smbXcli_pointers s4:librpc/rpc: avoid using dcerpc_secondary_sm...
Stefan Metzmacher [Tue, 11 Mar 2014 11:37:40 +0000 (12:37 +0100)]
sq dcerpc_binding_set_smbXcli_pointers s4:librpc/rpc: avoid using dcerpc_secondary_smb_send/recv

4 years agos4:librpc/rpc: avoid using dcerpc_secondary_smb_send/recv
Stefan Metzmacher [Tue, 11 Mar 2014 11:37:40 +0000 (12:37 +0100)]
s4:librpc/rpc: avoid using dcerpc_secondary_smb_send/recv

We can now just use dcerpc_pipe_open_smb_send/recv and get
smbXcli_{conn,session,tcon} from the dcerpc_binding of the primary connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agosq dcerpc_binding_get_smbXcli_pointers s4:librpc/rpc: try to get the smbXcli_* pointe...
Stefan Metzmacher [Thu, 2 Oct 2014 08:38:55 +0000 (10:38 +0200)]
sq dcerpc_binding_get_smbXcli_pointers s4:librpc/rpc: try to get the smbXcli_* pointers from the given dcerpc_binding options

4 years agos4:librpc/rpc: try to get the smbXcli_* pointers from the given dcerpc_binding options
Stefan Metzmacher [Wed, 15 Jan 2014 15:05:26 +0000 (16:05 +0100)]
s4:librpc/rpc: try to get the smbXcli_* pointers from the given dcerpc_binding options

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agosq dcerpc_binding_set_smbXcli_pointers s4:librpc/rpc: remember smbXcli_{conn,session...
Stefan Metzmacher [Thu, 25 Sep 2014 22:06:49 +0000 (00:06 +0200)]
sq dcerpc_binding_set_smbXcli_pointers s4:librpc/rpc: remember smbXcli_{conn,session,tcon} on new ncacn_np connection

4 years agos4:librpc/rpc: remember smbXcli_{conn,session,tcon} on new ncacn_np connection
Stefan Metzmacher [Thu, 16 Jan 2014 10:52:10 +0000 (11:52 +0100)]
s4:librpc/rpc: remember smbXcli_{conn,session,tcon} on new ncacn_np connection

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agodcerpc_binding_set_smbXcli_pointers
Stefan Metzmacher [Mon, 22 Sep 2014 14:41:51 +0000 (16:41 +0200)]
dcerpc_binding_set_smbXcli_pointers

4 years agoRevert "TODO pointer options..."
Stefan Metzmacher [Mon, 22 Sep 2014 14:42:34 +0000 (16:42 +0200)]
Revert "TODO pointer options..."

This reverts commit 2113b0721b70e3cc7d2fb5591ed8898d06fbef96.

4 years agoTODO pointer options...
Stefan Metzmacher [Mon, 22 Sep 2014 14:42:25 +0000 (16:42 +0200)]
TODO pointer options...

4 years agolibrpc/rpc: add dcerpc_binding_set_pointer_option()
Stefan Metzmacher [Thu, 16 Jan 2014 10:10:46 +0000 (11:10 +0100)]
librpc/rpc: add dcerpc_binding_set_pointer_option()

This allows the caller to set a talloc pointer
as [<name>:pointer:<pid>:<type>=<address>]
(e.g. [connection:pointer:12345:struct smbXcli_conn=0xf0123456789abcde])
option of a dcerpc_binding.

Callers have to be careful to keep the pointer valid!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agolibrpc/rpc: add dcerpc_binding_get_pointer_option()
Stefan Metzmacher [Wed, 15 Jan 2014 14:17:33 +0000 (15:17 +0100)]
librpc/rpc: add dcerpc_binding_get_pointer_option()

This allows the caller to get a talloc pointer
out of a [<name>:pointer:<pid>:<type>=<address>]
(e.g. [connection:pointer:12345:struct smbXcli_conn=0xf0123456789abcde])
option of a dcerpc_binding.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agoRevert "source3/rpc_server/rpc_ncacn_np.c: tmp_mem"
Stefan Metzmacher [Mon, 20 Oct 2014 06:40:02 +0000 (08:40 +0200)]
Revert "source3/rpc_server/rpc_ncacn_np.c: tmp_mem"

This reverts commit 1a399c4d3270a4651ff5ae35237c5c12d89fe751.

4 years agosource3/rpc_server/rpc_ncacn_np.c: tmp_mem
Stefan Metzmacher [Thu, 25 Sep 2014 19:51:05 +0000 (21:51 +0200)]
source3/rpc_server/rpc_ncacn_np.c: tmp_mem

4 years agotest_no_auth_bind_time*...
Stefan Metzmacher [Fri, 23 Oct 2015 13:39:34 +0000 (15:39 +0200)]
test_no_auth_bind_time*...

4 years agoTODO: debug subtree_delete
Stefan Metzmacher [Tue, 16 Aug 2016 04:34:08 +0000 (06:34 +0200)]
TODO: debug subtree_delete

4 years agos3-smbcontrol: Replace && with || to declare variables in do_sleep() master4-dcerpc-base master4-dcerpc-ok
Anoop C S [Wed, 29 May 2019 06:10:55 +0000 (11:40 +0530)]
s3-smbcontrol: Replace && with || to declare variables in do_sleep()

--enable-developer internally use --enable-selftest alongside. But when
configured only with --enable-selftest the following code block becomes
invalid:

 #if defined(DEVELOPER) && defined(ENABLE_SELFTEST)
        unsigned int seconds;
        long input;
        const long MAX_SLEEP = 60 * 60; /* One hour maximum sleep */
 #endif

making those variables undeclared for further use. Therefore replace &&
with || to have those variables declared with --enable-selftest
configure option.

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri May 31 20:38:09 UTC 2019 on sn-devel-184

4 years ago.gitlab-ci.yml: avoid using != to compare variables to support old versions
Joe Guo [Wed, 29 May 2019 03:35:08 +0000 (15:35 +1200)]
.gitlab-ci.yml: avoid using != to compare variables to support old versions

`!=` was only introduced after 11.11, according to doc at:

https://docs.gitlab.com/ee/ci/variables/README.html#environment-variables-expressions

For private gitlab instance, the version may not be new enough.
Use `==` to make it backward compatible.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri May 31 09:48:37 UTC 2019 on sn-devel-184

4 years agoselftest: Don't use global dirs when parsing customdc realm
Tim Beale [Thu, 30 May 2019 02:55:52 +0000 (14:55 +1200)]
selftest: Don't use global dirs when parsing customdc realm

When creating the customdc, testparm would default to using
/usr/local/samba sub-directories for creating sockets and lock files.
Instead, pass in the tmpdir we just created as an option to the command.

Normally this didn't cause a noticeable problem, however, if we run the
command with UID-wrapper but without socket-wrapper (i.e.
USE_NAMESPACES=1), then it fails completely.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri May 31 06:34:36 UTC 2019 on sn-devel-184

4 years agoselftest: Add check customdc has valid realm/domain
Tim Beale [Thu, 30 May 2019 02:46:35 +0000 (14:46 +1200)]
selftest: Add check customdc has valid realm/domain

If we couldn't determine the realm/domain from the backup file, it's a
lot nicer to fail early with a clear error message (rather than failing
later on with a really obscure message).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoprovision: Fallback to assumption root-UID==zero
Tim Beale [Tue, 2 Oct 2018 19:56:45 +0000 (08:56 +1300)]
provision: Fallback to assumption root-UID==zero

Which is not a terrible assumption to make. The super-user on linux will
always have UID of zero, however, the super-user will not necessarily be
called "root".

This makes the provision/join commands work better when run in a
container. (And while deploying Samba in a container is perhaps not the
smartest move, this gives us some versatility when testing Samba).

This is needed to get the provision commands working in the domain_backup
tests when run with USE_NAMESPACES=1.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: Add more notes on using selftest with namespaces
Tim Beale [Thu, 30 May 2019 23:23:49 +0000 (11:23 +1200)]
selftest: Add more notes on using selftest with namespaces

In particular, document how to hook up a testenv to a Windows VM
(ideally there should be a helper script to do this, but in the
meantime some instructions are better than nothing).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: Add helper scripts for accessing the testenv namespace
Tim Beale [Thu, 28 Mar 2019 04:40:46 +0000 (17:40 +1300)]
selftest: Add helper scripts for accessing the testenv namespace

This patch adds some helper scripts that make talking to a given
testenv's namespace slightly easier.

One of the really cool things about namespaces is you can run multiple
different programs that can all talk to the testenv DC. However, the
command to do this is a bit unweildly, it's based on PID so it changes
everytime you start up a testenv, and you loose all the environment
variables that selftest normally sets up.

This patch adds a couple of helper scripts:
- nsenter-helper.sh: this takes the variables defined in an exports_file
  and exports them all. It prints some basic help and then starts a new
  shell session (this whole script gets run in the new namespace).
  Essentially this achieves something similar to the legacy
  selftest-vars.sh script (except this one actually works).
- mk_nsenter.sh: this generates a simple wrapper script that'll run
  nsenter and then call nsenter-helper.sh. A separate wrapper script
  gets created for each testenv. E.g. to run it, just go:
    ./st/ad_dc/nsenter.sh

  This is a wrapper for a more complicated command underneath like:
    nsenter -t 437353 --net --user --preserve-credentials \
      /home/timbeale/code/samba/selftest/ns/nsenter-helper.sh \
      /home/timbeale/code/samba/st/ad_dc/exports.sh

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: Add linux namespace support (USE_NAMESPACES=1)
Tim Beale [Thu, 23 May 2019 05:44:37 +0000 (17:44 +1200)]
selftest: Add linux namespace support (USE_NAMESPACES=1)

This hooks up the selftest/ns/* scripts added earlier with the selftest
system, so developers can optionally run a testenv or test using linux
namespaces instead of socket-wrapper.

The idea is this is experimental functionality that we can extend
further in future, in order to make testing Samba more versatile.

+ The top-level WAF script now does an 'unshare' to create a new
top-level 'selftest' namespace in which to create the testenv(s).
+ selftest.pl creates a common 'selftest0' bridge to connect together
the individual DCs.
+ Update Samba.pm so it can use real IPs instead of loopback addresses.
In fork_and_exec(), we add a couple of hooks so that the binary gets
started in a different namespace (using unshare/start_in_ns.sh), and
the parent process connects the new child namespace up to the common
selftest0 bridge (using add_bridge_iface.sh).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: Add TESTENV_DIR "env" variable
Tim Beale [Thu, 14 Mar 2019 04:38:22 +0000 (17:38 +1300)]
selftest: Add TESTENV_DIR "env" variable

We store the testenv directory path for the 'ctx' hashmap, but not for
the testenv-vars hashmap (and that can be really annoying sometimes).
Add it into the second hashmap that selftest actually keeps track of.
Currently it's only stored in the hashmap, not actually exported as an
environment variable (but we could easily do that if a test-case need
this info).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: Add helper scripts to run selftest in namespaces
Tim Beale [Tue, 26 Feb 2019 02:54:34 +0000 (15:54 +1300)]
selftest: Add helper scripts to run selftest in namespaces

This adds the underlying scripts, but they are not actually hooked up to
the selftest code yet, and so are not actually used.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: Allow for wider range of terminals (besides xterm)
Tim Beale [Fri, 31 May 2019 00:33:59 +0000 (12:33 +1200)]
selftest: Allow for wider range of terminals (besides xterm)

Allow developers to override the default @term_args, as well as the
terminal itself.

Currently, due to the nature of the args we pass to xterm (i.e. 'echo -e
"blah.." && bash'), it doesn't make it very flexible for use with other
terminals. By dropping these additional @term_args, it makes it much
easier to slot in an alternative terminal.

For example, these commands now work (more or less).

TERMINAL="terminator" TERMINAL_ARGS="-x bash" \
 SELFTEST_TESTENV=ad_dc make testenv

TERMINAL="bash" TERMINAL_ARGS="" \
 SELFTEST_TESTENV=nt4_dc make testenv

TERMINAL="bash" TERMINAL_ARGS="--norc" \
 SELFTEST_TESTENV=none make testenv

bash is usable, but a little weird because its output is still being
piped. Also bash with ad_dc is a little weird because we're using tee
for the DC's stdout. (I'd also recommend --norc, as it makes it easier
to differentiate between the testenv shell).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agovfs_fruit: remove a now unnecessary include
Ralph Boehme [Fri, 24 May 2019 13:15:59 +0000 (15:15 +0200)]
vfs_fruit: remove a now unnecessary include

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 30 22:12:50 UTC 2019 on sn-devel-184

4 years agovfs_fruit: use VFS functions in ad_read_rsrc_adouble()
Ralph Boehme [Fri, 24 May 2019 12:51:17 +0000 (14:51 +0200)]
vfs_fruit: use VFS functions in ad_read_rsrc_adouble()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: use fsp and remove syscalls from ad_convert_blank_rfork()
Ralph Boehme [Fri, 24 May 2019 10:51:15 +0000 (12:51 +0200)]
vfs_fruit: use fsp and remove syscalls from ad_convert_blank_rfork()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: use VFS function in ad_convert_truncate()
Ralph Boehme [Fri, 24 May 2019 10:07:55 +0000 (12:07 +0200)]
vfs_fruit: use VFS function in ad_convert_truncate()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: add VFS handle to ad_convert_truncate()
Ralph Boehme [Fri, 24 May 2019 10:05:51 +0000 (12:05 +0200)]
vfs_fruit: add VFS handle to ad_convert_truncate()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: use fsp and remove mmap in ad_convert_xattr()
Ralph Boehme [Fri, 24 May 2019 09:54:51 +0000 (11:54 +0200)]
vfs_fruit: use fsp and remove mmap in ad_convert_xattr()

No need to mmap() anyway, the xattr data is already available in ad->ad_data.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: remove use of mmap() from ad_convert_move_reso()
Ralph Boehme [Thu, 23 May 2019 20:44:21 +0000 (22:44 +0200)]
vfs_fruit: remove use of mmap() from ad_convert_move_reso()

We now have an fsp that we can use, so we can get rid of mmap() and
sys_pread()/sys_pwrite().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: convert ad_open_rsrc() to open a proper fsp with SMB_VFS_CREATE_FILE()
Ralph Boehme [Thu, 23 May 2019 14:42:52 +0000 (16:42 +0200)]
vfs_fruit: convert ad_open_rsrc() to open a proper fsp with SMB_VFS_CREATE_FILE()

A first step in converting all raw syscalls to use proper VFS functions. All
existing users of the raw system filedescriptor continue to use the fd from
fsp->fh for now.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: only do cross protocol locking on non-internal opens
Ralph Boehme [Thu, 23 May 2019 14:22:39 +0000 (16:22 +0200)]
vfs_fruit: only do cross protocol locking on non-internal opens

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: remove a layer of indirection
Ralph Boehme [Thu, 23 May 2019 06:27:37 +0000 (08:27 +0200)]
vfs_fruit: remove a layer of indirection

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: pass VFS handle to ad_convert_move_reso()
Ralph Boehme [Thu, 23 May 2019 06:14:18 +0000 (08:14 +0200)]
vfs_fruit: pass VFS handle to ad_convert_move_reso()

Not used for now, that comes next.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: remove xattr code from the AppleDouble subsystem
Ralph Boehme [Wed, 22 May 2019 19:15:22 +0000 (21:15 +0200)]
vfs_fruit: remove xattr code from the AppleDouble subsystem

The subsystem consumers have been reworked in the previous commits, so this is
not used anymore. ad_init() doesn't need a handle argument anymore due to this,
remove it as well.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: remove now unused AppleDouble code for resource fork in xattr
Ralph Boehme [Fri, 17 May 2019 12:31:15 +0000 (14:31 +0200)]
vfs_fruit: remove now unused AppleDouble code for resource fork in xattr

This was only needed to get the resourcefork size via the ad_* AppleDouble
function. This is now done with a fstat on the low level xattr fd (remember,
this is Solaris only code...), so we can remove the xattr special casing from
the AppleDouble functions.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>