]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 years agogp: Convert CA certificates to base64
Gabriel Nagy [Wed, 16 Aug 2023 09:20:11 +0000 (12:20 +0300)] 
gp: Convert CA certificates to base64

I don't know whether this applies universally, but in our case the
contents of `es['cACertificate'][0]` are binary, so cleanly converting
to a string fails with the following:

'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte

We found a fix to be encoding the certificate to base64 when
constructing the CA list.

Section 4.4.5.2 of MS-CAESO also suggests that the content of
`cACertificate` is binary (OCTET string).

Signed-off-by: Gabriel Nagy <gabriel.nagy@canonical.com>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@samba.org>
2 years agogp: Test with binary content for certificate data
Gabriel Nagy [Fri, 18 Aug 2023 14:06:43 +0000 (17:06 +0300)] 
gp: Test with binary content for certificate data

This fails all GPO-related tests that call `gpupdate --rsop`.

Signed-off-by: Gabriel Nagy <gabriel.nagy@canonical.com>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@samba.org>
2 years agogp: Change root cert extension suffix
Gabriel Nagy [Fri, 11 Aug 2023 15:46:42 +0000 (18:46 +0300)] 
gp: Change root cert extension suffix

On Ubuntu, certificates must end in '.crt' in order to be considered by
the `update-ca-certificates` helper.

Signed-off-by: Gabriel Nagy <gabriel.nagy@canonical.com>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@samba.org>
2 years agogp: Support update-ca-trust helper
Gabriel Nagy [Wed, 16 Aug 2023 22:09:28 +0000 (01:09 +0300)] 
gp: Support update-ca-trust helper

This is used on RHEL/Fedora instead of update-ca-certificates. They
behave similarly so it's enough to change the command name.

Signed-off-by: Gabriel Nagy <gabriel.nagy@canonical.com>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@samba.org>
2 years agogp: Support more global trust directories
Gabriel Nagy [Wed, 16 Aug 2023 22:05:54 +0000 (01:05 +0300)] 
gp: Support more global trust directories

In addition to the SUSE global trust directory, add support for RHEL and
Debian-based distributions (including Ubuntu).

To determine the correct directory to use, we iterate over the variants
and stop at the first which is a directory.

In case none is found, fallback to the first option which will produce a
warning as it did previously.

Signed-off-by: Gabriel Nagy <gabriel.nagy@canonical.com>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@samba.org>
2 years agosamba-tool: Allow LDB URL to be None
Joseph Sutton [Fri, 25 Aug 2023 00:14:23 +0000 (12:14 +1200)] 
samba-tool: Allow LDB URL to be None

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agowaf: Build nmbd with -Wno-error=stringop-overflow
Andreas Schneider [Tue, 22 Aug 2023 13:52:16 +0000 (15:52 +0200)] 
waf: Build nmbd with -Wno-error=stringop-overflow

We use strlcpy() which has been added to glibc recently. This means we
also get fortification for strlcpy() now:

source3/nmbd/nmbd_browsesync.c: In function ‘find_domain_master_name_query_success’:
source3/nmbd/nmbd_browsesync.c:337:9: warning: ‘strlcpy’ writing 257 bytes into a
region of size 16 overflows the destination [-Wstringop-overflow=]
  337 |         strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We allocate memory for the userdata struct + fstring. However the data
pointer we use only is 16 bytes. Also nowadays you would use offsetof()
for the allocation calculation, but it only works correctly on newer
compilers like gcc > 7. We could make use of it in future after CentOS 7
is gone.

As we don't want to touch nmbd anymore, just silence the warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoutil: Avoid logging to multiple backends for stdout/stderr
Martin Schwenke [Wed, 26 Jul 2023 10:43:37 +0000 (20:43 +1000)] 
util: Avoid logging to multiple backends for stdout/stderr

Commit 83fe7a0316d3e5867a56cfdc51ec17f36ea03889 converted the
stdout/stderr logging  types to DEBUG_FILE to get a header when using
DEBUG_SYSLOG_FORMAT_ALWAYS.  However, this causes all configured
backends to be invoked.  When syslog is one of those backends then
this is almost certainly not what is intended.

Instead, call debug_file_log() directly in that special case and
revert the parts of the above commit that convert to file logging.

Most of the changes to debughdrclass() still seem necessary, since
they handle the change of debug_syslog_format from a bool to an enum.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Aug 28 01:21:07 UTC 2023 on atb-devel-224

2 years agoselftest:ndrdump: adjust xattr_NTACL test for ACE coda
Douglas Bagnall [Mon, 21 Aug 2023 22:14:50 +0000 (10:14 +1200)] 
selftest:ndrdump: adjust xattr_NTACL test for ACE coda

Signed-off-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): Thu Aug 24 03:47:08 UTC 2023 on atb-devel-224

2 years agolibcli/security: rm unused sec_ace_copy()
Douglas Bagnall [Fri, 18 Aug 2023 04:04:51 +0000 (16:04 +1200)] 
libcli/security: rm unused sec_ace_copy()

Unused since 2014.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest: compare Samba vs Windows SDDL security descriptors
Douglas Bagnall [Wed, 9 Aug 2023 02:15:27 +0000 (14:15 +1200)] 
pytest: compare Samba vs Windows SDDL security descriptors

Can Samba understand Windows security descriptors? Does it parse SDDL
the same way?

Here we test on over 7000 SDDL/descriptor pairs and find the answer
is pleasing. In later commits we will add more tests using different
classes of ACE.

The test cases are derived from fuzz seeds, exported to Windows via
the script in the last commit, with the Windows descriptor bytes found
using libcli/security/tests/windows/windows-sddl-test.py.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: test helper script extracts fuzz SDDL
Douglas Bagnall [Fri, 11 Aug 2023 10:21:41 +0000 (22:21 +1200)] 
libcli/security: test helper script extracts fuzz SDDL

This allows us to try the fuzz seeds as SDDL on Windows, then test
that Samba matches Windows' security descriptors in the cases where
the SDDL compiles. This will find SDDL edge cases that might otherwise
be missed.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: move Windows test script to windows subdir
Douglas Bagnall [Thu, 17 Aug 2023 22:37:47 +0000 (10:37 +1200)] 
libcli/security: move Windows test script to windows subdir

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: rewrite SDDL tests for running on Windows
Douglas Bagnall [Thu, 3 Aug 2023 23:52:17 +0000 (11:52 +1200)] 
libcli/security: rewrite SDDL tests for running on Windows

This script never worked well because it had to shell out to
Powershell, which never worked well due to syntax conflicts and
Powershell's specialness. The attempted ctypes version did not work,
due to the difficulty in expressing things like "relative
PSECURITY_DESCRIPTOR" in ctypes.

It turns out that pywin32 is easy to install and use, and we can
extract the NDR bytes which is far more useful than just testing if
the SDDL parses.

On Windows:

1. install Python from python.org
2. run `pip install pywin32`
3. copy e.g. libcli/security/tests/data/conditional-aces.txt to Windows
4. run `python windows-sddl-tests.py conditional-aces.txt`
5. add `--help` to see how to export descriptor bytes.

The default output is a whole lot of multi-coloured text, indicating
what failed and what didn't.

With --export-json it writes a JSON file mapping SDDL strings to NDR
byte sequences, which can be used to compare with Samba's attempts. If
you are only interested in --export-json, you might also like --quiet.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython/colour: add a colour diff helper
Douglas Bagnall [Thu, 17 Aug 2023 02:20:12 +0000 (14:20 +1200)] 
python/colour: add a colour diff helper

Sometimes colour can help show what is different between two strings.

This is roughly the same as

`git diff --no-index --color-words=. <a> <b>`.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: add some test more Windows SDDL test strings
Douglas Bagnall [Fri, 4 Aug 2023 02:15:19 +0000 (14:15 +1200)] 
libcli/security: add some test more Windows SDDL test strings

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: script to turn token/descriptor pairs into sddl
Douglas Bagnall [Wed, 26 Jul 2023 05:50:22 +0000 (17:50 +1200)] 
libcli/security: script to turn token/descriptor pairs into sddl

We fuzz security descriptors in a couple of different ways, and this
maps seeds from one form into the other. The SDDL examples can also be
used in Windows tests.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: remove unused tmp_ctx in calculate_inherited_from_parent()
Douglas Bagnall [Fri, 18 Aug 2023 02:37:35 +0000 (14:37 +1200)] 
libcli/security: remove unused tmp_ctx in calculate_inherited_from_parent()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: avoid leak in calculate_inherited_from_parent()
Douglas Bagnall [Fri, 21 Jul 2023 02:35:45 +0000 (14:35 +1200)] 
libcli/security: avoid leak in calculate_inherited_from_parent()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: used sec_ace_object() in sddl encoding
Douglas Bagnall [Fri, 21 Jul 2023 04:58:45 +0000 (16:58 +1200)] 
libcli/security: used sec_ace_object() in sddl encoding

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/security.idl: adjust size calculations for upcoming ace types
Douglas Bagnall [Thu, 13 Jul 2023 09:31:50 +0000 (21:31 +1200)] 
librpc/security.idl: adjust size calculations for upcoming ace types

Soon we will get Conditional ACEs and Resource Attribute ACES, each of
which have trailing bytes at the end of the ACE. Here's a diagram:

              ____      The ACE size field may indicate a size bigger
  .type      /    |     than the known parts, even when you take
  .flags    /     |     rounding to a multiple of four into account.
  .size  --'      |     This extra data is meaningful in some ACEs.
  .access_mask    |
  .trustee (sid) _|  <- known data ends here.
                  :
   "coda"      ___:  <- the trailing part, Zero size unless the size
                        field points beyond the end of the known data.
Probably empty for ordinary ACE types.

Until now we have thrown away these extra bytes, because they have no
meaning in the ACE types we recognise. But with conditional and
resource attribute ACEs we need to catch and process these bytes, so
we add an extra field for that.

Thus we can drop the manually written ndr_pull_security_ace() that
discarded the trailing bytes, because we just allow it to be pulled
into an unused blob. In the very common case, the blob will be empty.

Microsoft does not use a common name across different ACE types to
describe this end-data -- "coda" is a Samba term.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: sddl ACL decode avoids early splitting on parenthesis
Douglas Bagnall [Fri, 21 Jul 2023 04:51:53 +0000 (16:51 +1200)] 
libcli/security: sddl ACL decode avoids early splitting on parenthesis

Soon we will have Conditional ACEs and Resource Attribute ACEs. It is
expected --indeed mandatory-- that the SDDL representations of these
ACEs will contain parentheses, so we can't use '(' and ')' to decide
where ACEs stop and start.

This means shifting where we make a mutable copy of the SDDL string
from per-ACE to per-ACL, and allowing sddl_decode_ace() to decide when
its ACE is finished.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4/ntfvfs/pvfs_acl: initialise ACEs to zeroes
Douglas Bagnall [Tue, 22 Aug 2023 02:13:44 +0000 (14:13 +1200)] 
s4/ntfvfs/pvfs_acl: initialise ACEs to zeroes

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4/torture: initialise ACE structs to zero
Douglas Bagnall [Tue, 22 Aug 2023 02:12:46 +0000 (14:12 +1200)] 
s4/torture: initialise ACE structs to zero

Because soon these structs will have more members, which are typically
going to be zero.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest/sddl: tests for more invalid or weird cases
Douglas Bagnall [Thu, 27 Apr 2023 22:46:27 +0000 (10:46 +1200)] 
pytest/sddl: tests for more invalid or weird cases

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest/sddl: add option for case-insensitive tests
Douglas Bagnall [Fri, 18 Aug 2023 01:10:02 +0000 (13:10 +1200)] 
pytest/sddl: add option for case-insensitive tests

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest/sddl: environment option for exporting as fuzz seeds
Douglas Bagnall [Fri, 18 Aug 2023 01:09:13 +0000 (13:09 +1200)] 
pytest/sddl: environment option for exporting as fuzz seeds

We want realistic examples for sddl fuzzing seeds, and we want
realistic examples for sddl tests, so hopefully we only need to get
it right once.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest/sddl: replace/export tests based on environment vars
Douglas Bagnall [Thu, 10 Aug 2023 23:08:00 +0000 (11:08 +1200)] 
pytest/sddl: replace/export tests based on environment vars

We had a stupid system involving test functions with side-effects,
that needed to be enabled by editing the file. Now you get the same
effects by setting environment variables, the names of which you can
only learn by reading the file closely.

This works better because some stuff needs to happen at class-time
rather than instance-time.

Also the environment variables specify the import and export locations.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytests: add helper to grab a directory from environment
Douglas Bagnall [Fri, 7 Jul 2023 04:12:19 +0000 (16:12 +1200)] 
pytests: add helper to grab a directory from environment

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security/pysecurity: use NULL to mean NULL in C
Douglas Bagnall [Fri, 14 Apr 2023 01:58:15 +0000 (13:58 +1200)] 
libcli/security/pysecurity: use NULL to mean NULL in C

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib/util: strhex_to_data_blob checks talloc
Douglas Bagnall [Thu, 10 Aug 2023 02:26:11 +0000 (14:26 +1200)] 
lib/util: strhex_to_data_blob checks talloc

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3: libsmb: Add a missing return statement in the timeout case.
Jeremy Allison [Thu, 17 Aug 2023 00:24:37 +0000 (17:24 -0700)] 
s3: libsmb: Add a missing return statement in the timeout case.

Obvious fix (needs a malicious server to recreate).

Found by Robert Morris <rtm@lcs.mit.edu>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Aug 23 09:29:51 UTC 2023 on atb-devel-224

2 years agos3:utils: Use lpcfg_set_cmdline() in vfstest
Pavel Kalugin [Mon, 7 Aug 2023 05:34:14 +0000 (08:34 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in vfstest

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in testparm
Pavel Kalugin [Mon, 7 Aug 2023 04:52:32 +0000 (07:52 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in testparm

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in smbstatus
Pavel Kalugin [Mon, 7 Aug 2023 04:48:22 +0000 (07:48 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in smbstatus

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Remove trailing spaces in smbcquotas; no changes
Pavel Kalugin [Mon, 7 Aug 2023 04:43:48 +0000 (07:43 +0300)] 
s3:utils: Remove trailing spaces in smbcquotas; no changes

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in smbcquotas
Pavel Kalugin [Mon, 7 Aug 2023 04:43:06 +0000 (07:43 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in smbcquotas

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Remove trailing spaces in smbcontrol; no changes
Pavel Kalugin [Mon, 7 Aug 2023 04:35:59 +0000 (07:35 +0300)] 
s3:utils: Remove trailing spaces in smbcontrol; no changes

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in smbcontrol
Pavel Kalugin [Mon, 7 Aug 2023 04:34:38 +0000 (07:34 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in smbcontrol

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Remove trailing spaces in smbcacls; no changes
Pavel Kalugin [Mon, 7 Aug 2023 04:26:40 +0000 (07:26 +0300)] 
s3:utils: Remove trailing spaces in smbcacls; no changes

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in smbcacls
Pavel Kalugin [Mon, 7 Aug 2023 04:25:28 +0000 (07:25 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in smbcacls

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in sharesec
Pavel Kalugin [Mon, 7 Aug 2023 04:20:58 +0000 (07:20 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in sharesec

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in regedit
Pavel Kalugin [Mon, 7 Aug 2023 04:17:28 +0000 (07:17 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in regedit

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in pdbedit
Pavel Kalugin [Mon, 7 Aug 2023 04:13:00 +0000 (07:13 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in pdbedit

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Remove trailing spaces in pdbedit; no changes
Pavel Kalugin [Mon, 7 Aug 2023 04:08:29 +0000 (07:08 +0300)] 
s3:utils: Remove trailing spaces in pdbedit; no changes

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in net
Pavel Kalugin [Mon, 7 Aug 2023 03:56:07 +0000 (06:56 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in net

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in mdsearch
Pavel Kalugin [Mon, 7 Aug 2023 03:32:14 +0000 (06:32 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in mdsearch

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in dbwrap_torture
Pavel Kalugin [Mon, 7 Aug 2023 03:24:47 +0000 (06:24 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in dbwrap_torture

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:utils: Use lpcfg_set_cmdline() in dbwrap_tool
Pavel Kalugin [Mon, 7 Aug 2023 03:20:26 +0000 (06:20 +0300)] 
s3:utils: Use lpcfg_set_cmdline() in dbwrap_tool

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:rpc_server: Use lpcfg_set_cmdline() in test_mdsparser_es
Pavel Kalugin [Sun, 6 Aug 2023 19:29:02 +0000 (22:29 +0300)] 
s3:rpc_server: Use lpcfg_set_cmdline() in test_mdsparser_es

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:rpcclient: Use lpcfg_set_cmdline()
Pavel Kalugin [Sun, 6 Aug 2023 19:19:26 +0000 (22:19 +0300)] 
s3:rpcclient: Use lpcfg_set_cmdline()

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoexamples: Use lpcfg_set_cmdline()
Pavel Kalugin [Sun, 6 Aug 2023 14:39:36 +0000 (17:39 +0300)] 
examples: Use lpcfg_set_cmdline()

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:param: Use lpcfg_set_cmdline()
Pavel Kalugin [Sun, 6 Aug 2023 14:25:33 +0000 (17:25 +0300)] 
s3:param: Use lpcfg_set_cmdline()

Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agovfs_aio_pthread: use SMB_VFS_NEXT_OPENAT() in aio_pthread_openat_fn()
MikeLiu [Tue, 22 Aug 2023 02:01:14 +0000 (10:01 +0800)] 
vfs_aio_pthread: use SMB_VFS_NEXT_OPENAT() in aio_pthread_openat_fn()

1. Set 'aio_allow_open' to false if fsp->fsp_flags.is_pathref
2. Move !(how->flags & O_CREAT) and !(how->flags & O_EXCL) up and set 'aio_allow_open' to false
3. Use SMB_VFS_NEXT_OPENAT() instead of openat() for disable async opens case.

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

Signed-off-by: MikeLiu <mikeliu@qnap.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 22 17:44:00 UTC 2023 on atb-devel-224

2 years agolibcli: Add required #includes to smbXcli_base.h
Volker Lendecke [Mon, 21 Aug 2023 19:41:06 +0000 (21:41 +0200)] 
libcli: Add required #includes to smbXcli_base.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoclifuse: Use direct FSCC info level
Volker Lendecke [Mon, 21 Aug 2023 19:34:31 +0000 (21:34 +0200)] 
clifuse: Use direct FSCC info level

Avoid the magic -1000

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmb: Use tevent_req_nterror() properly
Volker Lendecke [Wed, 16 Aug 2023 09:59:03 +0000 (11:59 +0200)] 
libsmb: Use tevent_req_nterror() properly

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmb: Remove a duplicate TALLOC_FREE()
Volker Lendecke [Wed, 16 Aug 2023 13:45:32 +0000 (15:45 +0200)] 
libsmb: Remove a duplicate TALLOC_FREE()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmb: Use tevent_req_oom() where appropriate
Volker Lendecke [Wed, 16 Aug 2023 13:39:55 +0000 (15:39 +0200)] 
libsmb: Use tevent_req_oom() where appropriate

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmb: Move cli_raw_ioctl() to torture3
Volker Lendecke [Wed, 16 Aug 2023 09:04:14 +0000 (11:04 +0200)] 
libsmb: Move cli_raw_ioctl() to torture3

Only used there.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmb: Move cli_qpathinfo1() to torture3
Volker Lendecke [Mon, 21 Aug 2023 10:59:10 +0000 (12:59 +0200)] 
libsmb: Move cli_qpathinfo1() to torture3

It's only used there, and it clutters general code. Re-adding the
async flavor is trivial should it ever be required.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agotorture3: Avoid unused variables
Volker Lendecke [Mon, 21 Aug 2023 10:45:52 +0000 (12:45 +0200)] 
torture3: Avoid unused variables

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbclient: Don't give up in allinfo if getting advanced info fails
Volker Lendecke [Mon, 21 Aug 2023 08:01:24 +0000 (10:01 +0200)] 
smbclient: Don't give up in allinfo if getting advanced info fails

Getting streams might fail, but further down getting reparse info
might succeed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmb: Use cli_smb2_qpathinfo_basic() in cli_getatr()
Volker Lendecke [Fri, 18 Aug 2023 14:15:19 +0000 (16:15 +0200)] 
libsmb: Use cli_smb2_qpathinfo_basic() in cli_getatr()

cli_smb2_qpathinfo_basic() uses the smb_create_returns and avoids a
round-trip.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmb: Use cli_smb2_qpathinfo() in cli_qpathinfo2()
Volker Lendecke [Fri, 18 Aug 2023 14:07:56 +0000 (16:07 +0200)] 
libsmb: Use cli_smb2_qpathinfo() in cli_qpathinfo2()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmb: Use cli_smb2_qpathinfo() for streams
Volker Lendecke [Fri, 18 Aug 2023 13:47:20 +0000 (15:47 +0200)] 
libsmb: Use cli_smb2_qpathinfo() for streams

Remove sync cli_smb2_qpathinfo_streams() wrapper.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmb: Add cli_smb2_qpathinfo_send/recv()
Volker Lendecke [Fri, 30 Jun 2023 20:43:43 +0000 (22:43 +0200)] 
libsmb: Add cli_smb2_qpathinfo_send/recv()

Wrap the create/qfileinfo/close, to be used in next patches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: Report time at which testsuite starts
Joseph Sutton [Thu, 17 Aug 2023 01:29:41 +0000 (13:29 +1200)] 
selftest: Report time at which testsuite starts

With no call to report_time() preceding it,
PlainFormatter.start_testsuite() would always claim that no time had
elapsed prior to the first testsuite starting to run. This gave a
misleading impression of the time spent running the first testsuite. Now
the time will be consistent with that reported for subsequent
testsuites, and will properly include any time that test environments
took to start up.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 22 00:36:52 UTC 2023 on atb-devel-224

2 years agoselftest: Fix subunit reporting the time incorrectly
Joseph Sutton [Thu, 17 Aug 2023 00:46:17 +0000 (12:46 +1200)] 
selftest: Fix subunit reporting the time incorrectly

Although report_time() would output the time in UTC, it neglected to
specify the timezone offset. Thus subunithelper.parse_results() would
interpret the time string it was given as being in local time.
TestProtocolClient.time() then converted that *back* into UTC, giving an
incorrect result (unless UTC is your local timezone).

Fix this by having report_time() indicate that the time zone is UTC.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: Remove leftover from debugging
Joseph Sutton [Thu, 17 Aug 2023 01:42:47 +0000 (13:42 +1200)] 
selftest: Remove leftover from debugging

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: Remove unused variable
Joseph Sutton [Wed, 16 Aug 2023 03:20:48 +0000 (15:20 +1200)] 
selftest: Remove unused variable

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: Remove semicolon
Joseph Sutton [Wed, 16 Aug 2023 03:19:05 +0000 (15:19 +1200)] 
selftest: Remove semicolon

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 [Wed, 2 Aug 2023 02:52:13 +0000 (14:52 +1200)] 
s4:torture: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:smb_server: Fix code spelling
Joseph Sutton [Tue, 1 Aug 2023 03:52:07 +0000 (15:52 +1200)] 
s4:smb_server: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Use smb_krb5_make_data()
Joseph Sutton [Wed, 16 Aug 2023 03:57:53 +0000 (15:57 +1200)] 
s4:kdc: Use smb_krb5_make_data()

smb_krb5_make_data() sets the magic field, which we were previously
ignoring. We should also not set krb5_data::length if krb5_data::data is
NULL.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Use ‘krb5_error_code’ for return types
Joseph Sutton [Wed, 16 Aug 2023 03:57:00 +0000 (15:57 +1200)] 
s4:kdc: Use ‘krb5_error_code’ for return types

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Set SAMBA_KDC_FLAG_PROTOCOL_TRANSITION flag for MIT Kerberos
Joseph Sutton [Tue, 15 Aug 2023 22:18:59 +0000 (10:18 +1200)] 
s4:kdc: Set SAMBA_KDC_FLAG_PROTOCOL_TRANSITION flag for MIT Kerberos

This flag was set in commit 461dc44e740aacad41bb0df0552560d1eb3c6ea8,
but only in mit_samba_reget_pac(); it was not set in the newer function,
mit_samba_update_pac(), used with MIT Kerberos 1.20 and above.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Remove support code for older versions of MIT Kerberos
Joseph Sutton [Tue, 15 Aug 2023 03:16:57 +0000 (15:16 +1200)] 
s4:kdc: Remove support code for older versions of MIT Kerberos

The oldest version we now support is 1.21. For every supported version
we can be certain that KRB5_KDB_API_VERSION >= 10 and
KRB5_KDB_DAL_MAJOR_VERSION >= 9.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Do not panic if authsam_logon_success_accounting() fails
Joseph Sutton [Sun, 13 Aug 2023 22:50:37 +0000 (10:50 +1200)] 
s4:kdc: Do not panic if authsam_logon_success_accounting() fails

In hdb_samba4_audit(), ERR_GENERIC signals an unexpected situation — if
we encounter that error code while running under selftest, we’ll panic.
In response to an expected event such as the failure of
authsam_logon_success_accounting(), it’s more appropriate to continue to
run.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:rpc_server: Remove unnecessary cast
Joseph Sutton [Wed, 9 Aug 2023 04:54:02 +0000 (16:54 +1200)] 
s3:rpc_server: Remove unnecessary cast

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:libnet: Fix reference to incorrect function names
Joseph Sutton [Tue, 15 Aug 2023 21:47:18 +0000 (09:47 +1200)] 
s3:libnet: Fix reference to incorrect function names

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:libnet: Remove unnecessary cast
Joseph Sutton [Wed, 9 Aug 2023 04:53:21 +0000 (16:53 +1200)] 
s3:libnet: Remove unnecessary cast

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Save files with intended contents
Joseph Sutton [Wed, 16 Aug 2023 23:13:50 +0000 (11:13 +1200)] 
python:tests: Save files with intended contents

We presumably here meant to use the variable ‘contents’, not
‘test_contents’.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Fix spelling
Joseph Sutton [Wed, 16 Aug 2023 23:07:27 +0000 (11:07 +1200)] 
python:tests: Fix spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Reuse policies and silos created by setUp() across all tests
Joseph Sutton [Thu, 17 Aug 2023 01:29:49 +0000 (13:29 +1200)] 
python:tests: Reuse policies and silos created by setUp() across all tests

We now create the claims in setUp() only once, preserving them so as to
reuse them across all of the tests using this class. Then we finally
delete them all in tearDownClass().

addClassCleanup() could make this cleaner, but it’s available only in
Python 3.8 and above.

This change reduces the time taken by my machine to run
samba.tests.samba_tool.domain_auth_policy from two minutes to ten
seconds.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Reuse claims created by setUp() across all tests
Joseph Sutton [Wed, 16 Aug 2023 22:27:44 +0000 (10:27 +1200)] 
python:tests: Reuse claims created by setUp() across all tests

We now create the claims in setUp() only once, preserving them so as to
reuse them across all of the tests in this class. Then we finally delete
them all in tearDownClass().

addClassCleanup() could make this cleaner, but it’s available only in
Python 3.8 and above.

This change reduces the time taken by my machine to run these tests from
four minutes to twenty seconds.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Make getSamDB() a static method
Joseph Sutton [Wed, 16 Aug 2023 22:22:35 +0000 (10:22 +1200)] 
python:tests: Make getSamDB() a static method

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:subunit: Use ‘is’ to compare variables with singletons
Joseph Sutton [Thu, 17 Aug 2023 01:29:00 +0000 (13:29 +1200)] 
python:subunit: Use ‘is’ to compare variables with singletons

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:subunit: Fix docstring
Joseph Sutton [Thu, 17 Aug 2023 00:45:05 +0000 (12:45 +1200)] 
python:subunit: Fix docstring

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:netcmd: Remove semicolon
Joseph Sutton [Wed, 16 Aug 2023 23:06:01 +0000 (11:06 +1200)] 
python:netcmd: Remove semicolon

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:netcmd: Add missing newlines to error messages
Joseph Sutton [Sun, 6 Aug 2023 22:25:12 +0000 (10:25 +1200)] 
python:netcmd: Add missing newlines to error messages

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopidl: Use non-existent function dissect_ndr_int64()
Joseph Sutton [Tue, 15 Aug 2023 21:27:37 +0000 (09:27 +1200)] 
pidl: Use non-existent function dissect_ndr_int64()

This function does not exist yet, but Wireshark can implement it if they
ever choose to regenerate their NDR dissectors.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc:ndr: Use portable integer types
Joseph Sutton [Tue, 15 Aug 2023 00:37:55 +0000 (12:37 +1200)] 
librpc:ndr: Use portable integer types

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/auth: Remove unnecessary casts
Joseph Sutton [Wed, 9 Aug 2023 04:52:31 +0000 (16:52 +1200)] 
libcli/auth: Remove unnecessary casts

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:krb5_wrap: Fix references to incorrect function names
Joseph Sutton [Tue, 15 Aug 2023 21:46:49 +0000 (09:46 +1200)] 
lib:krb5_wrap: Fix references to incorrect function names

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:krb5_wrap: Fix code spelling
Joseph Sutton [Tue, 15 Aug 2023 21:46:18 +0000 (09:46 +1200)] 
lib:krb5_wrap: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotests/krb5: Remove incorrect comments
Joseph Sutton [Tue, 15 Aug 2023 00:36:05 +0000 (12:36 +1200)] 
tests/krb5: Remove incorrect comments

Now that the INT64 claim IDL definition has been corrected, these tests
should pass against Windows.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 15 19:41:50 UTC 2023 on atb-devel-224

2 years agoclaims.idl: Use ‘int64’ instead of ‘dlong’ for INT64 claims
Joseph Sutton [Tue, 15 Aug 2023 00:31:54 +0000 (12:31 +1200)] 
claims.idl: Use ‘int64’ instead of ‘dlong’ for INT64 claims

This field is supposed to be aligned to eight bytes, but the ‘dlong’
type is aligned to only four bytes. This discrepancy resulted in claims
being encoded and decoded incorrectly.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc:ndr: Add ‘int64’ type
Joseph Sutton [Tue, 15 Aug 2023 00:29:03 +0000 (12:29 +1200)] 
librpc:ndr: Add ‘int64’ type

This type behaves like a signed variant of ‘hyper’. Unlike the existing
‘dlong’ type, which has four byte alignment, ‘int64’ is aligned to eight
bytes.

Bump the NDR version to 3.0.1.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotests/krb5: Add a test decoding INT64 PAC claims issued by Windows
Joseph Sutton [Tue, 15 Aug 2023 00:21:30 +0000 (12:21 +1200)] 
tests/krb5: Add a test decoding INT64 PAC claims issued by Windows

Our NDR code currently handles INT64 claims incorrectly.

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

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