samba.git
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

7 months 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>
7 months 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>
7 months 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>
7 months 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>
7 months agonetcmd: models: move enum import to correct place
Rob van der Linde [Thu, 1 Feb 2024 20:45:19 +0000 (09:45 +1300)]
netcmd: models: move enum import to correct place

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>
7 months agonetcmd: models: fix build_expression on SIDField handles security.dom_sid
Rob van der Linde [Wed, 7 Feb 2024 00:41:04 +0000 (13:41 +1300)]
netcmd: models: fix build_expression on SIDField handles security.dom_sid

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>
7 months agonetcmd: models: fix build_expression did not work with EnumField
Rob van der Linde [Thu, 18 Jan 2024 02:47:52 +0000 (15:47 +1300)]
netcmd: models: fix build_expression did not work with EnumField

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>
7 months agonetcmd: models: fix BooleanField filtering didn't work on FALSE value
Rob van der Linde [Thu, 1 Feb 2024 03:16:11 +0000 (16:16 +1300)]
netcmd: models: fix BooleanField filtering didn't work on FALSE value

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>
7 months agonetcmd: models: move expression code to Field class
Rob van der Linde [Thu, 1 Feb 2024 03:01:21 +0000 (16:01 +1300)]
netcmd: models: move expression code to Field class

This is necessary to deal with edge cases for specific fields.

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>
7 months agonetcmd: models: add AccountType enum to User model
Rob van der Linde [Thu, 18 Jan 2024 02:44:18 +0000 (15:44 +1300)]
netcmd: models: add AccountType enum to User model

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>
7 months agonetcmd: models: add AccountType IntFlag field
Rob van der Linde [Thu, 1 Feb 2024 03:53:17 +0000 (16:53 +1300)]
netcmd: models: add AccountType IntFlag 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>
7 months agonetcmd: models: EnumField now also supports IntFlag
Rob van der Linde [Thu, 1 Feb 2024 03:52:17 +0000 (16:52 +1300)]
netcmd: models: EnumField now also supports IntFlag

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>
7 months agonetcmd: models: check for None in build_expression instead
Rob van der Linde [Thu, 18 Jan 2024 02:37:44 +0000 (15:37 +1300)]
netcmd: models: check for None in build_expression instead

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>
7 months agonetcmd: models: change import style to use brackets
Rob van der Linde [Thu, 18 Jan 2024 02:30:04 +0000 (15:30 +1300)]
netcmd: models: change import style to use brackets

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>
7 months agonetcmd: models: enums and constants also brought forward
Rob van der Linde [Thu, 18 Jan 2024 02:20:25 +0000 (15:20 +1300)]
netcmd: models: enums and constants also brought forward

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>
7 months agonetcmd: models: fix docstring was missing param
Rob van der Linde [Wed, 17 Jan 2024 22:33:11 +0000 (11:33 +1300)]
netcmd: models: fix docstring was missing param

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>
7 months agopython: Remove ‘typing.Final’
Jo Sutton [Thu, 1 Feb 2024 23:23:58 +0000 (12:23 +1300)]
python: Remove ‘typing.Final’

This is only present in Python 3.8 and above.

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

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 months agopython: do not make use of typing.Final for python 3.6
Rob van der Linde [Thu, 1 Feb 2024 23:54:41 +0000 (12:54 +1300)]
python: do not make use of typing.Final for python 3.6

Python 3.6 does not have typing.Final yet

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

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>
7 months agos3/rpc_client: cleanup unmarshalling of variant types from row columns
Noel Power [Wed, 10 Jan 2024 14:43:58 +0000 (14:43 +0000)]
s3/rpc_client: cleanup unmarshalling of variant types from row columns

Prior to this change fn 'extract_variant_addresses' actually returns offsets
to the variant stored not the addresses, additionally the param in the
signature of the method is named offset where the param in reality is a
base address.
This change makes fn 'extract_variant_addresses' actually return addresses
instead of offsets and also changes the name of the incoming param. The
resulting changes are propaged to callers which hopefully makes what the
code is actually doing a little clearer

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Jan 30 17:22:37 UTC 2024 on atb-devel-224

7 months agos3/utils: use full 64 bit address for getrows (with 64bit offsets)
Noel Power [Mon, 8 Jan 2024 15:56:38 +0000 (15:56 +0000)]
s3/utils: use full 64 bit address for getrows (with 64bit offsets)

if 64bit offsets are used the hi 32-bits of address are stored in
the ulreserved2 member of the message header field and the low 32-bits
are stored in the ulclientbase member of the cpmgetrows message

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 months agos3/rpc_client: Remove stray unnecessary comment
Noel Power [Wed, 10 Jan 2024 10:59:23 +0000 (10:59 +0000)]
s3/rpc_client: Remove stray unnecessary comment

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 months agos3/rpc_client: change type of offset to uint64_t
Noel Power [Mon, 8 Jan 2024 15:12:35 +0000 (15:12 +0000)]
s3/rpc_client: change type of offset to uint64_t

Offset can be a 32 or 64 bit address depending on the indexing addressing
mode negotiated by the client
With a 32 bit param we can only specify a 32 bit base address. This change
alone doesn't affect anything as it is the client itself that choses and
passes the base address offset and wspsearch is the only current user of
this code.
In this case even with 64bit addressing negotiated the address passed
represents only the lower 32-bits part of the address.
However, for coverage purposes it would be better for the client to use an
address that covers the full 64bit range of the address (when 64 bit
addressing is negotiated).
This change will alow the wspsearch client in a future commit to pass a
base address value with both the hi and low 32 bits values set to make up
the full 64 bit address.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 months agolibrpc/idl: remove duplicate definitition
Noel Power [Tue, 19 Dec 2023 11:35:58 +0000 (11:35 +0000)]
librpc/idl: remove duplicate definitition

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 months agolibrpc/idl: fix typo in wsp_csort member
Noel Power [Thu, 16 Nov 2023 09:22:56 +0000 (09:22 +0000)]
librpc/idl: fix typo in wsp_csort member

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 months agolibrpc/wsp: Unknown property used in 'current directory' searches
Noel Power [Mon, 18 Dec 2023 11:37:38 +0000 (11:37 +0000)]
librpc/wsp: Unknown property used in 'current directory' searches

This property seems to be used instead of 'Scope' when the windows
search UI has selected current dir

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 months agodocs-xml: Build and install man page for wspsearch
Anoop C S [Tue, 30 Jan 2024 09:03:07 +0000 (14:33 +0530)]
docs-xml: Build and install man page for wspsearch

Commit 49b6137f7c2244aeb3cf9b65fc9d46fcf0b8dc55 switched the default
to install `wspsearch` client from False to True but missed to build
and install the corresponding man page. Therefore adding wspsearch.1
to the list of man pages to be built and installed by default.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Jan 30 14:38:58 UTC 2024 on atb-devel-224

7 months agopython:gp: Fix logging with gp
Andreas Schneider [Mon, 29 Jan 2024 16:46:30 +0000 (17:46 +0100)]
python:gp: Fix logging with gp

This allows enable INFO level logging with: `samba-gpupdate -d3`

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jan 30 07:18:05 UTC 2024 on atb-devel-224

7 months agoldb: change the version to 2.10.0 for Samba 4.21
Jule Anger [Mon, 29 Jan 2024 14:34:26 +0000 (15:34 +0100)]
ldb: change the version to 2.10.0 for Samba 4.21

Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jule Anger <janger@samba.org>
Autobuild-Date(master): Mon Jan 29 15:43:45 UTC 2024 on atb-devel-224

7 months agoWHATSNEW: Start release notes for Samba 4.21.0pre1.
Jule Anger [Mon, 29 Jan 2024 14:32:15 +0000 (15:32 +0100)]
WHATSNEW: Start release notes for Samba 4.21.0pre1.

Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 months agoVERSION: Bump version up to 4.21.0pre1...
Jule Anger [Mon, 29 Jan 2024 14:29:43 +0000 (15:29 +0100)]
VERSION: Bump version up to 4.21.0pre1...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 months agoVERSION: Disable GIT_SNAPSHOT for the Samba 4.20.0rc1 release. samba-4.20.0rc1
Jule Anger [Mon, 29 Jan 2024 14:28:20 +0000 (15:28 +0100)]
VERSION: Disable GIT_SNAPSHOT for the Samba 4.20.0rc1 release.

Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 months agoWHATSNEW: Up to Samba 4.20.0rc1.
Jule Anger [Mon, 29 Jan 2024 14:26:37 +0000 (15:26 +0100)]
WHATSNEW: Up to Samba 4.20.0rc1.

Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 months agoldb: release 2.9.0 for use in Samba 4.20.x ldb-2.9.0
Jule Anger [Mon, 29 Jan 2024 14:08:08 +0000 (15:08 +0100)]
ldb: release 2.9.0 for use in Samba 4.20.x

- documentation fixes
- build with Python 3.12 (bug #15513)
- a lot of additional error checking in
  the python bindings
- minor code fixes

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

Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 months agotevent: release 0.16.1 tevent-0.16.1
Jule Anger [Mon, 29 Jan 2024 14:08:08 +0000 (15:08 +0100)]
tevent: release 0.16.1

- build with Python 3.12 (bug #15513)
- documentation fixes

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

Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 months agotdb: release 1.4.10 tdb-1.4.10
Jule Anger [Mon, 29 Jan 2024 14:08:08 +0000 (15:08 +0100)]
tdb: release 1.4.10

- build with Python 3.12 (bug #15513)
- documentation fixes
- minor build fixes

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

Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>