]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 years agolibrpc/wsp: Add some util functions needed for wsp client api
Noel Power [Tue, 25 Oct 2022 10:30:03 +0000 (11:30 +0100)] 
librpc/wsp: Add some util functions needed for wsp client api

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/wsp: Test AQS parser
Noel Power [Mon, 24 Oct 2022 19:50:27 +0000 (20:50 +0100)] 
libcli/wsp: Test AQS parser

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/wsp: Add functions to dump restriction as string
Noel Power [Mon, 17 Oct 2022 18:14:35 +0000 (19:14 +0100)] 
librpc/wsp: Add functions to dump restriction as string

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/wsp: Add support for simplified Advanced Query Syntax
Noel Power [Wed, 29 Jun 2016 10:29:54 +0000 (11:29 +0100)] 
libcli/wsp: Add support for simplified Advanced Query Syntax

Add support to parse AQS-like (Advanced query syntax)

AQS - see https://learn.microsoft.com/en-gb/windows/win32/search/-search-3x-advancedquerysyntax

The basic (AQS) syntax is supported e.g. a query is built of a sequence of
queries connected by AND, OR and NOT where the query elements are
essentially restrictions defined by a property. There are some
limitations on the operators supported[1] and additionally some things
like enumerated ranges are not supported at all and range values are not
delimited as specified [2]. Some special cases that you see in the
windows search UI are exceptions [3] which are handled more or less as keywords

Some examples:

The following are all exactly the same query just expressed using
different variations of the syntax

'ALL:($<p403 OR $<p404) AND System.Kind:picture AND Scope:"FILE://somemachine/someshare" AND > System.Size:10241-102401'

'ALL:$<p403 OR ALL:$<p404 AND System.Kind:picture AND Scope:"FILE://somemachine/someshare" AND > System.Size:>=10241 AND System.Size:<102401'

'ALL:$<p403 OR ALL:$<p404 AND System.Kind:picture AND Scope:"FILE://somemachine/someshare" AND > System.Size:small'

The queries above by default select the property System.ItemUrl as the
one and only column returned, the query parameter however accepts a
variation to the AQS like syntax to allow arbitrary columns to be
selected e.g.

'SELECT System.ItemName, System.ItemURL, System.Size WHERE ALL:$<p403 OR ALL:$<p404 AND System.Kind:picture AND Scope:"FILE://somemachine/someshare" AND System.Size:small'

[1] supported operators
    -------------------
    =    Equals
    !=   Not Equals
    >    Greater than
    <    Less than
    >=   Greater than or equals
    <=   Less than or equals

    $=   equals
    $<   starts with
[2] ranges are specified as value-value instead of value..value (seems
    my flex/bison skills are not good enough and couldn't get that to
    work with '..'

[3] The windows UI has shortcut ranges (presumably represented as enumerated
    ranges) providing date ranges like 'today', 'tomorrow',
   'lastweek' etc. and similarly sizes like "empty, tiny, small, large..."

   These are supported (but implemented as keywords)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/wsp: add some helper functions needed to support AQS
Noel Power [Mon, 17 Oct 2022 13:20:49 +0000 (14:20 +0100)] 
librpc/wsp: add some helper functions needed to support AQS

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/wsp: adjust the wsp property api to additionally use a csv file
Noel Power [Tue, 29 Aug 2023 14:01:03 +0000 (15:01 +0100)] 
librpc/wsp: adjust the wsp property api to additionally use a csv file

We have definitions for a number of properties both from the WSP
spec document and from those used by wireshark. These properties
are built into samba (generated from csv files). This commit allows
extra properties to be added on the fly in a custom csv file, the
format of the csv file is the same as that used in the build. This
allows us to add some 'unknown' properties on the fly, although we
would hope that information regarding these properties would be
incorporated into the build in due course.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodocs-xml: Add config param for defining extra wsp properties
Noel Power [Thu, 12 Jan 2023 14:39:09 +0000 (14:39 +0000)] 
docs-xml: Add config param for defining extra wsp properties

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/rpc: Add windows propertyset info and associated accessor and helper api.
Noel Power [Thu, 7 May 2020 14:09:32 +0000 (15:09 +0100)] 
librpc/rpc: Add windows propertyset info and associated accessor and helper api.

wsp_util.c contains property definitions for well known windows
properties that can be used with WSP. These properties are generated from
some csv files (located in the librpc/wsp). The csv files themselves
were generated from a couple of sources e.g. the [MS-WSP]:
Windows Search Protocol document and wireshark mswsp dissector source code.

for more details please see librpc/wsp/README

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3/build: Add support for WSP in configure script.
Noel Power [Tue, 26 Jul 2016 10:47:43 +0000 (11:47 +0100)] 
s3/build: Add support for WSP in configure script.

Building wsp cli, tools should be controlled by
specifying '--enable-wsp' Note: By default this option is not enabled
as the is an experimental feature however it is enabled if configure
is called with '--selftest'

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/idl: Add idl for WSP and also some required helper functions.
Noel Power [Wed, 3 Dec 2014 10:56:18 +0000 (10:56 +0000)] 
librpc/idl: Add idl for WSP and also some required helper functions.

Represent the message data, structures and constants to do with the
WSP (Windows Search Protocol) as idl.

(see: https://msdn.microsoft.com/en-us/library/cc251767.aspx)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/smb: add FSCTL_PIPE_WAIT
Ralph Boehme [Sun, 25 Sep 2016 01:45:14 +0000 (18:45 -0700)] 
libcli/smb: add FSCTL_PIPE_WAIT

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli: Implement a tstream dcerpc_binding_handle
Ralph Boehme [Wed, 29 Jun 2016 11:47:18 +0000 (12:47 +0100)] 
libcli: Implement a tstream dcerpc_binding_handle

This implements a dcerpc_binding_handle that does just pass request and
response blob passing.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/smb: Allow dynamic setting of the max_data in SMB Pipe transaction.
Noel Power [Thu, 5 Jun 2014 09:52:54 +0000 (10:52 +0100)] 
libcli/smb: Allow dynamic setting of the max_data in SMB Pipe transaction.

Some services like WSP can send larger messages than the current 'Max Ioctl'
limit, this results in the server producing a BUFFER_OVERFLOW status (and
additionally clipping the message sent). Add support to allow a client to
modify the hardcoded 'Max Ioctl' default value to allow the server to
successfully send larger responses.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4/lib: remove packet_full_request_u16, not used anymore
Ralph Boehme [Wed, 21 Sep 2016 01:05:19 +0000 (18:05 -0700)] 
s4/lib: remove packet_full_request_u16, not used anymore

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/util: add struct tstream_context to tstream_read_pdu_blob_full_fn_t
Ralph Boehme [Wed, 21 Sep 2016 21:24:45 +0000 (14:24 -0700)] 
libcli/util: add struct tstream_context to tstream_read_pdu_blob_full_fn_t

Add struct tstream_context to tstream_read_pdu_blob_full_fn_t and update
all callers of tstream_read_pdu_blob_send() to use the correct callback.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/util: add tstream_full_request_u32 and tstream_full_request_u16
Ralph Boehme [Wed, 21 Sep 2016 21:27:14 +0000 (14:27 -0700)] 
libcli/util: add tstream_full_request_u32 and tstream_full_request_u16

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agocodespellignore: ignore some spellings introduced with wsp files
Noel Power [Mon, 28 Aug 2023 19:52:45 +0000 (20:52 +0100)] 
codespellignore: ignore some spellings introduced with wsp files

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agothird_party/heimdal_build: Fix spelling
Joseph Sutton [Wed, 30 Aug 2023 00:23:46 +0000 (12:23 +1200)] 
third_party/heimdal_build: Fix spelling

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