]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 years agotests/krb5: Allow specifying sname for getting service ticket
Joseph Sutton [Mon, 7 Mar 2022 04:07:03 +0000 (17:07 +1300)] 
tests/krb5: Allow specifying sname for getting service ticket

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Check claims buffers
Joseph Sutton [Fri, 4 Mar 2022 03:22:07 +0000 (16:22 +1300)] 
tests/krb5: Check claims buffers

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Add xpress (de)compression functions
Joseph Sutton [Fri, 4 Mar 2022 03:21:19 +0000 (16:21 +1300)] 
tests/krb5: Add xpress (de)compression functions

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Add function for creating claims
Joseph Sutton [Fri, 4 Mar 2022 03:20:18 +0000 (16:20 +1300)] 
tests/krb5: Add function for creating claims

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agokrb5pac.idl: Add definitions for claims PAC buffers
Joseph Sutton [Fri, 4 Mar 2022 03:17:40 +0000 (16:17 +1300)] 
krb5pac.idl: Add definitions for claims PAC buffers

The PAC device info definition comes from [MS-PAC] 2.12.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoclaims.idl: Add claim type definitions
Joseph Sutton [Thu, 8 Sep 2022 23:02:01 +0000 (11:02 +1200)] 
claims.idl: Add claim type definitions

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agos4:kdc: Set kerberos debug class for kdc service
Andreas Schneider [Tue, 6 Sep 2022 08:19:54 +0000 (10:19 +0200)] 
s4:kdc: Set kerberos debug class for kdc service

Signed-off-by: Andreas Schneider <asn@samba.org>
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): Thu Sep  8 23:34:15 UTC 2022 on sn-devel-184

3 years agoselftest: Add Address Sanitizer suppressions
Andreas Schneider [Tue, 6 Sep 2022 08:06:37 +0000 (10:06 +0200)] 
selftest: Add Address Sanitizer suppressions

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: Create asan_options variable
Andreas Schneider [Tue, 6 Sep 2022 08:06:05 +0000 (10:06 +0200)] 
selftest: Create asan_options variable

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: Fix address sanitizer with python3
Andreas Schneider [Tue, 6 Sep 2022 06:59:56 +0000 (08:59 +0200)] 
selftest: Fix address sanitizer with python3

==9542==AddressSanitizer: failed to intercept 'crypt'
==9542==AddressSanitizer: failed to intercept 'crypt_r'

[..]

AddressSanitizer:DEADLYSIGNAL
=================================================================
==29768==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000000000 bp 0x7ffcec4bf3c0 sp 0x7ffcec4beb58 T0)
==29768==Hint: pc points to the zero page.
==29768==The signal is caused by a READ memory access.
==29768==Hint: address points to the zero page.
    #0 0x0  (<unknown module>)
    #1 0x7f052cca4129 in crypt_crypt_impl /usr/src/debug/python310-core-3.10.6-3.1.x86_64/Modules/_cryptmodule.c:44

We would need to build python without --as-needed as we can't so that
we need to preload the library to avoid a segfault.

See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98669

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: Remove tailing whitspaces in selftest.pl
Andreas Schneider [Tue, 6 Sep 2022 06:48:49 +0000 (08:48 +0200)] 
selftest: Remove tailing whitspaces in selftest.pl

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agowaf: Do not use as-needed if we build with Address Sanitizer
Andreas Schneider [Tue, 6 Sep 2022 06:47:47 +0000 (08:47 +0200)] 
waf: Do not use as-needed if we build with Address Sanitizer

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98669

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:gensec: Do not link subsystems against dlopen() modules!
Andreas Schneider [Thu, 8 Sep 2022 08:32:38 +0000 (10:32 +0200)] 
s4:gensec: Do not link subsystems against dlopen() modules!

This is not a shared library. This only worked because we use
'--as-needed' as linker option.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest samba-tool forest: use runcmd
Douglas Bagnall [Wed, 7 Sep 2022 10:17:41 +0000 (22:17 +1200)] 
pytest samba-tool forest: use runcmd

This is an example/test to show how runsublevelcmd() converts into
runcmd() whilst ensuring it works.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agomake runcmd, runsubcmd, exact aliases
Douglas Bagnall [Wed, 7 Sep 2022 10:17:05 +0000 (22:17 +1200)] 
make runcmd, runsubcmd, exact aliases

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest: samba-tool: coalesce run*cmd functions
Douglas Bagnall [Wed, 7 Sep 2022 04:57:46 +0000 (16:57 +1200)] 
pytest: samba-tool: coalesce run*cmd functions

We have had three different functions for resolving samba-tool commands,
depending on whether they are nested 1, 2, or n deep (where n could also
be 1 or 2). This API evolved around a separation of sub-command names and
options, so that the Command that was eventually found could be given the
right outf and errf.

Now we can just use the same outf and errf for all levels, and we can not
care about this distinction.

All these functions are now synonyms, and we keep them all for now for
backward-compatibility.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: binary uses samba_tool function
Douglas Bagnall [Wed, 7 Sep 2022 22:17:54 +0000 (10:17 +1200)] 
samba-tool: binary uses samba_tool function

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/samba-tool: entry function follows too logic
Douglas Bagnall [Thu, 8 Sep 2022 08:27:33 +0000 (20:27 +1200)] 
pytest/samba-tool: entry function follows too logic

To further align the logic of the tool and the tests, we use
the same logic in the test function as in samba-tool.  In
effect, this means the function is even less likely to raise
an exception, rahter printing it out and returning an error code.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/password-lockout: fix using samba_tool function
Douglas Bagnall [Wed, 7 Sep 2022 10:04:08 +0000 (22:04 +1200)] 
pytest/password-lockout: fix using samba_tool function

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/samba_dnsupdate: fix using samba-tool function
Douglas Bagnall [Wed, 7 Sep 2022 10:03:16 +0000 (22:03 +1200)] 
pytest/samba_dnsupdate: fix using samba-tool function

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/netcmd: fix for new samba-tool api
Douglas Bagnall [Wed, 7 Sep 2022 10:03:47 +0000 (22:03 +1200)] 
pytest/netcmd: fix for new samba-tool api

In this case we are skipping _resolve().

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: add a convenience function that does it all
Douglas Bagnall [Wed, 7 Sep 2022 22:00:36 +0000 (10:00 +1200)] 
samba-tool: add a convenience function that does it all

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: command that has exception, shows exception
Douglas Bagnall [Wed, 7 Sep 2022 20:56:45 +0000 (08:56 +1200)] 
samba-tool: command that has exception, shows exception

This will make a difference to the string printed in the cases that
call self.usage(), resulting in more specified usage for the
sub-command. It would also matter if the samba-tool sub-command had a
different .show_command_error() or .errf, but I don't think that
happens.

Note: usually command._run() will have caught and shown the exception,
returning -1.

We also rename away 'cmd' so we don't again imagine it is the command
we are running.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: _resolve() can set outf, errf
Douglas Bagnall [Wed, 7 Sep 2022 04:33:33 +0000 (16:33 +1200)] 
samba-tool: _resolve() can set outf, errf

We catch output in outf and errf for testing, which we currently do
with

    cmd.outf = self.stringIO()
    cmd.errf = self.stringIO()

on the final resolved commands. But this does not catch the output of
the super-commands, of which we normally expect none. Using

    supercmd._resolve(*args, outf=self.stringIO(), errf=self.stringIO())

will redirect output all the way up the chain.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: more conventional usage of parser.parse_args
Douglas Bagnall [Wed, 7 Sep 2022 03:07:43 +0000 (15:07 +1200)] 
samba-tool: more conventional usage of parser.parse_args

By default parse_args will use sys.argv[1:], which is to say the
command-line without the command name. We have always fed it the
equivalent of sys.argv, then trimmed the command off the result. That
was a bit silly.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: separate ._run() from command resolution
Douglas Bagnall [Wed, 7 Sep 2022 03:34:23 +0000 (15:34 +1200)] 
samba-tool: separate ._run() from command resolution

Prior to this commit, in super-commands, the first half of the _run()
is resolving what sub-command to run, and the second half is working
out what to print if that failed. Some issues with that are:

 * it looks a little bit complicated.

 * the tests can't use the tool's resolution code, because it runs
   immediately, while the tests first want to fiddle with self.outf
   and so on.

 * it makes it harder to subclass and override the resolution code, so
   instead we do strange things like where we subclass dict as in
   main.py.

So we split it into ._resolve() and ._run().

There are a few tests that break. We mark these as flapping, rather
than knownfail, so as to avoid going into extremely fine-grain filters
for tests that will be fixed within a few commits.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: do not crash on unimplemented .run()
Douglas Bagnall [Tue, 16 Aug 2022 01:43:54 +0000 (13:43 +1200)] 
samba-tool: do not crash on unimplemented .run()

The run() method is always called with arguments, so it crashes before
the NotImplementedError() is ever reached. That's OK, but this is better.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3:libads: let cldap_ping_list() use cldap_multi_netlogon()
Stefan Metzmacher [Wed, 24 Aug 2022 14:11:06 +0000 (16:11 +0200)] 
s3:libads: let cldap_ping_list() use cldap_multi_netlogon()

We have a list of ip addresses, so we can request them
all together under a single timeout, instead of asking
each ip with it's own timeout.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Sep  8 08:12:46 UTC 2022 on sn-devel-184

3 years agos3:libads: split out ads_fill_cldap_reply() out of ads_try_connect()
Stefan Metzmacher [Wed, 24 Aug 2022 14:36:17 +0000 (16:36 +0200)] 
s3:libads: split out ads_fill_cldap_reply() out of ads_try_connect()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:modules - fix read of uninitialized memory
Andrew Walker [Tue, 6 Sep 2022 20:45:58 +0000 (16:45 -0400)] 
s3:modules - fix read of uninitialized memory

For loop accesses entry->next after entry
has been removed from list in glfs_clear_preopened().

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep  7 19:40:17 UTC 2022 on sn-devel-184

3 years agontlm_auth: Remove an unused #include
Volker Lendecke [Tue, 6 Sep 2022 18:52:27 +0000 (20:52 +0200)] 
ntlm_auth: Remove an unused #include

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotorture3: Pass NULL to ReadDirName
Volker Lendecke [Tue, 6 Sep 2022 08:43:29 +0000 (10:43 +0200)] 
torture3: Pass NULL to ReadDirName

Do the necessary fstat manually

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove an unused variable
Volker Lendecke [Tue, 6 Sep 2022 07:29:18 +0000 (09:29 +0200)] 
smbd: Remove an unused variable

ReadDirName happily takes NULL for "sbuf"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotorture3: Remove an unused variable
Volker Lendecke [Tue, 6 Sep 2022 07:16:14 +0000 (09:16 +0200)] 
torture3: Remove an unused variable

ReadDirName happily takes NULL for "sbuf"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove unused variables
Volker Lendecke [Tue, 6 Sep 2022 07:07:31 +0000 (09:07 +0200)] 
smbd: Remove unused variables

ReadDirName happily takes NULL for "sbuf"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Shorten long lines
Volker Lendecke [Mon, 5 Sep 2022 13:31:19 +0000 (15:31 +0200)] 
smbd: Shorten long lines

This code is young enough to justify a README.Coding patch, at least
IMO.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbtorture3: Avoid an "else"
Volker Lendecke [Mon, 5 Sep 2022 11:08:54 +0000 (13:08 +0200)] 
smbtorture3: Avoid an "else"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoldb: Fix a typo
Volker Lendecke [Tue, 6 Sep 2022 10:35:20 +0000 (12:35 +0200)] 
ldb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoldb: Fix a typo
Volker Lendecke [Tue, 6 Sep 2022 10:15:14 +0000 (12:15 +0200)] 
ldb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibrpc: Simplify ndr_size_dom_sid28()
Volker Lendecke [Wed, 31 Aug 2022 15:35:42 +0000 (17:35 +0200)] 
librpc: Simplify ndr_size_dom_sid28()

Don't duplicate the calculation

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibrpc: Simplify ndr_size_dom_sid28()
Volker Lendecke [Wed, 31 Aug 2022 15:35:03 +0000 (17:35 +0200)] 
librpc: Simplify ndr_size_dom_sid28()

all_zero() treats a NULL pointer as true.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Save a few lines by using tevent_req_nterror()'s retval
Volker Lendecke [Thu, 1 Sep 2022 10:30:57 +0000 (12:30 +0200)] 
smbd: Save a few lines by using tevent_req_nterror()'s retval

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosamba-tool ntacl: better messages for missing files
Douglas Bagnall [Wed, 10 Aug 2022 23:26:44 +0000 (11:26 +1200)] 
samba-tool ntacl: better messages for missing files

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Sep  7 06:02:20 UTC 2022 on sn-devel-184

3 years agopysmbd: set_nt_acl() can raise FileNotFoundError
Douglas Bagnall [Thu, 1 Sep 2022 01:18:12 +0000 (01:18 +0000)] 
pysmbd: set_nt_acl() can raise FileNotFoundError

rather than an NTStatusError, which is harder to decipher, and which
carries less information (namely, not the name of the problematic file).

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopysmbd: get_nt_acl() raises FileNotFoundError if appropriate
Douglas Bagnall [Wed, 31 Aug 2022 23:25:26 +0000 (11:25 +1200)] 
pysmbd: get_nt_acl() raises FileNotFoundError if appropriate

rather than an NTStatusError, which is harder to decipher, and which
carries less information (namely, not the name of the problematic
file).

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopysmbd: avoid leaks in get_nt_acl()
Douglas Bagnall [Wed, 31 Aug 2022 23:06:03 +0000 (11:06 +1200)] 
pysmbd: avoid leaks in get_nt_acl()

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopybindings: xattr_native raises OSError not TypeError
Douglas Bagnall [Wed, 7 Sep 2022 00:56:37 +0000 (12:56 +1200)] 
pybindings: xattr_native raises OSError not TypeError

Most likely it is a bad filename or attribute, not the wrong type of
argument.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest: posixacl getntacl should raise OSError
Douglas Bagnall [Wed, 7 Sep 2022 00:46:42 +0000 (12:46 +1200)] 
pytest: posixacl getntacl should raise OSError

Not TypeError, which is supposed to be about Python data types. This
way we get to check/see an errno and strerror, and will allow us to
set the filename which will be useful for some errors.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest: samba-tool ntacl should report errors better
Douglas Bagnall [Wed, 31 Aug 2022 22:29:59 +0000 (10:29 +1200)] 
pytest: samba-tool ntacl should report errors better

We want `samba-tool ntacl sysvolreset` and `samba-tool ntacl
sysvolcheck` to fail when the Policies folder is not in place, but not
to produce an inscrutable stacktrace.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool domain: use string_to_level helper()
Douglas Bagnall [Wed, 31 Aug 2022 02:40:46 +0000 (14:40 +1200)] 
samba-tool domain: use string_to_level helper()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Tue Sep  6 22:07:23 UTC 2022 on sn-devel-184

3 years agosamba-tool domain: add string_to_level() helper
Douglas Bagnall [Wed, 31 Aug 2022 01:47:45 +0000 (13:47 +1200)] 
samba-tool domain: add string_to_level() helper

Reverse transform of level_to_string(), obviously.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool domain: expand string_version_to_constant range
Douglas Bagnall [Wed, 31 Aug 2022 01:35:57 +0000 (13:35 +1200)] 
samba-tool domain: expand string_version_to_constant range

This won't actually have any effect yet -- the new values are
inaccessible in the place it is used because the range is limited by
the --function-level option config.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool domain show: report level 2016
Douglas Bagnall [Wed, 31 Aug 2022 01:13:20 +0000 (13:13 +1200)] 
samba-tool domain show: report level 2016

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool domain show: use level_to_string()
Douglas Bagnall [Wed, 31 Aug 2022 01:28:50 +0000 (13:28 +1200)] 
samba-tool domain show: use level_to_string()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool domain: helper function for domain level names
Douglas Bagnall [Wed, 31 Aug 2022 01:12:06 +0000 (13:12 +1200)] 
samba-tool domain: helper function for domain level names

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool ldapcmp: use CommandError on auth failure
Douglas Bagnall [Wed, 17 Aug 2022 23:53:29 +0000 (11:53 +1200)] 
samba-tool ldapcmp: use CommandError on auth failure

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool ldapcmp: use CommandError, not assertion
Douglas Bagnall [Wed, 17 Aug 2022 23:52:54 +0000 (11:52 +1200)] 
samba-tool ldapcmp: use CommandError, not assertion

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool ldapcmp: do not assume common attributes
Douglas Bagnall [Wed, 17 Aug 2022 23:38:35 +0000 (11:38 +1200)] 
samba-tool ldapcmp: do not assume common attributes

This has caused numerous reports of

ERROR(<class 'KeyError'>): uncaught exception - 'serverReferenceBL'
  File /usr/lib/python3/dist-packages/samba/netcmd/__init__.py, line 185, in _run
    return self.run(*args, **kwargs)
  File /usr/lib/python3/dist-packages/samba/netcmd/ldapcmp.py, line 957, in run
    if b1.diff(b2):
  File /usr/lib/python3/dist-packages/samba/netcmd/ldapcmp.py, line 781, in diff
    if object1 == object2:
  File /usr/lib/python3/dist-packages/samba/netcmd/ldapcmp.py, line 549, in __eq__
    return self.cmp_attrs(other)
  File /usr/lib/python3/dist-packages/samba/netcmd/ldapcmp.py, line 590, in cmp_attrs
    if isinstance(self.attributes[x], list) and isinstance(other.attributes[x], list):

because other does not have attribute 'x'.

It is better to assume other.attributes[x] is None, which will compare
as unequal to whatever self.attributes[x] is, showing up as a diff
rather than a crash.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool ldapcmp: use shorter names in cmp_attrs
Douglas Bagnall [Wed, 17 Aug 2022 23:34:53 +0000 (11:34 +1200)] 
samba-tool ldapcmp: use shorter names in cmp_attrs

This simplifies a fix in the next commit.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool ldapcmp: use ValueError, not Exception
Douglas Bagnall [Wed, 17 Aug 2022 23:32:25 +0000 (11:32 +1200)] 
samba-tool ldapcmp: use ValueError, not Exception

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: catch werror.WERR_ACCESS_DENIED
Douglas Bagnall [Wed, 17 Aug 2022 22:58:54 +0000 (10:58 +1200)] 
samba-tool dns: catch werror.WERR_ACCESS_DENIED

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: use DnsconnWrapper in zonecreate
Douglas Bagnall [Sat, 13 Aug 2022 00:55:01 +0000 (12:55 +1200)] 
samba-tool dns: use DnsconnWrapper in zonecreate

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: update_record uses DnsConnWrapper
Douglas Bagnall [Wed, 17 Aug 2022 21:21:39 +0000 (09:21 +1200)] 
samba-tool dns: update_record uses DnsConnWrapper

The special thing about this one is the dns_conn is also used in the
dns_record_match() library function, which wants a real dns
connection.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: delete uses DnsConnWrapper messages
Douglas Bagnall [Fri, 12 Aug 2022 05:17:16 +0000 (17:17 +1200)] 
samba-tool dns: delete uses DnsConnWrapper messages

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: add uses DnsConnWrapper messages
Douglas Bagnall [Fri, 12 Aug 2022 04:51:25 +0000 (16:51 +1200)] 
samba-tool dns: add uses DnsConnWrapper messages

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: query uses DnsConnWrapper messages
Douglas Bagnall [Fri, 12 Aug 2022 04:46:03 +0000 (16:46 +1200)] 
samba-tool dns: query uses DnsConnWrapper messages

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: zonedelete uses DnsConnWrapper messages
Douglas Bagnall [Fri, 12 Aug 2022 04:44:31 +0000 (16:44 +1200)] 
samba-tool dns: zonedelete uses DnsConnWrapper messages

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: NAME_DOES_NOT_EXIST errors; add docstring
Douglas Bagnall [Wed, 17 Aug 2022 05:59:50 +0000 (17:59 +1200)] 
samba-tool dns: NAME_DOES_NOT_EXIST errors; add docstring

In practice, these always refer to zones.

We're adding the docstring now, because it made no sense when
default_messages was empty.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: RECORD_DOES_NOT_EXIST errors as CommandErrors
Douglas Bagnall [Wed, 17 Aug 2022 05:58:50 +0000 (17:58 +1200)] 
samba-tool dns: RECORD_DOES_NOT_EXIST errors as CommandErrors

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: catch ZONE_ALREADY_EXISTS errors as CommandErrors
Douglas Bagnall [Wed, 17 Aug 2022 05:58:03 +0000 (17:58 +1200)] 
samba-tool dns: catch ZONE_ALREADY_EXISTS errors as CommandErrors

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: catch DS_UNAVAILABLE errors as CommandErrors
Douglas Bagnall [Wed, 17 Aug 2022 05:57:16 +0000 (17:57 +1200)] 
samba-tool dns: catch DS_UNAVAILABLE errors as CommandErrors

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: use DnsConnWrapper widely
Douglas Bagnall [Fri, 12 Aug 2022 04:40:03 +0000 (16:40 +1200)] 
samba-tool dns: use DnsConnWrapper widely

This covers all the cases where there are no existing CommandError
messages, and no other uses of the dns_conn (i.e., not cmd_update).

Forthcoming commits will introduce default messages for these.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns: add a wrapper for better error messages
Douglas Bagnall [Fri, 12 Aug 2022 04:38:59 +0000 (16:38 +1200)] 
samba-tool dns: add a wrapper for better error messages

This will help turn simple common errors into CommandError messages.

At this stage, no messages are intercepted.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool domain: fix error string for account lockout duration
Douglas Bagnall [Tue, 27 Oct 2020 20:51:06 +0000 (09:51 +1300)] 
samba-tool domain: fix error string for account lockout duration

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dbcheck: improve --help for --reset-well-known-acls
Douglas Bagnall [Thu, 11 Aug 2022 03:18:02 +0000 (15:18 +1200)] 
samba-tool dbcheck: improve --help for --reset-well-known-acls

This option is for updating from pre-4.0.4 when something went wrong
with ACLs.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool domain provision: better message if tdbbackup missing
Douglas Bagnall [Sun, 21 Aug 2022 23:48:53 +0000 (11:48 +1200)] 
samba-tool domain provision: better message if tdbbackup missing

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

Reported-by: Jeff Sadowski <jeff.sadowski@gmail.com>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: do not force a traceback on CommandError
Douglas Bagnall [Thu, 1 Sep 2022 01:16:53 +0000 (01:16 +0000)] 
samba-tool: do not force a traceback on CommandError

When a CommandError has an 'inner exception', we have been printing
drowning out the error message with a long traceback of the exception
we tried to catch.

People who really want to see tracebacks can use -d3.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: avoid traceback for NT_STATUS_NETWORK_UNREACHABLE
Douglas Bagnall [Fri, 19 Aug 2022 05:06:48 +0000 (17:06 +1200)] 
samba-tool: avoid traceback for NT_STATUS_NETWORK_UNREACHABLE

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopy/getopt: allow --option arguments to contain '='
Douglas Bagnall [Fri, 19 Aug 2022 04:53:40 +0000 (16:53 +1200)] 
py/getopt: allow --option arguments to contain '='

smb.conf lines can have = on the right hand side. For example, in
st/ad_dc/etc/smb.conf we have 3 examples, including:

 gpo update command = python3 source4/scripting/bin/samba-gpupdate [...] --target=Computer

If we tried to provide the same line via --option, it would split on
both '=', and the set value would end at '--target'.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopy/getopt: improve messages for bad --realm
Douglas Bagnall [Fri, 19 Aug 2022 04:50:54 +0000 (16:50 +1200)] 
py/getopt: improve messages for bad --realm

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopy/getopt: improve messages for bad --debug arg
Douglas Bagnall [Fri, 19 Aug 2022 04:49:24 +0000 (16:49 +1200)] 
py/getopt: improve messages for bad --debug arg

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: avoid traceback for options errors
Douglas Bagnall [Thu, 1 Sep 2022 03:32:07 +0000 (15:32 +1200)] 
samba-tool: avoid traceback for options errors

What option? None yet, but see the next two commits.

We use a local reference to optparse.OptionValueError, to save typing
and make the eventual switch to argparse easier.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: reduce repetitious jargon on credentials failure
Douglas Bagnall [Thu, 18 Aug 2022 22:12:07 +0000 (10:12 +1200)] 
samba-tool: reduce repetitious jargon on credentials failure

We already print the following due to DBG_ERR()s:

  cli_credentials_failed_kerberos_login: krb5_cc_get_principal failed: No such file or directory
  Failed to bind - LDAP error 49 LDAP_INVALID_CREDENTIALS -  <8009030C: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 52e, v1db1> <>
  Failed to connect to 'ldap://10.53.57.30' with backend 'ldap': LDAP error 49 LDAP_INVALID_CREDENTIALS -  <8009030C: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 52e, v1db1> <>

We don't *really* need to follow that with:

  ERROR(ldb): LDAP connection to ldap://10.53.57.30 failed  - LDAP error 49 LDAP_INVALID_CREDENTIALS -  <8009030C: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 52e, v1db1> <>

rather we can say:

  Bad username or password.

Also, we don't really need to print a traceback, which we seem to do
for some commands and not others.

Maybe *sometimes* "bad username or password" might be technically
incorrect (e.g. --simple-bind-dn), but in those cases the user is
already behaving strangely, and they will still see the
LDAP_INVALID_CREDENTIALS twice. Kerberos failures don't come this way.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4/tests/samba-tool drs showrepl: test NO_COLOR and --color variants
Douglas Bagnall [Wed, 17 Aug 2022 02:28:15 +0000 (14:28 +1200)] 
s4/tests/samba-tool drs showrepl: test NO_COLOR and --color variants

"--color variants" meaning --color=always instead of --color=yes, etc.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agos4/tests/samba-tool drs showrepl: use vars for common strings
Douglas Bagnall [Wed, 17 Aug 2022 02:26:29 +0000 (14:26 +1200)] 
s4/tests/samba-tool drs showrepl: use vars for common strings

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agosamba-tool: respect NO_COLOR env variable and --color options
Douglas Bagnall [Tue, 6 Jul 2021 22:43:59 +0000 (10:43 +1200)] 
samba-tool: respect NO_COLOR env variable and --color options

This allows the NO_COLOR environment variable and --color=never to
work for samba-tool commands that use this method. So far that means
some parts of drs showrepl.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agopy/samba/logger: respect NO_COLOR env variable
Douglas Bagnall [Tue, 6 Jul 2021 22:43:17 +0000 (10:43 +1200)] 
py/samba/logger: respect NO_COLOR env variable

As per https://no-color.org/

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agopython/colour: helper functions to read all signs
Douglas Bagnall [Wed, 19 Jan 2022 23:32:48 +0000 (12:32 +1300)] 
python/colour: helper functions to read all signs

The accepted hints are presumably arguments to --color.
We follow the behaviour of `ls` in what we accept.

`git` is stricter, accepting only {always,never,auto}.
`grep` is looser accepting mixed case variants.
historically we have used {yes,no,auto}.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agosamba-tool visualise: expand set of --color switches
Douglas Bagnall [Wed, 17 Aug 2022 01:15:15 +0000 (13:15 +1200)] 
samba-tool visualise: expand set of --color switches

To match convention, and elsewhere.

We can't easily use colour.is_colour_wanted() because we could (via
--output) be intending to write to a file that isn't open yet, so we
have no .isatty() to query.

Also, because --color-scheme implies --color (as documented in
--help), it trumps most 'auto' checks, but not NO_COLOR.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agopytest/samba-tool visualize: test '--color' aliases
Douglas Bagnall [Tue, 16 Aug 2022 23:50:55 +0000 (11:50 +1200)] 
pytest/samba-tool visualize: test '--color' aliases

By convention, 'tty' is a common alias for 'auto', 'always' and
'force' mean 'yes', and 'never' means no. It seems 'never; and
'always' are more common than 'yes' and 'no'.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agosamba-tool visualize: remove py2 compat for colour calculations
Douglas Bagnall [Tue, 16 Aug 2022 23:57:00 +0000 (11:57 +1200)] 
samba-tool visualize: remove py2 compat for colour calculations

io.StringIO has .isatty(); the old cStringIO did not,

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agosamba-tool visualize: respect $NO_COLOR
Douglas Bagnall [Tue, 16 Aug 2022 23:51:40 +0000 (11:51 +1200)] 
samba-tool visualize: respect $NO_COLOR

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agopytest samba-tool visualize: extend colour tests for $NO_COLOR
Douglas Bagnall [Tue, 16 Aug 2022 02:04:57 +0000 (14:04 +1200)] 
pytest samba-tool visualize: extend colour tests for $NO_COLOR

As described at https://no-color.org/, the NO_COLOR environment
variable is a widely used defacto-ish standard for asking for no
colour. If someone goes

                NO_COLOR=whatever samba-tool ...

we want to assume they want no ANSI colour codes, as if they had used
--color=no. But first we want to test that, so here we are.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agopytest/samba-tool visualize: fix docstring
Douglas Bagnall [Tue, 16 Aug 2022 23:48:58 +0000 (11:48 +1200)] 
pytest/samba-tool visualize: fix docstring

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agopytest: SambaToolCmdTest allows easier StringIO replacement
Douglas Bagnall [Sun, 14 Aug 2022 00:08:16 +0000 (12:08 +1200)] 
pytest: SambaToolCmdTest allows easier StringIO replacement

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agopytests: move ValidNetbiosNameTests to samba.tests.netbios
Douglas Bagnall [Thu, 9 Jun 2022 03:16:44 +0000 (15:16 +1200)] 
pytests: move ValidNetbiosNameTests to samba.tests.netbios

These were the only tests in __init__.py.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agopytest/samba_tool_drs_no_dns: use TestCaseInTempDir.rm_files/.rm_dirs
Douglas Bagnall [Wed, 15 Jun 2022 01:23:32 +0000 (13:23 +1200)] 
pytest/samba_tool_drs_no_dns: use TestCaseInTempDir.rm_files/.rm_dirs

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agopytest/samba_tool_drs: use TestCaseInTempDir.rm_files/.rm_dirs
Douglas Bagnall [Wed, 8 Jun 2022 07:53:57 +0000 (19:53 +1200)] 
pytest/samba_tool_drs: use TestCaseInTempDir.rm_files/.rm_dirs

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agopytest/samdb: use TestCaseInTempDir.rm_files/.rm_dirs
Douglas Bagnall [Wed, 15 Jun 2022 01:22:24 +0000 (13:22 +1200)] 
pytest/samdb: use TestCaseInTempDir.rm_files/.rm_dirs

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agopytest/join: use TestCaseInTempDir.rm_files/dirs
Douglas Bagnall [Wed, 15 Jun 2022 01:21:16 +0000 (13:21 +1200)] 
pytest/join: use TestCaseInTempDir.rm_files/dirs

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>