]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
13 months agolib:talloc: Increase alloc size to 128 kilobytes
Andreas Schneider [Thu, 27 Apr 2023 09:24:59 +0000 (11:24 +0200)] 
lib:talloc: Increase alloc size to 128 kilobytes

We want to avoid that the optimizer will use stack allocations. This way
the test should be a bit more realistic.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
13 months agolib:talloc: Don't optimize the speed test
Andreas Schneider [Mon, 17 Apr 2023 07:25:48 +0000 (09:25 +0200)] 
lib:talloc: Don't optimize the speed test

If the speed test gets optimized, the malloc() and free() might be
replaced by stack allocations.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
13 months agolib:talloc: Add talloc_zero vs calloc test
Andreas Schneider [Fri, 14 Apr 2023 19:34:59 +0000 (21:34 +0200)] 
lib:talloc: Add talloc_zero vs calloc test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
13 months agolib:talloc: Use memset_s() to avoid the call gets optimized out
Andreas Schneider [Tue, 13 Feb 2024 08:22:56 +0000 (09:22 +0100)] 
lib:talloc: Use memset_s() to avoid the call gets optimized out

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
13 months agolib:talloc: Remove trailing spaces from testsuite.c
Andreas Schneider [Tue, 6 Feb 2024 17:03:22 +0000 (18:03 +0100)] 
lib:talloc: Remove trailing spaces from testsuite.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
13 months agolib:ldb: Document environment variables in ldb manpage
Andreas Schneider [Wed, 25 Sep 2024 07:22:08 +0000 (09:22 +0200)] 
lib:ldb: Document environment variables in ldb manpage

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

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): Fri Sep 27 09:06:43 UTC 2024 on atb-devel-224

13 months agolib:ldb: Remove trailing spaces from ldb.3.xml
Andreas Schneider [Wed, 25 Sep 2024 07:40:23 +0000 (09:40 +0200)] 
lib:ldb: Remove trailing spaces from ldb.3.xml

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 months agolib:ldb: Don't use RTLD_DEEPBIND by default
Andreas Schneider [Wed, 25 Sep 2024 07:19:44 +0000 (09:19 +0200)] 
lib:ldb: Don't use RTLD_DEEPBIND by default

It should be off by default, as this is not needed by default. It
crashes named on startup, if bind is built with jemalloc support.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 months agolib:ldb: Remove trailing spaces from ldb_modules.c
Andreas Schneider [Wed, 25 Sep 2024 07:19:17 +0000 (09:19 +0200)] 
lib:ldb: Remove trailing spaces from ldb_modules.c

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 months agos3:tests: Write stderr to file to be able to print it on failure
Andreas Schneider [Wed, 25 Sep 2024 05:59:04 +0000 (07:59 +0200)] 
s3:tests: Write stderr to file to be able to print it on failure

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
13 months agos3:tests: Track the status of smbcquotas and not tr
Andreas Schneider [Wed, 25 Sep 2024 05:50:15 +0000 (07:50 +0200)] 
s3:tests: Track the status of smbcquotas and not tr

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
13 months agos3:client: Improve error message on cli_setatr() failure
Andreas Schneider [Wed, 17 Jul 2024 08:38:47 +0000 (10:38 +0200)] 
s3:client: Improve error message on cli_setatr() failure

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep 27 07:54:34 UTC 2024 on atb-devel-224

13 months agopylibsmb: Fix a typo
Volker Lendecke [Tue, 24 Sep 2024 08:59:23 +0000 (10:59 +0200)] 
pylibsmb: Fix a typo

pylibsmb is supposed to be used only internally, at least I hope this
has not made it into an API that is perceived to be publically used.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Sep 26 16:35:55 UTC 2024 on atb-devel-224

13 months agoposix_ext: Pass unix file type through posix query_directory
Volker Lendecke [Tue, 24 Sep 2024 07:50:57 +0000 (09:50 +0200)] 
posix_ext: Pass unix file type through posix query_directory

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agotests: Check that we return the posix type in query_directory
Volker Lendecke [Mon, 23 Sep 2024 17:37:15 +0000 (19:37 +0200)] 
tests: Check that we return the posix type in query_directory

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agosmbd: Return file type in the posix create context response
Volker Lendecke [Mon, 23 Sep 2024 16:52:13 +0000 (18:52 +0200)] 
smbd: Return file type in the posix create context response

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agotests: Check that posix extensions return the file type
Volker Lendecke [Mon, 23 Sep 2024 16:23:43 +0000 (18:23 +0200)] 
tests: Check that posix extensions return the file type

We'll need to check more, but this is a start

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agoidl: Rename smb3_posix_cc_info.posix_perms to posix_mode
Volker Lendecke [Mon, 23 Sep 2024 11:55:30 +0000 (13:55 +0200)] 
idl: Rename smb3_posix_cc_info.posix_perms to posix_mode

We'll stash the file type in there soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agopylibsmb: Add unix_mode_to_wire and wire_mode_to_unix
Volker Lendecke [Sat, 21 Sep 2024 00:42:16 +0000 (02:42 +0200)] 
pylibsmb: Add unix_mode_to_wire and wire_mode_to_unix

Make the wire-representation of mode_t available for tests

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibsmb: Move UNIX constants to smb3posix.idl
Volker Lendecke [Fri, 20 Sep 2024 23:22:54 +0000 (01:22 +0200)] 
libsmb: Move UNIX constants to smb3posix.idl

Make them available to python

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agoidl: smb3posix.idl references NTTIME
Volker Lendecke [Fri, 20 Sep 2024 23:17:47 +0000 (01:17 +0200)] 
idl: smb3posix.idl references NTTIME

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibsmb: Define to transfer file types via smb3 unix extensions
Volker Lendecke [Fri, 20 Sep 2024 20:58:03 +0000 (22:58 +0200)] 
libsmb: Define to transfer file types via smb3 unix extensions

Ride on the definitions of the SMB1 extensions, send the UNIX type in the 3
bits above the permissions and extra (suid,sgid,sticky) bits

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agosmbd: Simplify unix_perms_from_wire()
Volker Lendecke [Fri, 20 Sep 2024 19:49:23 +0000 (21:49 +0200)] 
smbd: Simplify unix_perms_from_wire()

Remove enum perm_type: Only the _NEW_ defines were actually used, and
this made the logic harder for me to understand than necessary.

On the other hand, it forced you to think about what this is. Now you
could theoretically miss applying masks. Still, I like it better with
this patch.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agosmbd: Factor out create/directory mode/mask logic
Volker Lendecke [Fri, 20 Sep 2024 19:33:33 +0000 (21:33 +0200)] 
smbd: Factor out create/directory mode/mask logic

Don't write down that logic twice

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agosmbd: Slightly simplify unix_perms_from_wire()
Volker Lendecke [Fri, 20 Sep 2024 19:01:52 +0000 (21:01 +0200)] 
smbd: Slightly simplify unix_perms_from_wire()

Avoid an else-branch, we return before

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibsmb: Move unix_filetype_to_wire() to libcli/smb
Volker Lendecke [Fri, 20 Sep 2024 17:43:18 +0000 (19:43 +0200)] 
libsmb: Move unix_filetype_to_wire() to libcli/smb

Mostly symmetry reasons, we have the opposite function here as well

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibsmb: Rename and simplify unix_filetype_from_wire()
Volker Lendecke [Fri, 20 Sep 2024 17:36:25 +0000 (19:36 +0200)] 
libsmb: Rename and simplify unix_filetype_from_wire()

Align naming with the perms functions, use the fact that the unix
types are numbered the way they are

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibsmb: Remove duplicate prototypes
Volker Lendecke [Fri, 20 Sep 2024 17:21:08 +0000 (19:21 +0200)] 
libsmb: Remove duplicate prototypes

libcli/smb/smb_util.h also has these

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agosmbd: Return reparse tag in smb311 unix query dir
Volker Lendecke [Fri, 20 Sep 2024 17:16:17 +0000 (19:16 +0200)] 
smbd: Return reparse tag in smb311 unix query dir

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: let cli_rpc_pipe_open_schannel() use rpccli_connect_netlogon() for...
Stefan Metzmacher [Thu, 19 Sep 2024 05:41:09 +0000 (07:41 +0200)] 
s3:rpc_client: let cli_rpc_pipe_open_schannel() use rpccli_connect_netlogon() for netlogon

This way we could reuse the connection already created...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: pass remote_{name,sockaddr} to rpccli_connect_netlogon()
Stefan Metzmacher [Fri, 20 Sep 2024 08:03:11 +0000 (10:03 +0200)] 
s3:rpc_client: pass remote_{name,sockaddr} to rpccli_connect_netlogon()

Otherwise this can only work with NCACN_NP...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:libnet: make use of rpccli_connect_netlogon() instead of reimplement the logic
Stefan Metzmacher [Thu, 19 Sep 2024 05:33:40 +0000 (07:33 +0200)] 
s3:libnet: make use of rpccli_connect_netlogon() instead of reimplement the logic

We only need the logic to setup a full netlogon connection once...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: let rpccli_connect_netlogon() reuse the existing connection
Stefan Metzmacher [Thu, 19 Sep 2024 05:30:45 +0000 (07:30 +0200)] 
s3:rpc_client: let rpccli_connect_netlogon() reuse the existing connection

We either use security context multiplexing if negotiated and
just do an alter_context on the existing connection or
we create a new connection within the same association group.

This is basically what windows clients are doing...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: allow rpccli_setup_netlogon_creds_locked() to return netlogon_pipe
Stefan Metzmacher [Tue, 17 Sep 2024 03:35:01 +0000 (05:35 +0200)] 
s3:rpc_client: allow rpccli_setup_netlogon_creds_locked() to return netlogon_pipe

Let the caller decide if it wants to keep the netlogon connection...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: make rpccli_setup_netlogon_creds_locked() static
Stefan Metzmacher [Thu, 19 Sep 2024 04:46:29 +0000 (06:46 +0200)] 
s3:rpc_client: make rpccli_setup_netlogon_creds_locked() static

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: split out cli_rpc_pipe_client_auth_schannel()
Stefan Metzmacher [Tue, 17 Sep 2024 02:23:40 +0000 (04:23 +0200)] 
s3:rpc_client: split out cli_rpc_pipe_client_auth_schannel()

This will allow us to use it without creating a new
association group and transport connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: add cli_rpc_pipe_client_prepare_alter() helper
Stefan Metzmacher [Tue, 17 Sep 2024 03:54:05 +0000 (05:54 +0200)] 
s3:rpc_client: add cli_rpc_pipe_client_prepare_alter() helper

This will allow to do an alter context if security context multiplexing
is negotiated or opening a new connection in the same association group.

The old connection will be kept open, but not used anymore...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: make real use of rpc_client_{association,connection}
Stefan Metzmacher [Sun, 15 Sep 2024 16:26:07 +0000 (18:26 +0200)] 
s3:rpc_client: make real use of rpc_client_{association,connection}

This will allow NCACN_NP and NCACN_IP_TCP to support
alter_context with security context multiplexing
or otherwise more than one connection per association group.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: let cli_rpc_pipe_open() use rpc_client_connection_np()
Stefan Metzmacher [Mon, 16 Sep 2024 20:10:00 +0000 (22:10 +0200)] 
s3:rpc_client: let cli_rpc_pipe_open() use rpc_client_connection_np()

This way cli_rpc_pipe_open() uses the same flow for
rpc_client_connection_np() and rpc_pipe_open_tcp_port().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: convert rpc_pipe_open_np() to rpc_client_{association,connection}
Stefan Metzmacher [Mon, 16 Sep 2024 20:09:34 +0000 (22:09 +0200)] 
s3:rpc_client: convert rpc_pipe_open_np() to rpc_client_{association,connection}

This split out rpc_client_connection_np_send/recv, which will
be used as shortcut in a later commit.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: convert rpc_pipe_open_tcp_port() to rpc_client_{association,connection}
Stefan Metzmacher [Mon, 16 Sep 2024 20:04:49 +0000 (22:04 +0200)] 
s3:rpc_client: convert rpc_pipe_open_tcp_port() to rpc_client_{association,connection}

Note that cli_rpc_pipe_open() calls rpc_client_association_create()
without a need for NCACN_NP, but that will change in the next commits...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: convert rpc_pipe_open_local_np() to rpc_client_{association,connection}
Stefan Metzmacher [Mon, 16 Sep 2024 20:01:06 +0000 (22:01 +0200)] 
s3:rpc_client: convert rpc_pipe_open_local_np() to rpc_client_{association,connection}

For rpc_pipe_open_local_np() it's not really important to abstract
these out, but we want to have these for all...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: convert rpc_pipe_open_ncalrpc() to rpc_client_{association,connection}
Stefan Metzmacher [Mon, 16 Sep 2024 19:56:50 +0000 (21:56 +0200)] 
s3:rpc_client: convert rpc_pipe_open_ncalrpc() to rpc_client_{association,connection}

For rpc_pipe_open_ncalrpc() it's not really important to abstract these
out, but we want to have these for all...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: add struct rpc_client_{association,connection} and helpers
Stefan Metzmacher [Mon, 16 Sep 2024 19:56:50 +0000 (21:56 +0200)] 
s3:rpc_client: add struct rpc_client_{association,connection} and helpers

They will be every useful for NCACN_NP and NCACN_IP_TCP,
so that we can support alter_context or more than one connection
per association group.

We mark the helpers as _UNUSED_ for now in order to compile...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: only pass the pipe_name to rpc_transport_np_init_send()
Stefan Metzmacher [Thu, 19 Sep 2024 22:24:05 +0000 (00:24 +0200)] 
s3:rpc_client: only pass the pipe_name to rpc_transport_np_init_send()

There's no need to have the ndr_interface_table at that stage...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: make most of rpc_pipe_client internal struct members
Stefan Metzmacher [Thu, 19 Sep 2024 04:43:14 +0000 (06:43 +0200)] 
s3:rpc_client: make most of rpc_pipe_client internal struct members

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:librpc/rpc: split out dcerpc_internal.h for struct pipe_auth_data
Stefan Metzmacher [Thu, 19 Sep 2024 04:39:02 +0000 (06:39 +0200)] 
s3:librpc/rpc: split out dcerpc_internal.h for struct pipe_auth_data

This should be anonymous for callers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:libsmb: make use of dcerpc_binding_get_abstract_syntax()
Stefan Metzmacher [Thu, 19 Sep 2024 08:32:58 +0000 (10:32 +0200)] 
s3:libsmb: make use of dcerpc_binding_get_abstract_syntax()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:lib/netapi: make use of dcerpc_binding_get_abstract_syntax()
Stefan Metzmacher [Thu, 19 Sep 2024 07:39:44 +0000 (09:39 +0200)] 
s3:lib/netapi: make use of dcerpc_binding_get_abstract_syntax()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpcclient: make use of dcerpc_binding_handle_get_transport()
Stefan Metzmacher [Thu, 19 Sep 2024 07:20:03 +0000 (09:20 +0200)] 
s3:rpcclient: make use of dcerpc_binding_handle_get_transport()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:winbindd: make use of dcerpc_binding_handle_get_transport()
Stefan Metzmacher [Thu, 19 Sep 2024 07:13:03 +0000 (09:13 +0200)] 
s3:winbindd: make use of dcerpc_binding_handle_get_transport()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: remove references to rpc_pipe_client from wsp_cli.c
Stefan Metzmacher [Thu, 19 Sep 2024 07:12:10 +0000 (09:12 +0200)] 
s3:rpc_client: remove references to rpc_pipe_client from wsp_cli.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: remember rpc_pipe_client->print_username
Stefan Metzmacher [Thu, 19 Sep 2024 04:27:22 +0000 (06:27 +0200)] 
s3:rpc_client: remember rpc_pipe_client->print_username

This is ugly, but it's less ugly than doing it deep
inside of cli_spoolss.c and other code.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:librpc: make all but dcerpc_pipe->binding_handle internal struct members
Stefan Metzmacher [Wed, 18 Sep 2024 21:35:20 +0000 (23:35 +0200)] 
s4:librpc: make all but dcerpc_pipe->binding_handle internal struct members

We could use a dcerpc_internal.h for struct dcecli_security and
struct dcecli_connection, but in struct dcerpc_pipe we still
expose binding_handle and changing that would require way too
much work for now...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:torture/rpc: make use of dcerpc_binding_handle_get_transport()
Stefan Metzmacher [Tue, 17 Sep 2024 20:41:16 +0000 (22:41 +0200)] 
s4:torture/rpc: make use of dcerpc_binding_handle_get_transport()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:tortore/rpc: make use of dcerpc_binding_get_abstract_syntax() and dcerpc_binding_g...
Stefan Metzmacher [Wed, 18 Sep 2024 21:27:17 +0000 (23:27 +0200)] 
s4:tortore/rpc: make use of dcerpc_binding_get_abstract_syntax() and dcerpc_binding_get_flags()

We should not use p->syntax nor p->transfer_syntax...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:torture/rpc: make use of dcerpc_binding_handle_get_binding() and dcerpc_binding_ge...
Stefan Metzmacher [Tue, 17 Sep 2024 21:04:23 +0000 (23:04 +0200)] 
s4:torture/rpc: make use of dcerpc_binding_handle_get_binding() and dcerpc_binding_get_flags()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:libnet: make use of dcerpc_binding_handle_get_transport()
Stefan Metzmacher [Wed, 18 Sep 2024 21:34:44 +0000 (23:34 +0200)] 
s4:libnet: make use of dcerpc_binding_handle_get_transport()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:libnet: make use of dcerpc_binding_handle_get_binding()
Stefan Metzmacher [Wed, 18 Sep 2024 21:33:53 +0000 (23:33 +0200)] 
s4:libnet: make use of dcerpc_binding_handle_get_binding()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibrpc/rpc: un-const dcerpc_default_transport_endpoint()
Stefan Metzmacher [Thu, 19 Sep 2024 22:00:31 +0000 (00:00 +0200)] 
librpc/rpc: un-const dcerpc_default_transport_endpoint()

It returns an alloced string so it should not be marked as
const...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibrpc/rpc: add dcerpc_binding_handle_get_transport() helper function
Stefan Metzmacher [Tue, 17 Sep 2024 20:29:58 +0000 (22:29 +0200)] 
librpc/rpc: add dcerpc_binding_handle_get_transport() helper function

This will allow callers to avoid the dcerpc_binding_handle_get_binding()
dcerpc_binding_get_transport() dance...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibrpc/rpc: add dcerpc_binding_handle_get_binding()
Stefan Metzmacher [Tue, 17 Sep 2024 18:56:07 +0000 (20:56 +0200)] 
librpc/rpc: add dcerpc_binding_handle_get_binding()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: implement rpccli_bh_get_binding()
Stefan Metzmacher [Tue, 17 Sep 2024 20:21:23 +0000 (22:21 +0200)] 
s3:rpc_client: implement rpccli_bh_get_binding()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:librpc/rpc: implement dcerpc_bh_get_binding()
Stefan Metzmacher [Tue, 17 Sep 2024 18:55:35 +0000 (20:55 +0200)] 
s4:librpc/rpc: implement dcerpc_bh_get_binding()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:librpc/rpc: call dcerpc_binding_set_abstract_syntax after bind or alter context
Stefan Metzmacher [Wed, 18 Sep 2024 21:25:34 +0000 (23:25 +0200)] 
s4:librpc/rpc: call dcerpc_binding_set_abstract_syntax after bind or alter context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:winbindd: implement wbint_bh_get_binding() in winbindd_dual_ndr.c
Stefan Metzmacher [Tue, 17 Sep 2024 18:52:41 +0000 (20:52 +0200)] 
s3:winbindd: implement wbint_bh_get_binding() in winbindd_dual_ndr.c

We use NCACN_INTERNAL here too...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:lib/messaging: implement irpc_bh_get_binding()
Stefan Metzmacher [Tue, 17 Sep 2024 18:43:28 +0000 (20:43 +0200)] 
s4:lib/messaging: implement irpc_bh_get_binding()

We just use NCACN_INTERNAL here...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibcli/tstream_binding_handle: implement get_binding()
Stefan Metzmacher [Tue, 17 Sep 2024 18:43:28 +0000 (20:43 +0200)] 
libcli/tstream_binding_handle: implement get_binding()

We just create an dummy binding handle here
as it's not really dcerpc...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibrpc/rpc: add get_binding() to dcerpc_binding_handle_ops
Stefan Metzmacher [Tue, 17 Sep 2024 17:28:55 +0000 (19:28 +0200)] 
librpc/rpc: add get_binding() to dcerpc_binding_handle_ops

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: header signing is negotiated per transport connection
Stefan Metzmacher [Sun, 15 Sep 2024 15:58:53 +0000 (17:58 +0200)] 
s3:rpc_client: header signing is negotiated per transport connection

All gensec backends support GENSEC_FEATURE_SIGN_PKT_HEADER, so there's
no point in negotiating header signing based on the
auth context used during the DCERPC Bind.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: make use of struct samba_sockaddr in rpc_pipe_open_ncalrpc()
Stefan Metzmacher [Sun, 15 Sep 2024 03:35:30 +0000 (05:35 +0200)] 
s3:rpc_client: make use of struct samba_sockaddr in rpc_pipe_open_ncalrpc()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:winbindd: cm_connect_lsa_tcp() doesn't need to check for NCACN_IP_TCP or LEVEL_INT...
Stefan Metzmacher [Sat, 14 Sep 2024 16:54:43 +0000 (18:54 +0200)] 
s3:winbindd: cm_connect_lsa_tcp() doesn't need to check for NCACN_IP_TCP or LEVEL_INTEGRITY

We only ever create domain->lsa_pipe_tcp with
cli_rpc_pipe_open_schannel_with_creds() and hardcoded NCACN_IP_TCP.

And schannel_update_internal returns an error with
an auth level lower than DCERPC_AUTH_LEVEL_INTEGRITY.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpcclient: make use of dcerpc_binding_handle_auth_info()
Stefan Metzmacher [Sat, 14 Sep 2024 14:46:47 +0000 (16:46 +0200)] 
s3:rpcclient: make use of dcerpc_binding_handle_auth_info()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: the transport_session_key is per connection!
Stefan Metzmacher [Sat, 14 Sep 2024 13:59:29 +0000 (15:59 +0200)] 
s3:rpc_client: the transport_session_key is per connection!

It's not per auth_context_id, currently there's no difference
but that will change in future...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: remove unused cli_get_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 13:58:44 +0000 (15:58 +0200)] 
s3:rpc_client: remove unused cli_get_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpcclient/cli_drsuapi: make use of dcerpc_binding_handle_auth_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 13:57:03 +0000 (15:57 +0200)] 
s3:rpcclient/cli_drsuapi: make use of dcerpc_binding_handle_auth_session_key()

Note we only need to call this once per connection, not after
each request...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:libnet_dssync: make use of dcerpc_binding_handle_auth_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 13:57:03 +0000 (15:57 +0200)] 
s3:libnet_dssync: make use of dcerpc_binding_handle_auth_session_key()

Note we only need to call this once per connection, not after
each request...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: make use of dcerpc_binding_handle_transport_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 13:55:30 +0000 (15:55 +0200)] 
s3:rpc_client: make use of dcerpc_binding_handle_transport_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:utils/net_rpc: make use of dcerpc_binding_handle_transport_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 13:54:25 +0000 (15:54 +0200)] 
s3:utils/net_rpc: make use of dcerpc_binding_handle_transport_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:libnet_join: make use of dcerpc_binding_handle_transport_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 13:52:29 +0000 (15:52 +0200)] 
s3:libnet_join: make use of dcerpc_binding_handle_transport_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:lib/netapi: make use of dcerpc_binding_handle_transport_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 13:51:20 +0000 (15:51 +0200)] 
s3:lib/netapi: make use of dcerpc_binding_handle_transport_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:torture/drs: make use of dcerpc_binding_handle_auth_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 13:00:37 +0000 (15:00 +0200)] 
s4:torture/drs: make use of dcerpc_binding_handle_auth_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:pyrpc: make use of dcerpc_binding_handle_auth_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 12:20:46 +0000 (14:20 +0200)] 
s4:pyrpc: make use of dcerpc_binding_handle_auth_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:py_net: make use of dcerpc_binding_handle_auth_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 12:19:55 +0000 (14:19 +0200)] 
s4:py_net: make use of dcerpc_binding_handle_auth_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:libnet: make use of dcerpc_binding_handle_auth_session_key() in libnet_become_dc.c
Stefan Metzmacher [Sat, 14 Sep 2024 12:16:42 +0000 (14:16 +0200)] 
s4:libnet: make use of dcerpc_binding_handle_auth_session_key() in libnet_become_dc.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:drepl: make use of dcerpc_binding_handle_auth_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 12:16:01 +0000 (14:16 +0200)] 
s4:drepl: make use of dcerpc_binding_handle_auth_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: add rpccli_bh_auth_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 07:55:20 +0000 (09:55 +0200)] 
s3:rpc_client: add rpccli_bh_auth_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:librpc/rpc: add dcerpc_bh_auth_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 07:55:20 +0000 (09:55 +0200)] 
s4:librpc/rpc: add dcerpc_bh_auth_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibrpc/rpc: add dcerpc_binding_handle_auth_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 07:55:20 +0000 (09:55 +0200)] 
librpc/rpc: add dcerpc_binding_handle_auth_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:librpc/rpc: remove unused dcerpc_fetch_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 12:32:22 +0000 (14:32 +0200)] 
s4:librpc/rpc: remove unused dcerpc_fetch_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:torture/rpc: make use of dcerpc_binding_handle_transport_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 12:31:58 +0000 (14:31 +0200)] 
s4:torture/rpc: make use of dcerpc_binding_handle_transport_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agoxss4:pyrpc: make use of dcerpc_binding_handle_transport_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 12:20:46 +0000 (14:20 +0200)] 
xss4:pyrpc: make use of dcerpc_binding_handle_transport_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:libnet: make use of dcerpc_binding_handle_transport_session_key() in libnet_passwd.c
Stefan Metzmacher [Sat, 14 Sep 2024 12:16:42 +0000 (14:16 +0200)] 
s4:libnet: make use of dcerpc_binding_handle_transport_session_key() in libnet_passwd.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:libnet: add struct dcerpc_binding_handle helper variables in libnet_passwd.c
Stefan Metzmacher [Sat, 14 Sep 2024 12:16:42 +0000 (14:16 +0200)] 
s4:libnet: add struct dcerpc_binding_handle helper variables in libnet_passwd.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:librpc/rpc: remove unused dcerpc_transport_encrypted()
Stefan Metzmacher [Sat, 14 Sep 2024 11:37:34 +0000 (13:37 +0200)] 
s4:librpc/rpc: remove unused dcerpc_transport_encrypted()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:pyrpc: let py_iface_transport_encrypted() use dcerpc_binding_handle_transport_encr...
Stefan Metzmacher [Sat, 14 Sep 2024 11:35:47 +0000 (13:35 +0200)] 
s4:pyrpc: let py_iface_transport_encrypted() use dcerpc_binding_handle_transport_encrypted()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos3:rpc_client: add rpccli_bh_transport_session_key()
Stefan Metzmacher [Sat, 14 Sep 2024 07:55:20 +0000 (09:55 +0200)] 
s3:rpc_client: add rpccli_bh_transport_session_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:librpc/rpc: add dcerpc_bh_transport_{encrypted,session_key}()
Stefan Metzmacher [Sat, 14 Sep 2024 07:55:20 +0000 (09:55 +0200)] 
s4:librpc/rpc: add dcerpc_bh_transport_{encrypted,session_key}()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agolibrpc/rpc: add dcerpc_binding_handle_transport_{encrypted,session_key}()
Stefan Metzmacher [Sat, 14 Sep 2024 07:55:20 +0000 (09:55 +0200)] 
librpc/rpc: add dcerpc_binding_handle_transport_{encrypted,session_key}()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agos4:torture/rpc: avoid using DCERPC_NDR_REF_ALLOC in fsrvp.c
Stefan Metzmacher [Wed, 18 Sep 2024 04:27:30 +0000 (06:27 +0200)] 
s4:torture/rpc: avoid using DCERPC_NDR_REF_ALLOC in fsrvp.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>