samba.git
22 months agoctdb-scripts: Avoid ShellCheck warning SC2295
Martin Schwenke [Fri, 27 May 2022 13:23:48 +0000 (23:23 +1000)]
ctdb-scripts: Avoid ShellCheck warning SC2295

For example:

In /home/martins/samba/samba/ctdb/tools/onnode line 304:
    [ "$nodes" != "${nodes%[ ${nl}]*}" ] && verbose=true
                             ^---^ SC2295 (info): Expansions inside ${..} need to be quoted separately, otherwise they match as patterns.

Did you mean:
    [ "$nodes" != "${nodes%[ "${nl}"]*}" ] && verbose=true

For more information:
  https://www.shellcheck.net/wiki/SC2295 -- Expansions inside ${..} need to b...

Who knew?  Thanks ShellCheck!

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-common: Use POSIX if_nameindex() to check interface existence
Martin Schwenke [Tue, 5 Jul 2022 02:31:57 +0000 (12:31 +1000)]
ctdb-common: Use POSIX if_nameindex() to check interface existence

This works as an unprivileged user, so avoids unnecessary errors when
running in test mode (and not as root):

  2022-02-18T12:21:12.436491+11:00 node.0 ctdbd[6958]: ctdb_sys_check_iface_exists: Failed to open raw socket
  2022-02-18T12:21:12.436534+11:00 node.0 ctdbd[6958]: ctdb_sys_check_iface_exists: Failed to open raw socket
  2022-02-18T12:21:12.436557+11:00 node.0 ctdbd[6958]: ctdb_sys_check_iface_exists: Failed to open raw socket
  2022-02-18T12:21:12.436577+11:00 node.0 ctdbd[6958]: ctdb_sys_check_iface_exists: Failed to open raw socket

The corresponding porting test would now become pointless because it
would just confirm that "fake" does not exist.  Attempt to make it
useful by using a less likely name than "fake" and attempting to
detect the loopback interface.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoreplace: Add check for if_nameindex()
Martin Schwenke [Thu, 21 Jul 2022 01:25:37 +0000 (11:25 +1000)]
replace: Add check for if_nameindex()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-daemon: Modernise debug in ctdb_add_public_address()
Martin Schwenke [Tue, 5 Jul 2022 02:17:05 +0000 (12:17 +1000)]
ctdb-daemon: Modernise debug in ctdb_add_public_address()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-daemon: Avoid spurious error sending ARPs for released IP
Martin Schwenke [Thu, 23 Jun 2022 04:30:34 +0000 (14:30 +1000)]
ctdb-daemon: Avoid spurious error sending ARPs for released IP

A public IP address can be released in between (and probably before)
attempts to send ARPs.  One situation when this can occur is when a
cluster is shutting down: node A shuts down first, public IPs from
node A are taken over by node B, node B is shutdown.

Notice this when it occurs and cancel further attempts to send ARPs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-daemon: Modernise debug in ctdb_control_send_arp()
Martin Schwenke [Tue, 5 Jul 2022 09:33:15 +0000 (19:33 +1000)]
ctdb-daemon: Modernise debug in ctdb_control_send_arp()

For the tickle ACK logging, render the connection in a buffer.  This
produces more complete information.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-protocol: Add separator argument to ctdb_connection_to_buf()
Martin Schwenke [Tue, 19 Jul 2022 01:53:15 +0000 (11:53 +1000)]
ctdb-protocol: Add separator argument to ctdb_connection_to_buf()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-daemon: Drop unused ban_state element from CTDB node structure
Martin Schwenke [Wed, 29 Jul 2020 03:39:03 +0000 (13:39 +1000)]
ctdb-daemon: Drop unused ban_state element from CTDB node structure

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-recoverd: Clean up banning culprit code
Martin Schwenke [Wed, 29 Jul 2020 03:30:04 +0000 (13:30 +1000)]
ctdb-recoverd: Clean up banning culprit code

Make this fully self-contained in the recovery daemon and avoid
indexing by PNN.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-recoverd: Add pnn field to banning state structure
Martin Schwenke [Wed, 29 Jul 2020 02:15:03 +0000 (12:15 +1000)]
ctdb-recoverd: Add pnn field to banning state structure

This structure is now standalone, so indexing by PNN can be avoided
via a subsequent commit.  Index by culprit here to make this commit
simple.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-recoverd: Add function node_flags() and use it in elections
Martin Schwenke [Wed, 29 Jul 2020 07:57:53 +0000 (17:57 +1000)]
ctdb-recoverd: Add function node_flags() and use it in elections

Indexing a node map by PNN is suboptimal.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-scripts: Only run unhealthy call-out when passing threshold
Martin Schwenke [Fri, 10 Jun 2022 00:32:01 +0000 (10:32 +1000)]
ctdb-scripts: Only run unhealthy call-out when passing threshold

For memory usage, no need to dump all of this data on every failed
monitor event.  The first call will be enough to diagnose the problem.
The node will then go unhealthy, drop clients and memory usage should
then drop.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Jul 22 07:32:54 UTC 2022 on sn-devel-184

22 months agoctdb-scripts: Always check memory usage
Martin Schwenke [Fri, 10 Jun 2022 00:03:41 +0000 (10:03 +1000)]
ctdb-scripts: Always check memory usage

If filesystem usage exceeds the unhealthy threshold then checking
memory usage checking is not done.  Always do them both.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-scripts: Avoid ShellCheck info SC2162
Martin Schwenke [Fri, 10 Jun 2022 00:28:56 +0000 (10:28 +1000)]
ctdb-scripts: Avoid ShellCheck info SC2162

SC2162 (info): read without -r will mangle backslashes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-scripts: Reduce length of very long lines
Martin Schwenke [Wed, 29 Jun 2022 22:55:28 +0000 (08:55 +1000)]
ctdb-scripts: Reduce length of very long lines

Use printf to allow easier line breaks and use some early returns.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-scripts: De-clutter validate_percentage()
Martin Schwenke [Fri, 10 Jun 2022 00:17:28 +0000 (10:17 +1000)]
ctdb-scripts: De-clutter validate_percentage()

It always takes 2 arguments.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-scripts: Reformat using shfmt -w -p -i 0 -fn
Martin Schwenke [Fri, 10 Jun 2022 00:13:22 +0000 (10:13 +1000)]
ctdb-scripts: Reformat using shfmt -w -p -i 0 -fn

About to modify this file, so reformat first as per recent Samba
convention.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agoctdb-scripts: Avoid ShellCheck warning SC2164
Martin Schwenke [Fri, 10 Jun 2022 00:11:27 +0000 (10:11 +1000)]
ctdb-scripts: Avoid ShellCheck warning SC2164

SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

A problem can only occur if /etc/ctdb/ or an important subdirectory is
removed, which means the script itself would not be found.  Use && to
silence ShellCheck.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
22 months agosmbd: Bypass the vfs_gethandle data for default share IPC$
dinesh [Thu, 26 May 2022 05:06:04 +0000 (10:36 +0530)]
smbd: Bypass the vfs_gethandle data for default share IPC$

During gpfs_connect for default share of IPC$ not setting the handle data but during the vfs_gpfs_capabilities
for the default share IPC$ the get handle data was called and observing error log failed to get vfs_handle->data!
so to bypass this error log the condition check if IS_IPC share is added in make_connection_snum while calling SMB_VFS_FS_CAPABILITIES

Signed-off-by:Dinesh <dinesh.kumar.reddy@ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 22 05:27:53 UTC 2022 on sn-devel-184

22 months agothird_party: Update socket_wrapper to version 1.3.4
Andreas Schneider [Thu, 21 Jul 2022 12:55:31 +0000 (14:55 +0200)]
third_party: Update socket_wrapper to version 1.3.4

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
22 months agos3:winbind: Add additional debug level check to wb_lookupsids_send()
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Add additional debug level check to wb_lookupsids_send()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jul 21 14:41:53 UTC 2022 on sn-devel-184

22 months agos3:winbind: Add additional debug level check to winbindd_getsidaliases_send()
Pavel Filipenský [Tue, 19 Jul 2022 14:25:13 +0000 (16:25 +0200)]
s3:winbind: Add additional debug level check to winbindd_getsidaliases_send()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Add additional debug level check to winbindd_getgroups_recv()
Pavel Filipenský [Tue, 19 Jul 2022 14:21:57 +0000 (16:21 +0200)]
s3:winbind: Add additional debug level check to winbindd_getgroups_recv()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Add additional debug level check to wb_gettoken_recv()
Pavel Filipenský [Tue, 19 Jul 2022 14:48:09 +0000 (16:48 +0200)]
s3:winbind: Add additional debug level check to wb_gettoken_recv()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getsidaliases.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:11 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getsidaliases.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_xids_to_sids.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:11 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_xids_to_sids.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_sids_to_xids.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:11 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_sids_to_xids.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_list_users.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:11 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_list_users.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_list_groups.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:11 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_list_groups.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getusersids.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:11 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getusersids.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getuserdomgroups.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:11 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getuserdomgroups.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getpwent.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:11 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getpwent.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getgroups.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:11 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getgroups.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getgrnam.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:11 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getgrnam.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getgrgid.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getgrgid.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getgrent.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in winbindd_getgrent.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_lookupsids.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_lookupsids.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_xids2sids.c
Pavel Filipenský [Tue, 19 Jul 2022 09:11:53 +0000 (11:11 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_xids2sids.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_sids2xids.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_sids2xids.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_queryuser.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_queryuser.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_query_user_list.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_query_user_list.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_query_group_list.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_query_group_list.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_next_pwent.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_next_pwent.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_lookupusergroups.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_lookupusergroups.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_lookupuseraliases.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_lookupuseraliases.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_group_members.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_group_members.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_gettoken.c
Pavel Filipenský [Mon, 18 Jul 2022 13:28:10 +0000 (15:28 +0200)]
s3:winbind: Change '%u' to '%PRIu32' for uint32_t in wb_gettoken.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agoREADME.Coding: PRINT format specifiers PRIuxx
Pavel Filipenský [Tue, 19 Jul 2022 09:46:13 +0000 (11:46 +0200)]
README.Coding: PRINT format specifiers PRIuxx

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agoAdd a .clang-format file
Andreas Schneider [Tue, 19 Jul 2022 13:38:27 +0000 (15:38 +0200)]
Add a .clang-format file

How to use:

Install 'git-format-clang' which is part of the clang suite (Fedora:
git-clang-format, openSUSE: clang-tools).

Now do your changes and stage them with `git add`. Once they are staged
format the code using `git clang-format` before you commit.

Now the formatting changed can be viewed with `git diff` against the
staged changes.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Jul 20 18:23:49 UTC 2022 on sn-devel-184

22 months agotestprogs: Reformat common_test_fns.inc
Andreas Schneider [Wed, 8 Jun 2022 12:49:51 +0000 (14:49 +0200)]
testprogs: Reformat common_test_fns.inc

shfmt -w -p -i 0 -fn testprogs/blackbox/common_test_fns.inc

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Wed Jul 20 11:59:26 UTC 2022 on sn-devel-184

22 months agotestprogs: Reformat common-links.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)]
testprogs: Reformat common-links.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/common-links.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
22 months agowaf: Check for -Wno-error=array-bounds flags
Andreas Schneider [Mon, 18 Jul 2022 08:39:05 +0000 (10:39 +0200)]
waf: Check for -Wno-error=array-bounds flags

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

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 Jul 19 12:17:35 UTC 2022 on sn-devel-184

22 months agos3:tests: Add test to access msdfs path with smbget
Andreas Schneider [Tue, 12 Jul 2022 09:19:13 +0000 (11:19 +0200)]
s3:tests: Add test to access msdfs path with smbget

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul 19 00:10:10 UTC 2022 on sn-devel-184

22 months agos3:rpcclient: Goto done in cmd_samr_setuserinfo_int()
Andreas Schneider [Thu, 19 Aug 2021 10:09:28 +0000 (12:09 +0200)]
s3:rpcclient: Goto done in cmd_samr_setuserinfo_int()

We need to free the frame or we will run into:
    smb_panic (why=0x7fa8c511aa88 "Frame not freed in order.")

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul 18 21:21:59 UTC 2022 on sn-devel-184

22 months agos3:winbind: Add additional debug level check to wb_xids2sids_recv()
Andreas Schneider [Mon, 18 Jul 2022 11:28:50 +0000 (13:28 +0200)]
s3:winbind: Add additional debug level check to wb_xids2sids_recv()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Jul 18 14:44:07 UTC 2022 on sn-devel-184

22 months agos3:winbind: Fix pointer access in wb_xids2sids_recv()
Andreas Schneider [Mon, 18 Jul 2022 07:20:22 +0000 (09:20 +0200)]
s3:winbind: Fix pointer access in wb_xids2sids_recv()

CID 1507348
CID 1507349

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
22 months agos3:winbind: Add additional debug level check to wb_lookupusergroups_recv()
Andreas Schneider [Mon, 18 Jul 2022 11:26:58 +0000 (13:26 +0200)]
s3:winbind: Add additional debug level check to wb_lookupusergroups_recv()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
22 months agos3:winbind: Fix pointer access in wb_lookupusergroups_recv()
Andreas Schneider [Mon, 18 Jul 2022 07:18:59 +0000 (09:18 +0200)]
s3:winbind: Fix pointer access in wb_lookupusergroups_recv()

Fixes CID 1507350

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
22 months agos3:winbind: Change max_users, num_users from int to uint32_t in winbindd_getpwent_state
Pavel Filipenský [Thu, 14 Jul 2022 11:19:44 +0000 (13:19 +0200)]
s3:winbind: Change max_users, num_users from int to uint32_t in winbindd_getpwent_state

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul 15 15:21:23 UTC 2022 on sn-devel-184

22 months agos3:winbind: Change num_gids from int to uint32_t in winbindd_getgroups_state
Pavel Filipenský [Thu, 14 Jul 2022 11:19:44 +0000 (13:19 +0200)]
s3:winbind: Change num_gids from int to uint32_t in winbindd_getgroups_state

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change max_groups, num_groups from int to uint32_t in getpwent_state
Pavel Filipenský [Thu, 14 Jul 2022 11:19:44 +0000 (13:19 +0200)]
s3:winbind: Change max_groups, num_groups from int to uint32_t in getpwent_state

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change num_groups, next_group from int to uint32_t in wb_group_members.c
Pavel Filipenský [Thu, 14 Jul 2022 11:19:43 +0000 (13:19 +0200)]
s3:winbind: Change num_groups, next_group from int to uint32_t in wb_group_members.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change num_groups from int to uint32_t in wb_query_group_list_recv()
Pavel Filipenský [Thu, 14 Jul 2022 11:19:44 +0000 (13:19 +0200)]
s3:winbind: Change num_groups from int to uint32_t in wb_query_group_list_recv()

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change num_received, num_domains from int to uint32_t in winbindd_list_gr...
Pavel Filipenský [Thu, 14 Jul 2022 11:19:44 +0000 (13:19 +0200)]
s3:winbind: Change num_received, num_domains from int to uint32_t in winbindd_list_groups_state

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change num_sids from int to uint32_t in wb_lookupusergroups_recv()
Pavel Filipenský [Mon, 11 Jul 2022 20:41:46 +0000 (22:41 +0200)]
s3:winbind: Change num_sids from int to uint32_t in wb_lookupusergroups_recv()

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change num_sids from int to uint32_t in wb_lookupuseraliases_send()
Pavel Filipenský [Mon, 11 Jul 2022 20:39:06 +0000 (22:39 +0200)]
s3:winbind: Change num_sids from int to uint32_t in wb_lookupuseraliases_send()

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Change num_sids from int to uint32_t in wb_gettoken_recv()
Pavel Filipenský [Mon, 11 Jul 2022 19:40:08 +0000 (21:40 +0200)]
s3:winbind: Change num_sids from int to uint32_t in wb_gettoken_recv()

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Fix trailing whitespace in winbindd.h
Pavel Filipenský [Thu, 14 Jul 2022 11:44:16 +0000 (13:44 +0200)]
s3:winbind: Fix trailing whitespace in winbindd.h

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_sids2xids.c
Pavel Filipenský [Tue, 7 Jun 2022 17:42:37 +0000 (19:42 +0200)]
s3:winbind: Improve logging in wb_sids2xids.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_query_user_list.c
Pavel Filipenský [Fri, 24 Jun 2022 13:31:03 +0000 (15:31 +0200)]
s3:winbind: Improve logging in wb_query_user_list.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_queryuser.c
Pavel Filipenský [Tue, 7 Jun 2022 17:35:16 +0000 (19:35 +0200)]
s3:winbind: Improve logging in wb_queryuser.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_query_group_list.c
Pavel Filipenský [Fri, 24 Jun 2022 13:41:21 +0000 (15:41 +0200)]
s3:winbind: Improve logging in wb_query_group_list.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_next_pwent.c
Pavel Filipenský [Wed, 22 Jun 2022 18:18:35 +0000 (20:18 +0200)]
s3:winbind: Improve logging in wb_next_pwent.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_next_grent.c
Pavel Filipenský [Fri, 24 Jun 2022 13:10:39 +0000 (15:10 +0200)]
s3:winbind: Improve logging in wb_next_grent.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_lookupusergroups.c
Pavel Filipenský [Sun, 19 Jun 2022 18:48:31 +0000 (20:48 +0200)]
s3:winbind: Improve logging in wb_lookupusergroups.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_lookupuseraliases.c
Pavel Filipenský [Tue, 7 Jun 2022 17:36:59 +0000 (19:36 +0200)]
s3:winbind: Improve logging in wb_lookupuseraliases.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_lookupsids.c
Pavel Filipenský [Sat, 11 Jun 2022 15:45:15 +0000 (17:45 +0200)]
s3:winbind: Improve logging in wb_lookupsids.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_lookupsid.c
Pavel Filipenský [Tue, 7 Jun 2022 17:36:16 +0000 (19:36 +0200)]
s3:winbind: Improve logging in wb_lookupsid.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_lookupname.c
Pavel Filipenský [Wed, 22 Jun 2022 21:39:52 +0000 (23:39 +0200)]
s3:winbind: Improve logging in wb_lookupname.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_group_members.c
Pavel Filipenský [Thu, 23 Jun 2022 08:40:53 +0000 (10:40 +0200)]
s3:winbind: Improve logging in wb_group_members.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_gettoken.c
Pavel Filipenský [Tue, 7 Jun 2022 17:33:57 +0000 (19:33 +0200)]
s3:winbind: Improve logging in wb_gettoken.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_getpwsid.c
Pavel Filipenský [Mon, 20 Jun 2022 13:05:21 +0000 (15:05 +0200)]
s3:winbind: Improve logging in wb_getpwsid.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_getgrsid.c
Pavel Filipenský [Fri, 24 Jun 2022 13:04:46 +0000 (15:04 +0200)]
s3:winbind: Improve logging in wb_getgrsid.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in wb_dsgetdcname.c
Pavel Filipenský [Fri, 24 Jun 2022 13:05:09 +0000 (15:05 +0200)]
s3:winbind: Improve logging in wb_dsgetdcname.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in samlogon_cache.c
Pavel Filipenský [Sat, 11 Jun 2022 15:44:30 +0000 (17:44 +0200)]
s3:winbind: Improve logging in samlogon_cache.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_xids_to_sids.c
Pavel Filipenský [Fri, 24 Jun 2022 10:12:30 +0000 (12:12 +0200)]
s3:winbind: Improve logging in winbindd_xids_to_sids.c

Test scenario in ad_dc:local test environment:
bin/wbinfo --unix-ids-to-sids=u100000

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_wins_byname.c
Pavel Filipenský [Fri, 24 Jun 2022 11:01:23 +0000 (13:01 +0200)]
s3:winbind: Improve logging in winbindd_wins_byname.c

Test scenario:
$  bin/wbinfo --WINS-by-name=ADDC

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_wins_byip.c
Pavel Filipenský [Fri, 24 Jun 2022 11:07:42 +0000 (13:07 +0200)]
s3:winbind: Improve logging in winbindd_wins_byip.c

Test scenario:
$ bin/wbinfo --WINS-by-ip=10.53.57.30

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_sids_to_xids.c
Pavel Filipenský [Fri, 24 Jun 2022 11:14:27 +0000 (13:14 +0200)]
s3:winbind: Improve logging in winbindd_sids_to_xids.c

Test scenario:
bin/wbinfo --sid-to-uid=S-1-5-21-1961314572-195468382-2567644205-1107

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_setpwent.c
Pavel Filipenský [Fri, 24 Jun 2022 08:44:54 +0000 (10:44 +0200)]
s3:winbind: Improve logging in winbindd_setpwent.c

Test scenario:
$ getent passwd

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_setgrent.c
Pavel Filipenský [Fri, 24 Jun 2022 08:43:33 +0000 (10:43 +0200)]
s3:winbind: Improve logging in winbindd_setgrent.c

Test scenario:
id ADDOMAIN/alice

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_pam_logoff.c
Pavel Filipenský [Fri, 24 Jun 2022 12:51:07 +0000 (14:51 +0200)]
s3:winbind: Improve logging in winbindd_pam_logoff.c

Test scenario:
$ bin/wbinfo --logoff

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_pam_auth.c
Pavel Filipenský [Fri, 24 Jun 2022 12:29:35 +0000 (14:29 +0200)]
s3:winbind: Improve logging in winbindd_pam_auth.c

Test scenario:
$ bin/wbinfo --pam-logon=ADDOMAIN/alice%Secret007

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_lookupname.c
Pavel Filipenský [Fri, 24 Jun 2022 11:32:52 +0000 (13:32 +0200)]
s3:winbind: Improve logging in winbindd_lookupname.c

Test scenario:
bin/wbinfo --name-to-sid=ADDOMAIN/alice

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_list_users.c
Pavel Filipenský [Fri, 24 Jun 2022 09:10:24 +0000 (11:10 +0200)]
s3:winbind: Improve logging in winbindd_list_users.c

Test scenario:
$ bin/wbinfo -u

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_list_groups.c
Pavel Filipenský [Fri, 24 Jun 2022 10:25:16 +0000 (12:25 +0200)]
s3:winbind: Improve logging in winbindd_list_groups.c

Test scenario:
$ bin/wbinfo -g

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_getuserdomgroups.c
Pavel Filipenský [Thu, 5 Aug 2021 13:06:04 +0000 (15:06 +0200)]
s3:winbind: Improve logging in winbindd_getuserdomgroups.c

Test scenario:
$ bin/wbinfo --user-domgroups `bin/wbinfo -n ADDOMAIN/alice | awk '{print $1}'`
S-1-5-21-2260029349-2102976898-3003119-1107
S-1-5-21-2260029349-2102976898-3003119-513

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_getsidaliases.c
Pavel Filipenský [Thu, 5 Aug 2021 12:51:02 +0000 (14:51 +0200)]
s3:winbind: Improve logging in winbindd_getsidaliases.c

Test scenario:
$ bin/wbinfo --sid-aliases S-1-5-21-4248687961-4152985382-2800071106-1107

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_getpwuid.c
Pavel Filipenský [Thu, 5 Aug 2021 12:38:37 +0000 (14:38 +0200)]
s3:winbind: Improve logging in winbindd_getpwuid.c

Test scenario:
$ bin/wbinfo --uid-info 2001107
or
$ bin/wbinfo --uid-info 100000

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
22 months agos3:winbind: Improve logging in winbindd_getpwsid.c
Pavel Filipenský [Thu, 5 Aug 2021 12:21:23 +0000 (14:21 +0200)]
s3:winbind: Improve logging in winbindd_getpwsid.c

Test scenario:

$ bin/wbinfo --name-to-sid ADDOMAIN/alice
S-1-5-21-4248687961-4152985382-2800071106-1107 SID_USER (1)

$ bin/wbinfo --user-sidinfo S-1-5-21-4248687961-4152985382-2800071106-1107
ADDOMAIN/alice:*:2001107:2000513::/home/ADDOMAIN/alice:/bin/false

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>