]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 years agos4:dsdb: Add search flag indicating that gMSA passwords are to be updated
Jo Sutton [Mon, 12 Feb 2024 22:51:35 +0000 (11:51 +1300)] 
s4:dsdb: Add search flag indicating that gMSA passwords are to be updated

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Include missing headers
Jo Sutton [Mon, 12 Feb 2024 22:51:19 +0000 (11:51 +1300)] 
s4:dsdb: Include missing headers

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Add dsdb control indicating that gMSA passwords are to be updated
Jo Sutton [Mon, 12 Feb 2024 22:25:33 +0000 (11:25 +1300)] 
s4:dsdb: Add dsdb control indicating that gMSA passwords are to be updated

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:setup: Remove empty line
Jo Sutton [Mon, 12 Feb 2024 22:26:08 +0000 (11:26 +1300)] 
s4:setup: Remove empty line

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Fix code formatting
Jo Sutton [Mon, 12 Feb 2024 03:58:41 +0000 (16:58 +1300)] 
s4:dsdb: Fix code formatting

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Add ‘ares’ parameter to operational attribute constructor functions
Jo Sutton [Mon, 12 Feb 2024 03:56:59 +0000 (16:56 +1300)] 
s4:dsdb: Add ‘ares’ parameter to operational attribute constructor functions

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Make array static
Jo Sutton [Mon, 12 Feb 2024 03:50:39 +0000 (16:50 +1300)] 
s4:dsdb: Make array static

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Remove trailing whitespace
Jo Sutton [Mon, 12 Feb 2024 03:49:44 +0000 (16:49 +1300)] 
s4:dsdb: Remove trailing whitespace

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Remove duplicate word
Jo Sutton [Tue, 16 Jan 2024 02:48:43 +0000 (15:48 +1300)] 
s4:dsdb: Remove duplicate word

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agomailmap: Associate my identity with my old email address
Jo Sutton [Mon, 12 Feb 2024 23:32:19 +0000 (12:32 +1300)] 
mailmap: Associate my identity with my old email address

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Remove unused ‘domain_dn’ parameter
Jo Sutton [Fri, 19 Jan 2024 23:01:30 +0000 (12:01 +1300)] 
s4:dsdb: Remove unused ‘domain_dn’ parameter

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Remove reference to now‐gone lmNewHash parameter
Jo Sutton [Thu, 15 Feb 2024 01:12:07 +0000 (14:12 +1300)] 
s4:dsdb: Remove reference to now‐gone lmNewHash parameter

This parameter was removed in commit
75c54d54ad9fdff7098c1b4f11252528f35ea658.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Split out function to create a ‘password set’ ldb request
Jo Sutton [Fri, 19 Jan 2024 23:00:27 +0000 (12:00 +1300)] 
s4:dsdb: Split out function to create a ‘password set’ ldb request

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Allocate NT hash on to more appropriate memory context
Jo Sutton [Mon, 12 Feb 2024 03:25:10 +0000 (16:25 +1300)] 
s4:dsdb: Allocate NT hash on to more appropriate memory context

The NT hash should live at least as long as the message to which it is
added.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Undefine helper macro
Jo Sutton [Fri, 19 Jan 2024 22:58:45 +0000 (11:58 +1300)] 
s4:dsdb: Undefine helper macro

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Check return value of talloc_new()
Jo Sutton [Fri, 19 Jan 2024 00:33:09 +0000 (13:33 +1300)] 
s4:dsdb: Check return value of talloc_new()

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Remove unused imports
Jo Sutton [Wed, 17 Jan 2024 21:01:49 +0000 (10:01 +1300)] 
python:tests: Remove unused imports

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Remove ‘attrs’ parameter from samba_kdc_lookup_server()
Jo Sutton [Wed, 17 Jan 2024 00:13:56 +0000 (13:13 +1300)] 
s4:kdc: Remove ‘attrs’ parameter from samba_kdc_lookup_server()

It is always equal to ‘server_attrs’.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:compression: Update my name
Jo Sutton [Wed, 7 Feb 2024 21:55:32 +0000 (10:55 +1300)] 
lib:compression: Update my name

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython: Reformat nt_time.py
Jo Sutton [Fri, 2 Feb 2024 00:11:22 +0000 (13:11 +1300)] 
python: Reformat nt_time.py

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoldb: Fix code spelling
Jo Sutton [Wed, 24 Jan 2024 21:28:31 +0000 (10:28 +1300)] 
ldb: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoldb: Simplify ldb_errstring()
Jo Sutton [Wed, 24 Jan 2024 01:19:26 +0000 (14:19 +1300)] 
ldb: Simplify ldb_errstring()

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoldb: Remove trailing whitespace
Jo Sutton [Wed, 24 Jan 2024 01:19:11 +0000 (14:19 +1300)] 
ldb: Remove trailing whitespace

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:util: Remove inaccurate comment
Jo Sutton [Fri, 19 Jan 2024 20:53:20 +0000 (09:53 +1300)] 
lib:util: Remove inaccurate comment

A C compiler would not be allowed to apply the tail call optimization in
this situation, because it would change the observed behaviour of the
program.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:libads: Remove ‘unicodePwd’ attribute from ads_find_machine_acct() search
Jo Sutton [Thu, 18 Jan 2024 23:38:24 +0000 (12:38 +1300)] 
s3:libads: Remove ‘unicodePwd’ attribute from ads_find_machine_acct() search

This attribute was added to the search in commit
4f389c1f78cdc2424795e3b2a1ce43818c400c2d. But it’s not clear to me that
anything actually retrieves the unicodePwd from the result (excluding
inconsequential things like ads_dump()).

Furthermore, this being a search over LDAP, it will never return a
unicodePwd.

Removing this attribute from the search means that we no longer have to
worry about the account possibly being a Group Managed Service Account
and the unicodePwd being out‐of‐date.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotestprogs:blackbox: Fix code spelling
Jo Sutton [Fri, 19 Jan 2024 00:23:36 +0000 (13:23 +1300)] 
testprogs:blackbox: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agosamba-tool: Display friendlier error message if no password is available
Jo Sutton [Wed, 17 Jan 2024 22:26:34 +0000 (11:26 +1300)] 
samba-tool: Display friendlier error message if no password is available

‘samba-tool user get-kerberos-ticket’ is supposed to display an error
message if no password is available. However, the conditions for which
the message is displayed are impossible to be met. If ‘utf16_pw’ is not
None, the message is not displayed; if ‘utf16_pw’ *is* None, ‘nt_pass’
is assigned with a samr.Password object, which is not None — and so the
message is still not displayed.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Pass correct arguments to set_named_ccache()
Jo Sutton [Wed, 17 Jan 2024 21:55:55 +0000 (10:55 +1300)] 
python:tests: Pass correct arguments to set_named_ccache()

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Fix code spelling
Jo Sutton [Wed, 17 Jan 2024 21:48:44 +0000 (10:48 +1300)] 
python:tests: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Add helper functions to get GKDI root key DNs
Jo Sutton [Thu, 11 Jan 2024 00:52:27 +0000 (13:52 +1300)] 
s4:dsdb: Add helper functions to get GKDI root key DNs

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:crypto: Explicitly check for zero
Jo Sutton [Sun, 7 Jan 2024 20:48:44 +0000 (09:48 +1300)] 
lib:crypto: Explicitly check for zero

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:crypto: Comment on GKDI definitions
Jo Sutton [Tue, 9 Jan 2024 01:14:23 +0000 (14:14 +1300)] 
lib:crypto: Comment on GKDI definitions

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:crypto: Export gkid_key_type() and gkid_is_valid()
Jo Sutton [Tue, 9 Jan 2024 01:13:31 +0000 (14:13 +1300)] 
lib:crypto: Export gkid_key_type() and gkid_is_valid()

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:crypto: Fix code formatting
Jo Sutton [Fri, 22 Dec 2023 03:01:36 +0000 (16:01 +1300)] 
lib:crypto: Fix code formatting

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Produce more helpful error message for future GKIDs
Jo Sutton [Thu, 11 Jan 2024 00:49:58 +0000 (13:49 +1300)] 
python:tests: Produce more helpful error message for future GKIDs

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: models: add GroupManagedServiceAccount model
Rob van der Linde [Thu, 8 Feb 2024 10:25:14 +0000 (23:25 +1300)] 
netcmd: models: add GroupManagedServiceAccount model

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: models: add missing fields to User model
Rob van der Linde [Thu, 8 Feb 2024 10:17:34 +0000 (23:17 +1300)] 
netcmd: models: add missing fields to User model

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: models: add missing enum fields to Group model
Rob van der Linde [Thu, 8 Feb 2024 10:13:16 +0000 (23:13 +1300)] 
netcmd: models: add missing enum fields to Group model

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: models: make Group.system_flags a flags based EnumField
Rob van der Linde [Tue, 13 Feb 2024 00:17:24 +0000 (13:17 +1300)] 
netcmd: models: make Group.system_flags a flags based EnumField

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: models: add Computer model subclass of User
Rob van der Linde [Thu, 8 Feb 2024 10:02:11 +0000 (23:02 +1300)] 
netcmd: models: add Computer model subclass of User

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: models: stop using LookupError exception and change it to NotFound
Rob van der Linde [Thu, 8 Feb 2024 09:47:14 +0000 (22:47 +1300)] 
netcmd: models: stop using LookupError exception and change it to NotFound

LookupError is a base class for IndexError and KeyError and isn't really the appropriate exception.

NotFound inherits from ModelError just like the other model exceptions.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: models: rename DoesNotExist exception to NotFound
Rob van der Linde [Thu, 8 Feb 2024 09:34:46 +0000 (22:34 +1300)] 
netcmd: models: rename DoesNotExist exception to NotFound

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: models: SDDLField move line down where it gets used
Rob van der Linde [Mon, 12 Feb 2024 09:03:34 +0000 (22:03 +1300)] 
netcmd: models: SDDLField move line down where it gets used

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: models: SDDLField parses to object instead of string
Rob van der Linde [Mon, 12 Feb 2024 08:56:43 +0000 (21:56 +1300)] 
netcmd: models: SDDLField parses to object instead of string

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: delegation: don't use assert but raise CommandError
Rob van der Linde [Mon, 12 Feb 2024 03:13:13 +0000 (16:13 +1300)] 
netcmd: delegation: don't use assert but raise CommandError

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: delegation: initial value not required because of raise below
Rob van der Linde [Mon, 12 Feb 2024 03:04:08 +0000 (16:04 +1300)] 
netcmd: delegation: initial value not required because of raise below

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: delegation: move line down where it gets used
Rob van der Linde [Mon, 12 Feb 2024 03:02:22 +0000 (16:02 +1300)] 
netcmd: delegation: move line down where it gets used

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: delegation: pep8 fix blank lines
Rob van der Linde [Mon, 12 Feb 2024 02:59:32 +0000 (15:59 +1300)] 
netcmd: delegation: pep8 fix blank lines

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: bugfix: json encoder failed to call super method
Rob van der Linde [Thu, 8 Feb 2024 07:53:01 +0000 (20:53 +1300)] 
netcmd: bugfix: json encoder failed to call super method

This lead to a strange recursion error when a field came up that the JSONEncoder couldn't encode.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: json encoder supports security descriptor objects
Rob van der Linde [Mon, 12 Feb 2024 02:53:53 +0000 (15:53 +1300)] 
netcmd: json encoder supports security descriptor objects

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agonetcmd: support hyphens in top-level commands and convert to underscore
Rob van der Linde [Thu, 8 Feb 2024 10:33:09 +0000 (23:33 +1300)] 
netcmd: support hyphens in top-level commands and convert to underscore

Hyphens in python modules are invalid and makes them only importable by importlib, which makes them harder to import in tests.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agolibds: remove unreachable break statements after return
Rob van der Linde [Thu, 8 Feb 2024 07:30:31 +0000 (20:30 +1300)] 
libds: remove unreachable break statements after return

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2 years agodocs-xml: document "smb3 share cap:{CONTINUOUS AVAILABILITY,SCALE OUT,CLUSTER,ASYMMET...
Stefan Metzmacher [Thu, 8 Feb 2024 14:43:39 +0000 (15:43 +0100)] 
docs-xml: document "smb3 share cap:{CONTINUOUS AVAILABILITY,SCALE OUT,CLUSTER,ASYMMETRIC}"

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Feb 13 21:06:24 UTC 2024 on atb-devel-224

2 years agosmb2_tcon: only announce SMB3 related share capabilities if SMB3 is used
Stefan Metzmacher [Thu, 8 Feb 2024 14:31:10 +0000 (15:31 +0100)] 
smb2_tcon: only announce SMB3 related share capabilities if SMB3 is used

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 years agosmb2_tcon: only announce SMB2_SHARE_CAP_CLUSTER if rpcd_witness can run
Stefan Metzmacher [Thu, 8 Feb 2024 14:15:28 +0000 (15:15 +0100)] 
smb2_tcon: only announce SMB2_SHARE_CAP_CLUSTER if rpcd_witness can run

rpcd_witness needs ncacn_ip_tcp support and that's only
available if samba-dcerpcd is not started on demand.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 years agodocs-xml: add details for 'net witness'
Stefan Metzmacher [Thu, 8 Feb 2024 13:25:05 +0000 (14:25 +0100)] 
docs-xml: add details for 'net witness'

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 years agos3:utils: fix help string for 'net witness force-response'
Stefan Metzmacher [Thu, 8 Feb 2024 14:07:42 +0000 (15:07 +0100)] 
s3:utils: fix help string for 'net witness force-response'

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 years agoctdb/events: add 47.samba-dcerpcd.script
Stefan Metzmacher [Fri, 2 Feb 2024 12:54:20 +0000 (13:54 +0100)] 
ctdb/events: add 47.samba-dcerpcd.script

If someone wants to enable the witness service
samba-dcerpcd needs to be started as standalone service

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 years agoctdb/events: use 'service "$CTDB_SERVICE_NMB" status' in 48.netbios.script
Stefan Metzmacher [Fri, 2 Feb 2024 12:54:20 +0000 (13:54 +0100)] 
ctdb/events: use 'service "$CTDB_SERVICE_NMB" status' in 48.netbios.script

We can easily monitor if the service is running at all,
that better than no monitoring at all...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 years agoselftest: Fix code spelling
Jo Sutton [Fri, 12 Jan 2024 00:28:55 +0000 (13:28 +1300)] 
selftest: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb  8 03:51:51 UTC 2024 on atb-devel-224

2 years agos4:dsdb: Fix code formatting
Jo Sutton [Thu, 11 Jan 2024 22:39:11 +0000 (11:39 +1300)] 
s4:dsdb: Fix code formatting

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Avoid buffer overflow in samdb_result_hashes()
Jo Sutton [Thu, 11 Jan 2024 21:43:39 +0000 (10:43 +1300)] 
s4:dsdb: Avoid buffer overflow in samdb_result_hashes()

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Mark hash returned by samdb_result_hash() as secret
Jo Sutton [Thu, 11 Jan 2024 21:42:51 +0000 (10:42 +1300)] 
s4:dsdb: Mark hash returned by samdb_result_hash() as secret

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Correct reference to source file
Jo Sutton [Thu, 11 Jan 2024 02:05:22 +0000 (15:05 +1300)] 
s4:dsdb: Correct reference to source file

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Remove trailing whitespace
Jo Sutton [Thu, 11 Jan 2024 02:05:07 +0000 (15:05 +1300)] 
s4:dsdb: Remove trailing whitespace

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Correct NDR push error message
Jo Sutton [Mon, 8 Jan 2024 02:05:11 +0000 (15:05 +1300)] 
s4:dsdb: Correct NDR push error message

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Fix code spelling
Jo Sutton [Mon, 8 Jan 2024 02:04:47 +0000 (15:04 +1300)] 
s4:dsdb: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Remove trailing whitespace
Jo Sutton [Mon, 8 Jan 2024 02:04:17 +0000 (15:04 +1300)] 
s4:dsdb: Remove trailing whitespace

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:auth: Fix code spelling
Jo Sutton [Sun, 14 Jan 2024 21:23:51 +0000 (10:23 +1300)] 
s4:auth: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:libcli: Remove unnecessary uses of discard_const_p()
Jo Sutton [Fri, 8 Dec 2023 04:12:06 +0000 (17:12 +1300)] 
s4:libcli: Remove unnecessary uses of discard_const_p()

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Remove duplicate userAccountControl array entry
Jo Sutton [Sun, 7 Jan 2024 22:41:30 +0000 (11:41 +1300)] 
s4:dsdb: Remove duplicate userAccountControl array entry

This entry is identical to the third array entry.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:smbd: Fix code spelling
Jo Sutton [Tue, 9 Jan 2024 23:25:25 +0000 (12:25 +1300)] 
s3:smbd: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc:idl: Fix code spelling
Jo Sutton [Sun, 7 Jan 2024 23:30:11 +0000 (12:30 +1300)] 
librpc:idl: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc:idl: Remove trailing whitespace
Jo Sutton [Sun, 7 Jan 2024 23:29:50 +0000 (12:29 +1300)] 
librpc:idl: Remove trailing whitespace

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: Make ‘replace_sid’ parameter const
Jo Sutton [Tue, 9 Jan 2024 02:33:38 +0000 (15:33 +1300)] 
libcli/security: Make ‘replace_sid’ parameter const

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:util: Remove trailing whitespace
Jo Sutton [Mon, 4 Dec 2023 01:29:08 +0000 (14:29 +1300)] 
lib:util: Remove trailing whitespace

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoldb: Fix code spelling
Jo Sutton [Tue, 9 Jan 2024 23:01:26 +0000 (12:01 +1300)] 
ldb: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agondr: ignore trailing bytes in ndr_pull_security_ace()
Douglas Bagnall [Mon, 8 Jan 2024 02:05:35 +0000 (15:05 +1300)] 
ndr: ignore trailing bytes in ndr_pull_security_ace()

This returns the behaviour with ordinary ACEs to where it was with 4.19.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agondr: ndr_push_security_ace: calculate coda size once
Douglas Bagnall [Mon, 8 Jan 2024 01:50:30 +0000 (14:50 +1300)] 
ndr: ndr_push_security_ace: calculate coda size once

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agondr: avoid object ACE push overhead for non-object ACE
Douglas Bagnall [Sun, 31 Dec 2023 21:21:55 +0000 (10:21 +1300)] 
ndr: avoid object ACE push overhead for non-object ACE

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agondr: avoid object ACE pull overhead for non-object ACE
Douglas Bagnall [Sun, 31 Dec 2023 21:21:33 +0000 (10:21 +1300)] 
ndr: avoid object ACE pull overhead for non-object ACE

When an ACE is not an object ACE, which is common, setting the switch
value and attempting the object ACE GUID pull is just going to do
nothing, and we know that ahead of time. By noticing that we can save
a bit of time on a common operation.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agondr: do not push ACE->coda.ignored blob
Douglas Bagnall [Sun, 31 Dec 2023 04:45:36 +0000 (17:45 +1300)] 
ndr: do not push ACE->coda.ignored blob

From 1e80221b2340de5ef5e2a17f10511bbc2c041163 (2008) until
c73034cf7c4392f5d3505319948bc84634c20fa5 (conditional ACEs, etc, 2023)
we had a manual ndr_pull_security_ace() that would discard trailing
bytes, which are those bytes that we now call the coda. The ACE types
that we handled then are those that end up with a coda.ignored data
blob.

With this we effectively restore the long-standing behaviour in the
event that we push and pull an ACE -- though now we discard the
ignored bytes on push rather than pull.

This change is not because the trailing bytes caused any problems (as
far as is known), but because it is much faster to not do the push.

It may be that such ACEs no longer occur.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agondr: mark invalid pull ndr_flags as unlikely
Douglas Bagnall [Fri, 29 Dec 2023 02:27:08 +0000 (15:27 +1300)] 
ndr: mark invalid pull ndr_flags as unlikely

This might have little effect, but sometimes we see primatives like
ndr_pull_uint32() taking a few percent of the CPU time, and this is in
all those functions.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agondr: skip talloc when pulling empty DATA_BLOB
Douglas Bagnall [Fri, 29 Dec 2023 02:15:48 +0000 (15:15 +1300)] 
ndr: skip talloc when pulling empty DATA_BLOB

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agondr: ACE push avoids no-op coda pushes
Douglas Bagnall [Sun, 31 Dec 2023 04:39:23 +0000 (17:39 +1300)] 
ndr: ACE push avoids no-op coda pushes

We don't expect an ordinary ACE to have a non-empty coda, and we don't
really want to push it if it does, but for this patch we still will.

This will not change the data on the wire.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agondr: make security_ace push manual
Douglas Bagnall [Sun, 31 Dec 2023 04:30:47 +0000 (17:30 +1300)] 
ndr: make security_ace push manual

This will allow some optimisations; in this commit we just copy the
code.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agondr: short-circuit ace coda if no bytes left
Douglas Bagnall [Sun, 31 Dec 2023 00:06:40 +0000 (13:06 +1300)] 
ndr: short-circuit ace coda if no bytes left

The overwhelmingly common case is that there are no bytes left, and
regardless of the ACE type we want to store an empty blob.

We know the blob will be empty if there are no bytes, so we don't need
to allocate a sub-ndr and tokens list and so forth.

This can save almost half the time of a security descriptor pull.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agondr: shift ndr_pull_security_ace to manual code
Douglas Bagnall [Sun, 31 Dec 2023 00:03:32 +0000 (13:03 +1300)] 
ndr: shift ndr_pull_security_ace to manual code

This was manual until commit c73034cf7c4392f5d3505319948bc84634c20fa5
(a few months ago).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agopidl: calculate subcontext_size only once per pull
Douglas Bagnall [Thu, 28 Dec 2023 10:07:56 +0000 (23:07 +1300)] 
pidl: calculate subcontext_size only once per pull

For security_ace_coda in security.idl, the sub-context size is
involves a slightly non-trivial function call which returns a constant
value.

In all other cases, a constant expression is used, and this makes
no difference.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agoperftest: ndr_pack runs in none environment
Douglas Bagnall [Fri, 5 Jan 2024 00:19:39 +0000 (13:19 +1300)] 
perftest: ndr_pack runs in none environment

This is worth changing, because having a server running in the
background can only add noise to the results.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agoperftest:ndr_pack: spin in do_nothing for a while
Douglas Bagnall [Wed, 3 Jan 2024 12:54:29 +0000 (01:54 +1300)] 
perftest:ndr_pack: spin in do_nothing for a while

The idea was to get a less jittery idea of the underlying noise, but
ut is still almost instant. This I suppose is useful in indicating
that this much of the test has very little overhead.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agoperftest:ndr_pack: use a valid dummy SID
Douglas Bagnall [Wed, 3 Jan 2024 12:52:39 +0000 (01:52 +1300)] 
perftest:ndr_pack: use a valid dummy SID

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agoperftest:ndr_pack_performance: remove irrelevant imports, options
Douglas Bagnall [Wed, 3 Jan 2024 12:51:56 +0000 (01:51 +1300)] 
perftest:ndr_pack_performance: remove irrelevant imports, options

This includes removing the ANCIENT_SAMBA switch for pre-4.3, as
nobody cares anymore and many tests would not run correctly anyway.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agoperftest:ndr_pack: slightly reduce python overhead
Douglas Bagnall [Tue, 2 Jan 2024 20:43:01 +0000 (09:43 +1300)] 
perftest:ndr_pack: slightly reduce python overhead

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agoperftest: ndr_pack_performance gets more SD types
Douglas Bagnall [Mon, 1 Jan 2024 08:48:15 +0000 (21:48 +1300)] 
perftest: ndr_pack_performance gets more SD types

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agoperftest:ndr_pack: rename SD tests with object ACEs
Douglas Bagnall [Tue, 2 Jan 2024 20:26:51 +0000 (09:26 +1300)] 
perftest:ndr_pack: rename SD tests with object ACEs

We are looking at an optimisation for non-object ACEs, which
are more common, but these tests are overwhelmed by object
(OA) ACEs.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574

2 years agonetcmd: models: mark some hidden fields on the base Model as readonly
Rob van der Linde [Wed, 7 Feb 2024 00:53:03 +0000 (13:53 +1300)] 
netcmd: models: mark some hidden fields on the base Model as readonly

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: models: tests: add tests for NtTimeField
Rob van der Linde [Thu, 1 Feb 2024 22:30:14 +0000 (11:30 +1300)] 
netcmd: models: tests: add tests for NtTimeField

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: models: add new NtTimeField model field
Rob van der Linde [Thu, 1 Feb 2024 20:54:41 +0000 (09:54 +1300)] 
netcmd: models: add new NtTimeField model field

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: models: model field DateTimeField returns datetime in UTC
Rob van der Linde [Thu, 1 Feb 2024 20:54:08 +0000 (09:54 +1300)] 
netcmd: models: model field DateTimeField returns datetime in UTC

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>