]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
10 months agoctdb-daemon: Fix a comment
Martin Schwenke [Thu, 25 Jul 2024 03:41:35 +0000 (13:41 +1000)] 
ctdb-daemon: Fix a comment

The word "no" was accidentally dropped in commit
1e47a1b3f6ab1e2ad9d86dfb28c3e086c99a97e5.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-daemon: Drop unused arguments
Martin Schwenke [Tue, 18 Jun 2024 05:54:26 +0000 (15:54 +1000)] 
ctdb-daemon: Drop unused arguments

Unused since commit a10545ab6bd8a1b9ca87b0fdba8381cb8af0e284.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-daemon: Improve error handling when releasing all IPs
Martin Schwenke [Tue, 18 Jun 2024 05:38:18 +0000 (15:38 +1000)] 
ctdb-daemon: Improve error handling when releasing all IPs

Currently, event failures are completely ignored in favour of checking
if the IP is on an interface.  This misses the case where event
scripts up to and including 10.interface succeed, but something later
fails.  When that occurs, count is incremented, so the failure is
counted as a success in the summary that is logged.

Fail when releaseip fails even though 10.interface succeeded in
releasing the IP.  This may result in the IP address coming back, but
that's a different problem.

Underlying this is a design question about when releaseip is
successful.  Should releaseip be a distinct operation, with subsequent
reconfigurations considered separately?

Update logging to clearly identify each of the 3 possible errors.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-tcp: Modernise a DEBUG
Martin Schwenke [Thu, 3 Oct 2024 05:13:30 +0000 (15:13 +1000)] 
ctdb-tcp: Modernise a DEBUG

This is last old-style one in this file.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Oct  7 17:12:18 UTC 2024 on atb-devel-224

10 months agoctdb-tcp: Only attempt to automatically bind to local IPs
Martin Schwenke [Thu, 3 Oct 2024 05:07:40 +0000 (15:07 +1000)] 
ctdb-tcp: Only attempt to automatically bind to local IPs

Automatic node address selection in the TCP transport does not work if
net.ipv4.ip_nonlocal_bind=1 because all nodes will be able to bind()
to the first address in the nodes list.

Before getting to the bind() step, add a check to see if an address is
local (i.e. on an interface).  If not, it is not considered.

This is defensively coded so that this step is skipped if local
addresses can not be retrieved.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-server: Optimise local IP verification
Martin Schwenke [Sun, 29 Sep 2024 04:10:22 +0000 (14:10 +1000)] 
ctdb-server: Optimise local IP verification

It is more efficient calling ctdb_sys_local_ip_check() inside a loop
compared to calling ctdb_sys_have_ip().  There is a chance that this
is premature optimisation... but it sure is easy.  Fall back to
checking with bind().

I think these checks really exist because of the weirdness fixed by
commit 4b4e4d8870475d994fe42a7b2c57dc69842d91f6.  However, we might as
well do what we can.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-common: Reimplement ctdb_sys_have_ip() using new infrastructure
Martin Schwenke [Sun, 29 Sep 2024 02:05:31 +0000 (12:05 +1000)] 
ctdb-common: Reimplement ctdb_sys_have_ip() using new infrastructure

It can now be used when net.ipv4.ip_nonlocal_bind=1.

This makes the recovery daemon's local IP verification inefficient.
It can be optimised in a subsequent commit.

Fall back to bind() if unable to fetch IPs.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-common: Make the argument to ctdb_sys_have_ip() const
Martin Schwenke [Fri, 4 Oct 2024 12:08:46 +0000 (22:08 +1000)] 
ctdb-common: Make the argument to ctdb_sys_have_ip() const

Arguably, this would have made sense back in commit
bf86562144fe4e9541bd993519aca958c2bdb794.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-server: Add some local variables
Martin Schwenke [Sun, 29 Sep 2024 04:06:51 +0000 (14:06 +1000)] 
ctdb-server: Add some local variables

Improve readability by not repeating the complex expression now
assigned to addr.  ctdb_sys_have_ip() is called in both arms of the
if/else, so call it once when declaring the new variable.

Modernise debug macros while touching lines.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-tests: Add test code for ctdb_sys_have_ip()
Martin Schwenke [Sun, 29 Sep 2024 02:04:20 +0000 (12:04 +1000)] 
ctdb-tests: Add test code for ctdb_sys_have_ip()

Do not add any automated test cases because they will always be racy.
This allows manual testing of the function.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-common: Add functions for local IP address checking
Martin Schwenke [Sun, 29 Sep 2024 01:57:58 +0000 (11:57 +1000)] 
ctdb-common: Add functions for local IP address checking

This is a wrapper around getifaddrs(2), which is in libreplace, so
should always be available.

Some users want to set net.ipv4.ip_nonlocal_bind = 1.  So, CTDB needs
a way of testing if public IPs are present, without using bind(2).

Doing all of this unconditionally in ctdb_sys_have_ip() will be
inefficient in the recovery daemon's local IP verification if there
are a lot of IP addresses.  Split it this way so the interface
information can be retrieved once and used multiple times.

This doesn't appear to need IP canonicalisation for IPv4-mapped IPv6
addresses.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-protocol: Add function ctdb_sock_addr_from_sockaddr()
Martin Schwenke [Sun, 29 Sep 2024 01:55:52 +0000 (11:55 +1000)] 
ctdb-protocol: Add function ctdb_sock_addr_from_sockaddr()

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agovfs_glusterfs: Retrieve fs capabilities using vfs_get_fs_capabilities
Anoop C S [Tue, 17 Sep 2024 18:28:50 +0000 (23:58 +0530)] 
vfs_glusterfs: Retrieve fs capabilities using vfs_get_fs_capabilities

vfs_glusterfs is supposed to be the last entry when listed with
other vfs modules. This is due to the fact that the connection path
is not local to the server but relative to the virtual remote file
system beneath it. Especially SMB_VFS_FS_CAPABILITIES implementation
from vfs_default is likely to return incorrect results based on the
connection path assumed to be local to the server which might not be
the case with glusterfs module stacked. Therefore it doesn't make sense
to pass through any vfs interface implementations further down the line
to vfs_default.

Instead make use of get_fs_capabilties to start with already known fs
capabilties from connect phase.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Oct  7 13:36:11 UTC 2024 on atb-devel-224

10 months agovfs_ceph_new: Retrieve fs capabilties using vfs_get_fs_capabilities
Anoop C S [Thu, 3 Oct 2024 07:02:04 +0000 (12:32 +0530)] 
vfs_ceph_new: Retrieve fs capabilties using vfs_get_fs_capabilities

Make use of get_fs_capabilties to start with already known fs
capabilties from connect phase.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agovfs_ceph_new: Populate fs capabilities within vfs_ceph_statvfs
Anoop C S [Thu, 3 Oct 2024 06:59:58 +0000 (12:29 +0530)] 
vfs_ceph_new: Populate fs capabilities within vfs_ceph_statvfs

SMB_VFS_STATVFS implementation for vfs_ceph_new failed to fill in the
FsCapabilities field for vfs_statvfs_struct. Insert the minimum
required values for defining the capabilties of a ceph file system.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agovfs_ceph: Retrieve fs capabilties using vfs_get_fs_capabilities
Anoop C S [Tue, 17 Sep 2024 18:20:25 +0000 (23:50 +0530)] 
vfs_ceph: Retrieve fs capabilties using vfs_get_fs_capabilities

vfs_ceph is supposed to be the last entry when listed with other vfs
modules. This is due to the fact that the connection path is not local
to the server but relative to the virtual remote file system beneath
it. Especially SMB_VFS_FS_CAPABILITIES implementation from vfs_default
is likely to return incorrect results based on the connection path
assumed to be local to the server which might not be the case with
ceph module stacked. Therefore it doesn't make sense to pass through
any vfs interface implementations further down the line to vfs_default.

Instead make use of get_fs_capabilties to start with already known fs
capabilties from connect phase.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agovfs_ceph: Populate fs capabilities within cephwrap_statvfs
Anoop C S [Mon, 23 Sep 2024 09:25:59 +0000 (14:55 +0530)] 
vfs_ceph: Populate fs capabilities within cephwrap_statvfs

SMB_VFS_STATVFS implementation for vfs_ceph failed to fill in the
FsCapabilities field for vfs_statvfs_struct. Insert the minimum
required values for defining the capabilties of a ceph file system.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agovfs_default: Retrieve fs capabilites using vfs_get_fs_capabilties
Anoop C S [Tue, 24 Sep 2024 05:55:54 +0000 (11:25 +0530)] 
vfs_default: Retrieve fs capabilites using vfs_get_fs_capabilties

Make use of get_fs_capabilties to start with already known fs
capabilties from connect phase.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agos3/smbd: Add a helper to fetch fs capabilities
Anoop C S [Tue, 24 Sep 2024 05:36:58 +0000 (11:06 +0530)] 
s3/smbd: Add a helper to fetch fs capabilities

We create a new helper function to retrieve the fs capabilties via
STATVFS call. Additionally set other capabilities based on specific
parametric options. This is 99.9% taken from SMB_VFS_FS_CAPABILITIES
implementation of vfs_default in preparation to be called from any
required vfs module.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agoctdb-tests: Fix test failure when tests are installed
Martin Schwenke [Wed, 4 Sep 2024 10:20:20 +0000 (20:20 +1000)] 
ctdb-tests: Fix test failure when tests are installed

This currently works when tests are run in-tree.

However, when installed, use of an incorrect variable means it fails
to find statd_callout in the tests/ subdirectory.  Switch to using the
correct variable.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sun Oct  6 11:07:05 UTC 2024 on atb-devel-224

10 months agoctdb-tests: Add missing quotes in test output
Martin Schwenke [Wed, 4 Sep 2024 10:10:43 +0000 (20:10 +1000)] 
ctdb-tests: Add missing quotes in test output

These should have caused test failure since commit
ef921bdbdbacecf39ee2a1851f16dbba62175fcc.  However, the test failure
occurred in a sub-shell, which covered the failure.  So, add an error
exit if the sub-shell fails.

While here, add an error exit for another potential uncaught
sub-shell-related failure in a related test.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoutils: Fix up 14a533680245
Volker Lendecke [Fri, 4 Oct 2024 13:12:22 +0000 (15:12 +0200)] 
utils: Fix up 14a533680245

Obvious omission

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sun Oct  6 02:25:09 UTC 2024 on atb-devel-224

10 months agolib: Use talloc_realloc instead of talloc_realloc_size
Volker Lendecke [Fri, 4 Oct 2024 13:09:35 +0000 (15:09 +0200)] 
lib: Use talloc_realloc instead of talloc_realloc_size

Maybe Coverity understands that talloc_realloc re-allocates the input
buf. It does not understand that talloc_realloc_size does it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 months agos3:g_lock: Do not let pointers to point outside the input buffer
Pavel Filipenský [Fri, 4 Oct 2024 08:31:03 +0000 (10:31 +0200)] 
s3:g_lock: Do not let pointers to point outside the input buffer

If num_shared == 0 the shared points at the address outside the buf.
Make it NULL instead.

(gdb) p *lck
$33 = {
  exclusive = {
    pid = 1187098,
    task_id = 0,
    vnn = 4294967295,
    unique_id = 7349874180613937639
  },
  num_shared = 0,
  shared = 0x555555646980 "@kdUUU",
  unique_lock_epoch = 1489043017590848833,
  unique_data_epoch = 11232048132975083808,
  datalen = 0,
  data = 0x555555646980 "@kdUUU"
}

Same for datalen & data.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Sat Oct  5 14:44:46 UTC 2024 on atb-devel-224

10 months agonetcmd:domain:policy: Fix missing conversion from tgt_lifetime minutes to 10^(-7...
Andréas Leroux [Wed, 25 Sep 2024 12:42:25 +0000 (14:42 +0200)] 
netcmd:domain:policy: Fix missing conversion from tgt_lifetime minutes to 10^(-7) seconds

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15692
Signed-off-by: Andréas Leroux <aleroux@tranquil.it>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Oct  4 04:01:22 UTC 2024 on atb-devel-224

10 months agoauth4: Fix CID 1034877 Resource leak
Volker Lendecke [Mon, 30 Sep 2024 09:05:20 +0000 (11:05 +0200)] 
auth4: Fix CID 1034877 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Oct  2 14:19:08 UTC 2024 on atb-devel-224

10 months agontvfs: Fix CID 1034883 Resource leak
Volker Lendecke [Mon, 30 Sep 2024 09:01:04 +0000 (11:01 +0200)] 
ntvfs: Fix CID 1034883 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agolib: Change ADD_TO_ARRAY to use a tmp variable
Volker Lendecke [Mon, 30 Sep 2024 08:43:00 +0000 (10:43 +0200)] 
lib: Change ADD_TO_ARRAY to use a tmp variable

This should fix a few Coverity Resource Leak findings. Coverity does
not understand that SMB_ASSERT aborts the program, so it believes if
realloc fails we leak the previous allocation. Those are false
positives, but doing it this way does not cost much.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agolib: Avoid duplicate definition of ADD_TO_ARRAY
Volker Lendecke [Mon, 30 Sep 2024 08:37:06 +0000 (10:37 +0200)] 
lib: Avoid duplicate definition of ADD_TO_ARRAY

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agolib: Factor out ADD_TO_MALLOC_ARRAY()
Volker Lendecke [Mon, 30 Sep 2024 08:34:17 +0000 (10:34 +0200)] 
lib: Factor out ADD_TO_MALLOC_ARRAY()

ADD_TO_ARRAY with an explicit NULL mem_ctx is only used in 3
places. I've checked the other places, and I think I made sure that the
mem_ctx being passed in is non-NULL everywhere else.

This makes the "legacy" use with SMB_REALLOC more obvious.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agolib: Fix CID 1596761 Resource leak
Volker Lendecke [Sun, 29 Sep 2024 07:58:13 +0000 (09:58 +0200)] 
lib: Fix CID 1596761 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agoshadow_copy2: Ignore VFS_OPEN_HOW_WITH_BACKUP_INTENT
Christof Schmitt [Tue, 1 Oct 2024 20:29:56 +0000 (13:29 -0700)] 
shadow_copy2: Ignore VFS_OPEN_HOW_WITH_BACKUP_INTENT

d1846452e96 vfs: Add VFS_OPEN_HOW_WITH_BACKUP_INTENT introduced
VFS_OPEN_HOW_WITH_BACKUP_INTENT for files opened with
FILE_OPEN_FOR_BACKUP_INTENT. shadow_copy2 refuses the open on a file if
any flage in how.resolve is set. Change the check in shadow_copy2 to
allow opening of files with VFS_OPEN_HOW_WITH_BACKUP_INTENT.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Oct  2 08:06:38 UTC 2024 on atb-devel-224

10 months agos3:notifyd: Use a watcher per db record
Andreas Schneider [Mon, 22 Jul 2024 10:26:55 +0000 (12:26 +0200)] 
s3:notifyd: Use a watcher per db record

This fixes a O(n²) performance regression in notifyd. The problem was
that we had a watcher per notify instance. This changes the code to have
a watcher per notify db entry.

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

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): Tue Oct  1 14:22:43 UTC 2024 on atb-devel-224

10 months agos3:winbindd: let store_current_dc_in_gencache() take the dcaddr directly
Stefan Metzmacher [Fri, 27 Sep 2024 11:31:13 +0000 (13:31 +0200)] 
s3:winbindd: let store_current_dc_in_gencache() take the dcaddr directly

We could avoid relying on smbXcli_conn_remote_sockaddr() as much as
possible, because we aim to remove domain->conn.cli same day...

Also note that find_dc() always filled domain->dcaddr already
when cm_open_connection() calls store_current_dc_in_gencache().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Oct  1 11:01:35 UTC 2024 on atb-devel-224

10 months agos3:winbindd: dcip_check_name() only takes pss as const input value
Stefan Metzmacher [Fri, 27 Sep 2024 11:29:31 +0000 (13:29 +0200)] 
s3:winbindd: dcip_check_name() only takes pss as const input value

The makes things easier to understand, because the callers
pass in &domain->dcaddr, which could also used as output value.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos3:winbindd: set_dc_type_and_flags() doesn't need to do something for primary or...
Stefan Metzmacher [Wed, 25 Sep 2024 17:33:09 +0000 (19:33 +0200)] 
s3:winbindd: set_dc_type_and_flags() doesn't need to do something for primary or internal domains

In the end set_dc_type_and_flags should be removed completely, but
this is a good start in the right direction...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos3:winbindd: let add_trusted_domain() mark domains as initialized when loaded from...
Stefan Metzmacher [Wed, 25 Sep 2024 17:31:01 +0000 (19:31 +0200)] 
s3:winbindd: let add_trusted_domain() mark domains as initialized when loaded from config

We at least pass SEC_CHAN_LOCAL for internal domains,
only learned domains use SEC_CHAN_NULL.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos3:winbindd: remove unused line in add_trusted_domain()
Stefan Metzmacher [Wed, 25 Sep 2024 17:29:53 +0000 (19:29 +0200)] 
s3:winbindd: remove unused line in add_trusted_domain()

Review with: git show -U8

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos3:winbindd: it's 2024 and all AD domains should be native now
Stefan Metzmacher [Wed, 25 Sep 2024 17:04:41 +0000 (19:04 +0200)] 
s3:winbindd: it's 2024 and all AD domains should be native now

No need to use dssetup_DsRoleGetPrimaryDomainInformation that
only adds latency...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos3:winbindd: let cm_connect_lsa() require schannel also for direct trusts
Stefan Metzmacher [Fri, 27 Sep 2024 10:21:53 +0000 (12:21 +0200)] 
s3:winbindd: let cm_connect_lsa() require schannel also for direct trusts

This means as domain member we require it also for our primary domain.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos3:winbindd: let connect_preferred_dc() pass the dcname to smbsock_connect()
Stefan Metzmacher [Fri, 27 Sep 2024 08:50:55 +0000 (10:50 +0200)] 
s3:winbindd: let connect_preferred_dc() pass the dcname to smbsock_connect()

The is not critical, but avoids using the ip address with
fallback to '*SMBSERVER' for connections to port 139.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos3:libsmb: ads_dc_name() doesn't need to retry if we found a DC in the closest site
Stefan Metzmacher [Thu, 26 Sep 2024 17:14:40 +0000 (19:14 +0200)] 
s3:libsmb: ads_dc_name() doesn't need to retry if we found a DC in the closest site

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agolibsmb: use more precise error status
Jule Anger [Fri, 6 Sep 2024 08:49:08 +0000 (10:49 +0200)] 
libsmb: use more precise error status

NO_MEMORY is the only possible error.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Oct  1 08:15:35 UTC 2024 on atb-devel-224

10 months agos3:passdb: ENCTYPE_DES_CBC_MD5 is not longer used in secrets_domain_info_kerberos_keys()
Stefan Metzmacher [Fri, 13 Sep 2024 20:00:06 +0000 (22:00 +0200)] 
s3:passdb: ENCTYPE_DES_CBC_MD5 is not longer used in secrets_domain_info_kerberos_keys()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Sep 30 17:03:55 UTC 2024 on atb-devel-224

10 months agosystem_mitkrb5: require 1.16 as we use ENCTYPE_AES256_CTS_HMAC_SHA384_192
Stefan Metzmacher [Fri, 13 Sep 2024 20:12:34 +0000 (22:12 +0200)] 
system_mitkrb5: require 1.16 as we use ENCTYPE_AES256_CTS_HMAC_SHA384_192

commit 8e931fce126e8c1128da893c806702731c08758a introduced that
implicit dependency, we better make it more clear, which might
allow relying on more modern stuff in future...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agolib: Fix CID 1620428: Memory - illegal accesses (OVERRUN)
Volker Lendecke [Sun, 29 Sep 2024 06:13:04 +0000 (08:13 +0200)] 
lib: Fix CID 1620428:  Memory - illegal accesses  (OVERRUN)

Beginner's mistake, sorry.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sun Sep 29 11:49:13 UTC 2024 on atb-devel-224

10 months agolib/addns: match additional names in a non case insensitive way
Stefan Metzmacher [Thu, 26 Sep 2024 12:47:26 +0000 (14:47 +0200)] 
lib/addns: match additional names in a non case insensitive way

Sometime proxy dns servers mess up the case of parts of the
name...

So we should match with strequal() instead of strcmp(),
which results in much less dns packets on the wire...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Sep 29 08:09:46 UTC 2024 on atb-devel-224

10 months agos3:rpc_client: pass remote_{name,sockaddr} to rpccli_setup_netlogon_creds[_locked]()
Stefan Metzmacher [Fri, 27 Sep 2024 07:38:19 +0000 (09:38 +0200)] 
s3:rpc_client: pass remote_{name,sockaddr} to rpccli_setup_netlogon_creds[_locked]()

We shouldd not rely on cli_state to be a valid pointer
(at least not when NCACN_IP_TCP is used...)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 months agos3:rpc_client: add missing TALLOC_FREE(frame) in cli_rpc_pipe_open()
Stefan Metzmacher [Fri, 27 Sep 2024 10:00:59 +0000 (12:00 +0200)] 
s3:rpc_client: add missing TALLOC_FREE(frame) in cli_rpc_pipe_open()

This was missing in commit 637a8e5270fefaea5c61921d4b6ecfc4455a91aa.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 months agodoc: Update doc about talloc vs malloc speed
Andreas Schneider [Wed, 29 Mar 2023 09:04:38 +0000 (11:04 +0200)] 
doc: Update doc about talloc vs malloc speed

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Sep 28 01:20:01 UTC 2024 on atb-devel-224

10 months agolib:talloc: Use tabs to align output in speed test
Andreas Schneider [Thu, 27 Apr 2023 09:31:07 +0000 (11:31 +0200)] 
lib:talloc: Use tabs to align output in speed test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>