dmulder/samba-autobuild/.git
6 months agosecurity.idl: Fix code spelling
Joseph Sutton [Tue, 19 Sep 2023 04:52:05 +0000 (16:52 +1200)]
security.idl: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agolibcli: Fix code spelling
Joseph Sutton [Fri, 22 Sep 2023 00:04:20 +0000 (12:04 +1200)]
libcli: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agolibcli/security: Fix code spelling
Joseph Sutton [Sun, 30 Jul 2023 22:14:48 +0000 (10:14 +1200)]
libcli/security: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agolib/util: Fix comment
Joseph Sutton [Thu, 21 Sep 2023 00:15:23 +0000 (12:15 +1200)]
lib/util: Fix comment

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agotevent: Fix code spelling
Joseph Sutton [Mon, 18 Sep 2023 03:24:45 +0000 (15:24 +1200)]
tevent: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agotalloc: Fix documentation
Joseph Sutton [Thu, 5 Oct 2023 00:58:04 +0000 (13:58 +1300)]
talloc: Fix documentation

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agolib/fuzzing: Fix code spelling
Joseph Sutton [Wed, 20 Sep 2023 03:54:49 +0000 (15:54 +1200)]
lib/fuzzing: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agoldb: Fix code spelling
Joseph Sutton [Mon, 16 Oct 2023 03:08:04 +0000 (16:08 +1300)]
ldb: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agoexamples: Fix code spelling
Joseph Sutton [Thu, 5 Oct 2023 23:35:52 +0000 (12:35 +1300)]
examples: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agodocs-xml: Fix documentation
Joseph Sutton [Tue, 10 Oct 2023 22:47:32 +0000 (11:47 +1300)]
docs-xml: Fix documentation

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agoauth: Fix code spelling
Joseph Sutton [Thu, 21 Sep 2023 20:07:45 +0000 (08:07 +1200)]
auth: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agoSECURITY.md: Fix spelling
Joseph Sutton [Mon, 9 Oct 2023 21:46:02 +0000 (10:46 +1300)]
SECURITY.md: Fix spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos4:kdc: Add device to Authenticated Users for RBCD conditions evaluation
Joseph Sutton [Wed, 25 Oct 2023 02:10:48 +0000 (15:10 +1300)]
s4:kdc: Add device to Authenticated Users for RBCD conditions evaluation

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos4:kdc: Add device to default groups for RBCD conditions evaluation
Joseph Sutton [Wed, 25 Oct 2023 01:56:41 +0000 (14:56 +1300)]
s4:kdc: Add device to default groups for RBCD conditions evaluation

This means that expressions like ‘Device_Member_of(WD)’ will now work,
as they should.

It *also* means that expressions like ‘Device_Member_of(NU)’ will work,
even though they shouldn’t. This is because we consider SID_NT_NETWORK
to be a default group.

Our new behaviour may be wrong, but at least it’s now consistent with
the behaviour of user‐relative expressions like ‘Member_of(WD)’ and
‘Member_of(NU)’.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agotests/krb5: Add tests for group membership with RBCD
Joseph Sutton [Wed, 25 Oct 2023 02:09:54 +0000 (15:09 +1300)]
tests/krb5: Add tests for group membership with RBCD

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agotests/krb5: Add more tests of the device belonging to certain groups
Joseph Sutton [Wed, 25 Oct 2023 01:59:27 +0000 (14:59 +1300)]
tests/krb5: Add more tests of the device belonging to certain groups

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agoselftest: Remove ubsan suppressions
Joseph Sutton [Tue, 24 Oct 2023 03:47:56 +0000 (16:47 +1300)]
selftest: Remove ubsan suppressions

These instances of undefined behaviour ought now to be fixed.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos4:ntvfs: Avoid signed integer overflow
Joseph Sutton [Mon, 4 Sep 2023 04:49:48 +0000 (16:49 +1200)]
s4:ntvfs: Avoid signed integer overflow

Signed integer overflow is undefined behaviour.

ubsan reports errors similar to the following:
signed integer overflow: 9223372036854775807 + 2147483682 cannot be represented in type 'long int'

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos4:dsdb:tests: Remove unnecessary f‐strings
Joseph Sutton [Tue, 24 Oct 2023 03:33:36 +0000 (16:33 +1300)]
s4:dsdb:tests: Remove unnecessary f‐strings

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:passdb: Fix code formatting
Joseph Sutton [Tue, 26 Sep 2023 23:39:14 +0000 (12:39 +1300)]
s3:passdb: Fix code formatting

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:libads: Update code reference in comment
Joseph Sutton [Thu, 21 Sep 2023 01:48:07 +0000 (13:48 +1200)]
s3:libads: Update code reference in comment

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agotests/krb5: Sort imports
Joseph Sutton [Tue, 24 Oct 2023 04:11:23 +0000 (17:11 +1300)]
tests/krb5: Sort imports

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agotests/krb5: Don’t pass parameters unnecessarily
Joseph Sutton [Tue, 24 Oct 2023 04:08:46 +0000 (17:08 +1300)]
tests/krb5: Don’t pass parameters unnecessarily

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython:tests: Remove unnecessary f‐strings
Joseph Sutton [Tue, 24 Oct 2023 03:32:31 +0000 (16:32 +1300)]
python:tests: Remove unnecessary f‐strings

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: Remove unnecessary f‐strings
Joseph Sutton [Mon, 2 Oct 2023 03:03:59 +0000 (16:03 +1300)]
python: Remove unnecessary f‐strings

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agolibcli/security: Fix leak on reallocation failure in conditional_ace_encode_binary()
Joseph Sutton [Wed, 20 Sep 2023 03:04:14 +0000 (15:04 +1200)]
libcli/security: Fix leak on reallocation failure in conditional_ace_encode_binary()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agolibcli/security: Fix leak on reallocation failure in pull_composite()
Joseph Sutton [Wed, 20 Sep 2023 03:03:28 +0000 (15:03 +1200)]
libcli/security: Fix leak on reallocation failure in pull_composite()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months ago.gitattributes: Treat file containing test SDDL as binary
Joseph Sutton [Thu, 17 Aug 2023 23:47:05 +0000 (11:47 +1200)]
.gitattributes: Treat file containing test SDDL as binary

This file contains some very long lines that can make it hard to grep
for things from the terminal.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agolib:param: Set a memory context for the globals if not initialized yet
Andreas Schneider [Tue, 5 Sep 2023 08:07:59 +0000 (10:07 +0200)]
lib:param: Set a memory context for the globals if not initialized yet

Typically once the smb.conf starts to be loaded,
loadparm_s3_init_globals() will be called and a memory context for
strings on the static Globals will be created.  But we might call
lpcfg_set_cmdline() before we load the smb.conf file, so we (via a
helper pointer) call loadparm_s3_init_globals() to get that
initialisation done earlier, ensuring that all allocations on Globals is
done on a memory context that we can later TALLOC_FREE() before exit().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:param: Make init_globals() public
Andreas Schneider [Tue, 24 Oct 2023 09:43:15 +0000 (11:43 +0200)]
s3:param: Make init_globals() public

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:param: Use the memory context we just created instead of tos
Andreas Schneider [Wed, 25 Oct 2023 10:15:09 +0000 (12:15 +0200)]
s3:param: Use the memory context we just created instead of tos

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:param: Use a talloc stackframe in pyparam
Andreas Schneider [Wed, 25 Oct 2023 10:26:44 +0000 (12:26 +0200)]
s3:param: Use a talloc stackframe in pyparam

Several parts of the code use talloc_tos() requiring a stackframe to be
present. This is needed as loadparm_init_s3() will call init_globals()
later.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:client: Call gfree_all() before exit in smbspool
Andreas Schneider [Tue, 24 Oct 2023 10:05:56 +0000 (12:05 +0200)]
s3:client: Call gfree_all() before exit in smbspool

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:client: Call gfree_all() before exit in smbclient
Andreas Schneider [Tue, 24 Oct 2023 09:54:00 +0000 (11:54 +0200)]
s3:client: Call gfree_all() before exit in smbclient

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in smbtree
Andreas Schneider [Tue, 24 Oct 2023 10:04:19 +0000 (12:04 +0200)]
s3:utils: Call gfree_all() before exit in smbtree

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all before exit in smbpasswd
Andreas Schneider [Tue, 24 Oct 2023 09:54:47 +0000 (11:54 +0200)]
s3:utils: Call gfree_all before exit in smbpasswd

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Remove trailing white spaces in smbpasswd.c
Andreas Schneider [Tue, 24 Oct 2023 09:56:24 +0000 (11:56 +0200)]
s3:utils: Remove trailing white spaces in smbpasswd.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in smbget
Andreas Schneider [Tue, 24 Oct 2023 10:03:40 +0000 (12:03 +0200)]
s3:utils: Call gfree_all() before exit in smbget

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in smbfilter
Andreas Schneider [Tue, 24 Oct 2023 10:03:12 +0000 (12:03 +0200)]
s3:utils: Call gfree_all() before exit in smbfilter

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Remove trailing white spaces in smbfilter.c
Andreas Schneider [Tue, 24 Oct 2023 10:02:50 +0000 (12:02 +0200)]
s3:utils: Remove trailing white spaces in smbfilter.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in smbcquotas
Andreas Schneider [Tue, 24 Oct 2023 10:01:58 +0000 (12:01 +0200)]
s3:utils: Call gfree_all() before exit in smbcquotas

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in smbcontrol
Andreas Schneider [Tue, 24 Oct 2023 10:01:24 +0000 (12:01 +0200)]
s3:utils: Call gfree_all() before exit in smbcontrol

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in smbcacls
Andreas Schneider [Tue, 24 Oct 2023 10:00:46 +0000 (12:00 +0200)]
s3:utils: Call gfree_all() before exit in smbcacls

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in sharesec
Andreas Schneider [Tue, 24 Oct 2023 10:00:16 +0000 (12:00 +0200)]
s3:utils: Call gfree_all() before exit in sharesec

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in regedit
Andreas Schneider [Tue, 24 Oct 2023 09:59:35 +0000 (11:59 +0200)]
s3:utils: Call gfree_all() before exit in regedit

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in pdbedit
Andreas Schneider [Tue, 24 Oct 2023 09:58:49 +0000 (11:58 +0200)]
s3:utils: Call gfree_all() before exit in pdbedit

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in ntlm_auth
Andreas Schneider [Tue, 24 Oct 2023 09:58:10 +0000 (11:58 +0200)]
s3:utils: Call gfree_all() before exit in ntlm_auth

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:utils: Call gfree_all() before exit in net
Andreas Schneider [Tue, 24 Oct 2023 09:57:14 +0000 (11:57 +0200)]
s3:utils: Call gfree_all() before exit in net

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:rpc_server: Correctly reset DEVMODE bit
Joseph Sutton [Wed, 4 Oct 2023 03:57:50 +0000 (16:57 +1300)]
s3:rpc_server: Correctly reset DEVMODE bit

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct 25 21:40:33 UTC 2023 on atb-devel-224

6 months agopython: getopt: HostOptions and other option groups inherit from samba OptionGroup...
Rob van der Linde [Fri, 20 Oct 2023 01:46:40 +0000 (14:46 +1300)]
python: getopt: HostOptions and other option groups inherit from samba OptionGroup class

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Oct 25 00:31:37 UTC 2023 on atb-devel-224

6 months agonetcmd: auth policy: add OptionGroup classes for user, service and computer options
Rob van der Linde [Tue, 10 Oct 2023 10:31:33 +0000 (23:31 +1300)]
netcmd: auth policy: add OptionGroup classes for user, service and computer options

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: netcmd: make use of HostOptions for claims and sites commands
Rob van der Linde [Fri, 6 Oct 2023 02:49:27 +0000 (15:49 +1300)]
python: netcmd: make use of HostOptions for claims and sites commands

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: getopt: Add HostOptions to avoid need to manually add -H
Rob van der Linde [Fri, 6 Oct 2023 02:47:43 +0000 (15:47 +1300)]
python: getopt: Add HostOptions to avoid need to manually add -H

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: netcmd: make use of required flag on Option for claims commands
Rob van der Linde [Fri, 6 Oct 2023 01:50:32 +0000 (14:50 +1300)]
python: netcmd: make use of required flag on Option for claims commands

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: getopt: implement required flag on options and OptionParser
Rob van der Linde [Thu, 5 Oct 2023 23:58:46 +0000 (12:58 +1300)]
python: getopt: implement required flag on options and OptionParser

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: getopt: subclass OptionParser to populate option_class
Rob van der Linde [Thu, 19 Oct 2023 02:05:56 +0000 (15:05 +1300)]
python: getopt: subclass OptionParser to populate option_class

The option_class needs to be set correctly for OptionGroups that use self.add_option

Override OptionParser `__init__` to change the default Option class to the samba one.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agonetcmd: tests: stop checking for ERROR prefix from CommandError
Rob van der Linde [Thu, 19 Oct 2023 01:26:46 +0000 (14:26 +1300)]
netcmd: tests: stop checking for ERROR prefix from CommandError

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: netcmd: remove OptionError alias to OptionValueError
Rob van der Linde [Thu, 5 Oct 2023 23:45:35 +0000 (12:45 +1300)]
python: netcmd: remove OptionError alias to OptionValueError

The other methods in this file already raise optparse.OptionValueError
directly, except for two older ones.

They are using an alias which changes the name to OptionError, the
confusing part about this is that optparse.OptionError actually does
exist, so the incorrect alias needs to be removed.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: netcmd: catch parent exception class OptParseError instead
Rob van der Linde [Thu, 5 Oct 2023 23:39:30 +0000 (12:39 +1300)]
python: netcmd: catch parent exception class OptParseError instead

This covers both OptionError and OptionValueError

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: getopt: rename SambaOption to Option
Rob van der Linde [Thu, 5 Oct 2023 03:26:40 +0000 (16:26 +1300)]
python: getopt: rename SambaOption to Option

 * Nothing uses SambaOption directly, everything imports it through samba.netcmd.Option
 * Avoid an unnecessary rename on import

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: netcmd: parser class in getSamDB should set option_class
Rob van der Linde [Thu, 5 Oct 2023 03:00:36 +0000 (16:00 +1300)]
python: netcmd: parser class in getSamDB should set option_class

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: netcmd: fix import grouping and sorting in base first
Rob van der Linde [Thu, 5 Oct 2023 02:52:54 +0000 (15:52 +1300)]
python: netcmd: fix import grouping and sorting in base first

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: netcmd: remove redundant Option subclass
Rob van der Linde [Thu, 5 Oct 2023 02:22:58 +0000 (15:22 +1300)]
python: netcmd: remove redundant Option subclass

Instead, just import SambaOption as Option, so all the existing commands don't need changing.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: netcmd: SUPPRESS_HELP constant has no effect here
Rob van der Linde [Thu, 5 Oct 2023 02:18:32 +0000 (15:18 +1300)]
python: netcmd: SUPPRESS_HELP constant has no effect here

Where it is used, on a few options, the constant should be used
directly instead.

This means that in the following commit, the Option subclass of
SambaOption can be removed, as it will become redundant.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: netcmd: dbcheck: fix import grouping and order
Rob van der Linde [Thu, 5 Oct 2023 02:13:45 +0000 (15:13 +1300)]
python: netcmd: dbcheck: fix import grouping and order

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: netcmd: ntacl: fix import grouping and order
Rob van der Linde [Thu, 5 Oct 2023 02:10:06 +0000 (15:10 +1300)]
python: netcmd: ntacl: fix import grouping and order

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: tests: fix some hidden tab characters in tests.py
Rob van der Linde [Thu, 5 Oct 2023 01:47:46 +0000 (14:47 +1300)]
python: tests: fix some hidden tab characters in tests.py

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: add docstrings to Validator and ValidationError
Rob van der Linde [Thu, 5 Oct 2023 01:33:32 +0000 (14:33 +1300)]
python: add docstrings to Validator and ValidationError

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: move Validator base class and ValidationError to getopt
Rob van der Linde [Thu, 5 Oct 2023 01:30:20 +0000 (14:30 +1300)]
python: move Validator base class and ValidationError to getopt

It makes more sense for these to exist in the top package, because they are used by SambaOption.

validators.py can still exist in netcmd, just not the base class and exception.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: getopt: move validators logic to parent class
Rob van der Linde [Thu, 5 Oct 2023 01:17:01 +0000 (14:17 +1300)]
python: getopt: move validators logic to parent class

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agonetcmd: don't turn exception into CommandError in run_validators
Rob van der Linde [Thu, 5 Oct 2023 01:03:14 +0000 (14:03 +1300)]
netcmd: don't turn exception into CommandError in run_validators

It's the wrong place to do it.

Instead, let it raise the original exception, capture it in _run, and
call existing show_command_error method.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agonetcmd: PEP8: minor whitespace fix, file did not pass PEP8
Rob van der Linde [Thu, 5 Oct 2023 00:47:11 +0000 (13:47 +1300)]
netcmd: PEP8: minor whitespace fix, file did not pass PEP8

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agonetcmd: move comment above class to docstring
Rob van der Linde [Thu, 5 Oct 2023 00:42:14 +0000 (13:42 +1300)]
netcmd: move comment above class to docstring

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agonetcmd: correctly pass Samba option class to OptionParser
Rob van der Linde [Wed, 4 Oct 2023 23:05:17 +0000 (12:05 +1300)]
netcmd: correctly pass Samba option class to OptionParser

On OptionGroups it will set option_class and then this gets used by self.add_option

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: getopt: move SambaOption to the top of the file
Rob van der Linde [Wed, 4 Oct 2023 22:32:30 +0000 (11:32 +1300)]
python: getopt: move SambaOption to the top of the file

This is needed for the next commit

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: getopt: correctly group and sort imports
Rob van der Linde [Wed, 4 Oct 2023 22:50:22 +0000 (11:50 +1300)]
python: getopt: correctly group and sort imports

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: getopt: update super calls to python3 style
Rob van der Linde [Wed, 4 Oct 2023 22:48:14 +0000 (11:48 +1300)]
python: getopt: update super calls to python3 style

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: move comment for check_bytes to docstring
Rob van der Linde [Wed, 4 Oct 2023 22:29:59 +0000 (11:29 +1300)]
python: move comment for check_bytes to docstring

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agopython: PEP8 fixup whitespace in getopt.py first
Rob van der Linde [Wed, 4 Oct 2023 22:27:40 +0000 (11:27 +1300)]
python: PEP8 fixup whitespace in getopt.py first

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agonetcmd: tests: make check_run and related methods classmethod for consistency
Rob van der Linde [Mon, 2 Oct 2023 05:32:29 +0000 (18:32 +1300)]
netcmd: tests: make check_run and related methods classmethod for consistency

Before that only run_command was turned into a @classmethod, but not
the other related methods which were left unchanged, this made it
inconsistent.

Some of these methods need to be called from setUpTestData so they
really need to be @classmethod anyway.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agotests: minor indentation and whitespace fixes
Rob van der Linde [Mon, 2 Oct 2023 05:27:39 +0000 (18:27 +1300)]
tests: minor indentation and whitespace fixes

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agosmbtorture: add test for fruit:validate_afpinfo option
Ralph Boehme [Fri, 20 Oct 2023 13:45:31 +0000 (15:45 +0200)]
smbtorture: add test for fruit:validate_afpinfo option

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 24 22:30:06 UTC 2023 on atb-devel-224

6 months agovfs_fruit: add option fruit:validate_afpinfo = yes|no (default: yes)
Ralph Boehme [Tue, 4 Jul 2023 15:46:40 +0000 (17:46 +0200)]
vfs_fruit: add option fruit:validate_afpinfo = yes|no (default: yes)

Allows disabling validation of AfpInfo stream data. It seems in data migration
scenarios from other SMB servers to Samba with fruit, somehow such invalid
streams are present on the source SMB server and can't be copied to Samba.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 months agos4:torture: Produce more output to help debug smb2.multichannel.bugs.bug_15346
Joseph Sutton [Thu, 19 Oct 2023 00:25:03 +0000 (13:25 +1300)]
s4:torture: Produce more output to help debug smb2.multichannel.bugs.bug_15346

Print the time (as reckoned by tevent) at which each ‘negprot done’ and
‘echo done’ message is produced, and print another message if one of the
requests times out.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Oct 24 15:51:40 UTC 2023 on atb-devel-224

6 months agolib/torture: Add torture_assert_size_*() macros
Joseph Sutton [Wed, 18 Oct 2023 23:34:53 +0000 (12:34 +1300)]
lib/torture: Add torture_assert_size_*() macros

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agolib/torture: Use portable format specifiers
Joseph Sutton [Wed, 18 Oct 2023 23:34:30 +0000 (12:34 +1300)]
lib/torture: Use portable format specifiers

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agoclang-format: sort alphabetically
Ralph Boehme [Fri, 30 Jun 2023 15:05:46 +0000 (17:05 +0200)]
clang-format: sort alphabetically

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 24 14:47:57 UTC 2023 on atb-devel-224

6 months agoclang-format: tweak config to bring us closer to README.Coding.
Ralph Boehme [Fri, 30 Jun 2023 11:00:23 +0000 (13:00 +0200)]
clang-format: tweak config to bring us closer to README.Coding.

I'm enabling "AllowAllArgumentsOnNextLine" because that's longstanding practice
with many many function calls like tevent_req_callback_data() and
tevent_req_data() and imho results in the most readable code at the place where
this is often seen (variable declartions with tevent_req_* stuff).

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3:/winbindd: remove parse_domain_user_fstr
Noel Power [Mon, 23 Oct 2023 14:12:39 +0000 (15:12 +0100)]
s3:/winbindd: remove parse_domain_user_fstr

Last caller of parse_domain_user_fstr has been removed so
we can safely remove the function

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Oct 24 13:47:16 UTC 2023 on atb-devel-224

6 months agos3/winbindd: use parse_domain_user instead of parse_domain_user_fstr
Noel Power [Mon, 23 Oct 2023 14:09:25 +0000 (15:09 +0100)]
s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr

In canonicalize_username replace use of parse_domain_user_fstr
with parse_domain_user

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3/winbindd: replace use of parse_domain_user_fstr with parse_domain_user
Noel Power [Fri, 20 Oct 2023 11:36:35 +0000 (12:36 +0100)]
s3/winbindd: replace use of parse_domain_user_fstr with parse_domain_user

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3/winbindd: replace parse_domain_user_fn with parse_domain_user
Noel Power [Fri, 20 Oct 2023 11:22:10 +0000 (12:22 +0100)]
s3/winbindd: replace parse_domain_user_fn with parse_domain_user

In winbindd_getgrnam_send use parse_domain_user instead of
parse_domain_user_fstr

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3/winbindd: use parse_domain_user instead of parse_domain_user_fstr
Noel Power [Fri, 20 Oct 2023 11:10:37 +0000 (12:10 +0100)]
s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr

In winbindd_ccache_ntlm_auth replace use of parse_domain_user_fstr
with parse_domain_user

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3/winbindd: use parse_domain_user instead of parse_domain_user_fstr
Noel Power [Fri, 20 Oct 2023 11:09:17 +0000 (12:09 +0100)]
s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr

in winbindd_getpwnam_send replace parse_domain_user_fstr with
parse_domain_user

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3/winbindd: use parse_domain_user_fstr instead of parse_domain_user
Noel Power [Fri, 20 Oct 2023 10:53:10 +0000 (11:53 +0100)]
s3/winbindd: use parse_domain_user_fstr instead of parse_domain_user

in winbindd_getgroups_send replace parse_domain_user_fstr
with parse_domain_user

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3/winbindd: Add new parse_domain_user function
Noel Power [Fri, 20 Oct 2023 10:46:56 +0000 (11:46 +0100)]
s3/winbindd: Add new parse_domain_user function

Adds a new parse_domain_user function which doesn't use fstrings
but instead uses talloc allocated out strings (created from passed in
ctx)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3/winbindd: rename parse_domain_user to parse_domain_user_fstr
Noel Power [Sat, 21 Oct 2023 20:35:06 +0000 (21:35 +0100)]
s3/winbindd: rename parse_domain_user to parse_domain_user_fstr

prepare to port parse_domain_user function to not use fstrings.
rename function parse_domain_user (and all callers) to use
parse_domain_user_fstr

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3/winbindd: remove canonicalize_username_fstr
Noel Power [Sat, 21 Oct 2023 11:41:39 +0000 (12:41 +0100)]
s3/winbindd: remove canonicalize_username_fstr

not longer any callers to canonicalize_username_fstr so it
can be removed

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3/winbindd: in winbindd_pam_chauthtok_send use canonicalize_username
Noel Power [Sat, 21 Oct 2023 20:29:34 +0000 (21:29 +0100)]
s3/winbindd: in winbindd_pam_chauthtok_send use canonicalize_username

replace use of canonicalize_username_fstr with canonicalize_username

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 months agos3/winbindd: in winbindd_pam_auth_send use canonicalize_username
Noel Power [Sat, 21 Oct 2023 11:24:01 +0000 (12:24 +0100)]
s3/winbindd: in winbindd_pam_auth_send use canonicalize_username

replace use of canonicalize_username_fstr with canonicalize_username

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>