]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 years agotestdata: Fix spelling
Joseph Sutton [Fri, 22 Sep 2023 00:09:05 +0000 (12:09 +1200)] 
testdata: Fix spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoscript: Fix code spelling
Joseph Sutton [Fri, 22 Sep 2023 00:08:03 +0000 (12:08 +1200)] 
script: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:torture: Fix code spelling
Joseph Sutton [Sun, 8 Oct 2023 23:09:01 +0000 (12:09 +1300)] 
s4:torture: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:rpc_server: Fix code spelling
Joseph Sutton [Thu, 21 Sep 2023 21:16:18 +0000 (09:16 +1200)] 
s4:rpc_server: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:ntvfs: Fix code spelling
Joseph Sutton [Thu, 5 Oct 2023 22:42:30 +0000 (11:42 +1300)] 
s4:ntvfs: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:librpc: Fix code spelling
Joseph Sutton [Tue, 26 Sep 2023 23:39:31 +0000 (12:39 +1300)] 
s4:librpc: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:lib: Fix code spelling
Joseph Sutton [Thu, 21 Sep 2023 21:16:04 +0000 (09:16 +1200)] 
s4:lib: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Fix code spelling
Joseph Sutton [Mon, 16 Oct 2023 22:21:00 +0000 (11:21 +1300)] 
s4:kdc: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Fix code spelling
Joseph Sutton [Sun, 8 Oct 2023 23:48:15 +0000 (12:48 +1300)] 
s4:dsdb: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:auth: Fix code spelling
Joseph Sutton [Thu, 21 Sep 2023 20:08:03 +0000 (08:08 +1200)] 
s4:auth: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:utils: Fix code spelling
Joseph Sutton [Thu, 21 Sep 2023 21:15:50 +0000 (09:15 +1200)] 
s3:utils: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:smbd: Fix code spelling
Joseph Sutton [Fri, 20 Oct 2023 00:52:50 +0000 (13:52 +1300)] 
s3:smbd: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:rpc_server: Fix code spelling
Joseph Sutton [Wed, 4 Oct 2023 06:03:39 +0000 (19:03 +1300)] 
s3:rpc_server: Fix code spelling

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:libsmb: Fix code spelling
Joseph Sutton [Mon, 11 Sep 2023 00:51:16 +0000 (12:51 +1200)] 
s3:libsmb: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:libads: Fix code spelling
Joseph Sutton [Thu, 21 Sep 2023 01:47:37 +0000 (13:47 +1200)] 
s3:libads: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:lib: Fix code spelling
Joseph Sutton [Fri, 22 Sep 2023 00:08:10 +0000 (12:08 +1200)] 
s3:lib: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:auth: Add missing word to comment
Joseph Sutton [Tue, 19 Sep 2023 05:02:17 +0000 (17:02 +1200)] 
s3:auth: Add missing word to comment

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotests/krb5: Fix code spelling
Joseph Sutton [Fri, 22 Sep 2023 00:27:48 +0000 (12:27 +1200)] 
tests/krb5: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Fix code spelling
Joseph Sutton [Mon, 16 Oct 2023 03:08:45 +0000 (16:08 +1300)] 
python:tests: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopidl: Fix code spelling
Joseph Sutton [Wed, 20 Sep 2023 22:08:37 +0000 (10:08 +1200)] 
pidl: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc:ndr: Fix code spelling
Joseph Sutton [Wed, 20 Sep 2023 05:41:43 +0000 (17:41 +1200)] 
librpc:ndr: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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

2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>