]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
4 years agos3: VFS: crossrename. Use real dirfsp for SMB_VFS_RENAMEAT()
Jeremy Allison [Thu, 17 Jun 2021 04:01:33 +0000 (21:01 -0700)] 
s3: VFS: crossrename. Use real dirfsp for SMB_VFS_RENAMEAT()

Finally fix the promise from the docs that this module is stackable. Re-use copy_internals().

This is a horrible module that must be removed !

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: Make copy_internals() public. vfs_crossrename() will be changed to use...
Jeremy Allison [Thu, 17 Jun 2021 16:54:58 +0000 (09:54 -0700)] 
s3: smbd: Make copy_internals() public. vfs_crossrename() will be changed to use this.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: syncops. Do early return in syncops_renameat().
Jeremy Allison [Thu, 17 Jun 2021 19:16:58 +0000 (12:16 -0700)] 
s3: VFS: syncops. Do early return in syncops_renameat().

Makes the code path clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: syncops. Do early return in syncops_linkat()
Jeremy Allison [Thu, 17 Jun 2021 19:31:19 +0000 (12:31 -0700)] 
s3: VFS: syncops. Do early return in syncops_linkat()

We should always do the operation first, then try the sync.
Failure to sync is not reported as an error, so failure
to create the full_fnames shouldn't fail the operation either.

Makes the code path clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: syncops: Do early returns in SYNCOPS_NEXT_SMB_FNAME() macro.
Jeremy Allison [Thu, 17 Jun 2021 19:23:46 +0000 (12:23 -0700)] 
s3: VFS: syncops: Do early returns in SYNCOPS_NEXT_SMB_FNAME() macro.

Makes the macro much clearer.

We should always do the operation first, then try the sync.
Failure to sync is not reported as an error, so failure
to create the full_fname shouldn't fail the operation either.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: syncops: Remove direct system calls and use OpenDir()/smb_vfs_fsync_sync...
Jeremy Allison [Thu, 17 Jun 2021 19:10:16 +0000 (12:10 -0700)] 
s3: VFS: syncops: Remove direct system calls and use OpenDir()/smb_vfs_fsync_sync()/TALLOC_FREE() to sync a directory.

syncops is now *really* stackable.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: syncops: Add 'connection_struct *conn' to syncops_sync_directory().
Jeremy Allison [Thu, 17 Jun 2021 19:01:48 +0000 (12:01 -0700)] 
s3: VFS: syncops: Add 'connection_struct *conn' to syncops_sync_directory().

Remove 'const' from 'char *dname' parameter. This is always a talloc
allocated pointer.

Not yet used. This will allow us to make syncops really stackable later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: Add 'connection_struct *conn' parameter to syncops_two_names().
Jeremy Allison [Thu, 17 Jun 2021 18:58:54 +0000 (11:58 -0700)] 
s3: VFS: Add 'connection_struct *conn' parameter to syncops_two_names().

Not yet used. This will allow us to make syncops really stackable later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: syncops. Add 'connection_struct *conn' to syncops_smb_fname().
Jeremy Allison [Thu, 17 Jun 2021 18:55:50 +0000 (11:55 -0700)] 
s3: VFS: syncops. Add 'connection_struct *conn' to syncops_smb_fname().

Not yet used. This will allow us to make syncops really stackable later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: lib: In adouble_path(), if the parent directory name is ".", don't prepend "...
Jeremy Allison [Thu, 17 Jun 2021 04:10:55 +0000 (21:10 -0700)] 
s3: lib: In adouble_path(), if the parent directory name is ".", don't prepend "./" to the outgoing filename.

We expect smb_fname->base_name values to not contain "./name".

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: Cleanup. Remove SMB_VFS_FSYNC() macro.
Jeremy Allison [Thu, 17 Jun 2021 17:57:27 +0000 (10:57 -0700)] 
s3: VFS: Cleanup. Remove SMB_VFS_FSYNC() macro.

This hasn't been used since bc71cd035c816de4ca98002860496bf8f5d50fe3.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agotorture: Fix build on freebsd, missing deps on cmdline
Amitay Isaacs [Wed, 16 Jun 2021 02:58:27 +0000 (12:58 +1000)] 
torture: Fix build on freebsd, missing deps on cmdline

Missing dependency causes build failure on freebsd.

[2928/3944] Compiling source4/torture/util_smb.c
In file included from ../../source4/torture/util_smb.c:22:
../../lib/cmdline/cmdline.h:22:10: fatal error: 'popt.h' file not found
         ^~~~~~~~
1 error generated.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jun 22 02:05:17 UTC 2021 on sn-devel-184

4 years agosamba-tool: dbcheck search DnsAdmins from wellknown container
David Mulder [Wed, 26 Aug 2020 20:59:24 +0000 (14:59 -0600)] 
samba-tool: dbcheck search DnsAdmins from wellknown container

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9143
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamba-tool: Provision search DnsAdmins from wellknown container
David Mulder [Wed, 26 Aug 2020 20:33:13 +0000 (14:33 -0600)] 
samba-tool: Provision search DnsAdmins from wellknown container

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9143
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamba-tool: Demote computer to wellknown container
David Mulder [Wed, 26 Aug 2020 16:06:21 +0000 (10:06 -0600)] 
samba-tool: Demote computer to wellknown container

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9143
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamdb: Create computer in wellknown user container
David Mulder [Wed, 26 Aug 2020 14:15:07 +0000 (08:15 -0600)] 
samdb: Create computer in wellknown user container

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9143
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamdb: Create group in wellknown user container
David Mulder [Tue, 25 Aug 2020 20:16:30 +0000 (14:16 -0600)] 
samdb: Create group in wellknown user container

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9143
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamdb: Create user in wellknown user container
David Mulder [Tue, 25 Aug 2020 18:44:02 +0000 (12:44 -0600)] 
samdb: Create user in wellknown user container

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9143
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dcerpc/dnsserver: fix tombstone test
Douglas Bagnall [Fri, 26 Mar 2021 03:37:52 +0000 (16:37 +1300)] 
pytest: dcerpc/dnsserver: fix tombstone test

It worked accidentally, like all our tombstone tests.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest/dns_forwarder: remove unused function and imports
Douglas Bagnall [Wed, 19 May 2021 01:12:49 +0000 (01:12 +0000)] 
pytest/dns_forwarder: remove unused function and imports

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest segfaults: add a couple more failing tests
Douglas Bagnall [Wed, 19 May 2021 02:38:20 +0000 (02:38 +0000)] 
pytest segfaults: add a couple more failing tests

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest samba-tool dns: avoid testing update of '.' PTR
Douglas Bagnall [Fri, 18 Jun 2021 01:26:53 +0000 (13:26 +1200)] 
pytest samba-tool dns: avoid testing update of '.' PTR

This will fail for reasons that maybe we don't care about.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: do not insist on non-aging timestamp updates
Douglas Bagnall [Sat, 19 Jun 2021 22:18:46 +0000 (10:18 +1200)] 
pytest: dns_aging: do not insist on non-aging timestamp updates

With Windows, when aging is off, the record timestamps are updated
anyway, but the timestamp change is not replicated.

We are not going to do it like that. With aging off, our records will
keep their first timestamp.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging sibling test fails on windows
Douglas Bagnall [Sat, 19 Jun 2021 03:54:11 +0000 (15:54 +1200)] 
pytest: dns_aging sibling test fails on windows

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest dns_aging: add windows_variation
Douglas Bagnall [Sat, 19 Jun 2021 03:43:29 +0000 (15:43 +1200)] 
pytest dns_aging: add windows_variation

We want to sometimes be able to say "we know Windows fails, it fails
like this, it is OK", so that when we run the tests on Windows we know
the failures are not unexpected.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: fix two tests (bad arithmetic)
Douglas Bagnall [Sat, 19 Jun 2021 02:52:47 +0000 (14:52 +1200)] 
pytest: dns_aging: fix two tests (bad arithmetic)

oops.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest dns_aging: add sibling tests
Douglas Bagnall [Sat, 19 Jun 2021 02:18:05 +0000 (14:18 +1200)] 
pytest dns_aging: add sibling tests

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest dns_aging: add simple delete tests
Douglas Bagnall [Sat, 19 Jun 2021 01:35:54 +0000 (13:35 +1200)] 
pytest dns_aging: add simple delete tests

When records are added and deleted and added again, Windows gets all
kinds of ideas about what should happen, and many of our tests explore
that. Here we focus the simplest case with a variety of timestamp
combinations.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: samba-tool dns: allow identical updates
Douglas Bagnall [Thu, 17 Jun 2021 10:43:39 +0000 (22:43 +1200)] 
pytest: samba-tool dns: allow identical updates

We know this should work from tests of the underlying RPC calls on
Windows (see dns_aging).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: samba-tool dns: allow valid updates
Douglas Bagnall [Thu, 17 Jun 2021 10:22:46 +0000 (22:22 +1200)] 
pytest: samba-tool dns: allow valid updates

Without this patch we will get errors like this when in-place RPC
updates start to work:

   AssertionError: unexpectedly None : Successfully updated record
   '192.168.0.1' to '192.168.0.1', even though the latter is of type
   'A' where 'A' was expected.

That's because we have always rejected updates that try to modify an
existing record. We shouldn't.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: test delete multiple records
Douglas Bagnall [Fri, 18 Jun 2021 06:32:22 +0000 (18:32 +1200)] 
pytest: dns_aging: test delete multiple records

Using dns.DNS_QCLASS_ANY we can delete all the records of a certain
type. What happens to other timestamps? The answer should be nothing.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: test RPC updates of disparate types
Douglas Bagnall [Thu, 17 Jun 2021 11:10:50 +0000 (23:10 +1200)] 
pytest: dns_aging: test RPC updates of disparate types

Can a TXT record be replaced by an A record in an RPC update?

According to Windows, yes.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopython dns: dns_record_match() matches IPv6 semantically
Douglas Bagnall [Thu, 17 Jun 2021 23:30:09 +0000 (11:30 +1200)] 
python dns: dns_record_match() matches IPv6 semantically

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: Remove -d10 from test startup
Andrew Bartlett [Fri, 18 Jun 2021 11:49:13 +0000 (23:49 +1200)] 
selftest: Remove -d10 from test startup

It looks like "python:tests: Add SAMR password change tests for fips"
(which is also the title of 9a3ba502d8193b25799ef92917efafd52de2e8c2,
but this is also unrelated) and was a probalby a rebase artifact,
being a debugging aid that should have been omitted.

This reverts commit ebd687335b9accfdbae7dbc65c9882ab4d5c0986.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Mon Jun 21 01:46:58 UTC 2021 on sn-devel-184

4 years agotestprogs/blackbox: Remove joined dc for ldapcmp
Andrew Bartlett [Fri, 18 Jun 2021 11:48:26 +0000 (23:48 +1200)] 
testprogs/blackbox: Remove joined dc for ldapcmp

We don't need this DC once the ldapcmp is over, and it avoids
the running DC spamming the logs looking for it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agopython/samba/tests: Remove DCs joined to test samba-tool behaviour
Andrew Bartlett [Fri, 18 Jun 2021 08:46:51 +0000 (20:46 +1200)] 
python/samba/tests: Remove DCs joined to test samba-tool behaviour

Otherwise we have the live DCs spamming the logs looking for the
long-gone test servers:

Failed to connect host fd00::5357:5f0b on port 135 - NT_STATUS_OBJECT_NAME_NOT_FOUND
Failed to connect host fd00::5357:5f0b (6f44653d-18c8-4bf4-b2e7-6f85cf7b0f74._msdcs.addom.samba.example.com) on port 135 - NT_STATUS_OBJECT_NAME_NOT_FOUND.
Failed to connect host 10.53.57.11 on port 135 - NT_STATUS_OBJECT_NAME_NOT_FOUND
Failed to connect host 10.53.57.11 (6f44653d-18c8-4bf4-b2e7-6f85cf7b0f74._msdcs.addom.samba.example.com) on port 135 - NT_STATUS_OBJECT_NAME_NOT_FOUND.
Failed to connect host 10.53.57.12 on port 135 - NT_STATUS_OBJECT_NAME_NOT_FOUND

This avoids spamming the GitLab pipeline logs with a lot of noise,
as there is a size limit to the output, as well as being cleaner.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoWHATSNEW: Improved cmdline user experience
Andreas Schneider [Thu, 17 Dec 2020 14:58:27 +0000 (15:58 +0100)] 
WHATSNEW: Improved cmdline user experience

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jun 21 00:10:21 UTC 2021 on sn-devel-184

4 years agolib:cmdline: Improve doxygen documentation
Andreas Schneider [Tue, 11 May 2021 07:13:51 +0000 (09:13 +0200)] 
lib:cmdline: Improve doxygen documentation

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodocs-xml: Remove unused manpage entities
Andreas Schneider [Wed, 7 Apr 2021 10:31:10 +0000 (12:31 +0200)] 
docs-xml: Remove unused manpage entities

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodocs-xml: Update samba-tool manpage for option parser changes
Andreas Schneider [Wed, 7 Apr 2021 12:25:41 +0000 (14:25 +0200)] 
docs-xml: Update samba-tool manpage for option parser changes

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopython: Streamline option parser of python tools
Andreas Schneider [Wed, 7 Apr 2021 12:16:52 +0000 (14:16 +0200)] 
python: Streamline option parser of python tools

The python tools, especially samba-tool should have the same option set
as the rest of the client utils.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodocs-xml: Use new cmdline entities for traffic_replay.7 manpage
Andreas Schneider [Thu, 11 Feb 2021 13:46:18 +0000 (14:46 +0100)] 
docs-xml: Use new cmdline entities for traffic_replay.7 manpage

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodocs-xml: Update winexe.1 manpage for new cmdline opition parser
Andreas Schneider [Thu, 11 Feb 2021 13:49:42 +0000 (14:49 +0100)] 
docs-xml: Update winexe.1 manpage for new cmdline opition parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agowinexe: Some code cleanup and fixes
Andreas Schneider [Thu, 8 Apr 2021 08:16:54 +0000 (10:16 +0200)] 
winexe: Some code cleanup and fixes

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agowinexe: Use the new cmdline option parser
Andreas Schneider [Fri, 15 Jan 2021 15:34:55 +0000 (16:34 +0100)] 
winexe: Use the new cmdline option parser

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:lib: Remove obsolete popt cmdline parser
Andreas Schneider [Thu, 14 Jan 2021 12:05:05 +0000 (13:05 +0100)] 
s4:lib: Remove obsolete popt cmdline parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibrpc:tools: Migrate ndrdump to new cmdline option parser
Andreas Schneider [Thu, 14 Jan 2021 10:03:12 +0000 (11:03 +0100)] 
librpc:tools: Migrate ndrdump to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibrpc:tools: Remove '-l' which conflicts with '-l|--log-basename'
Andreas Schneider [Fri, 15 Jan 2021 08:21:56 +0000 (09:21 +0100)] 
librpc:tools: Remove '-l' which conflicts with '-l|--log-basename'

The common cmdline parser already provides '-l'.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodocs-xml: Update wbinfo.1 manpage for new cmdline opition parser
Andreas Schneider [Thu, 11 Feb 2021 13:35:40 +0000 (14:35 +0100)] 
docs-xml: Update wbinfo.1 manpage for new cmdline opition parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agonsswitch: Migrate wbinfo to new cmdline option parser
Andreas Schneider [Thu, 14 Jan 2021 09:53:35 +0000 (10:53 +0100)] 
nsswitch: Migrate wbinfo to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:nbt: Migrate nmblookup4 to new cmdline option parser
Andreas Schneider [Thu, 14 Jan 2021 09:50:28 +0000 (10:50 +0100)] 
libcli:nbt: Migrate nmblookup4 to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:utils: Migrate oLschema2ldif to new cmdline option parser
Andreas Schneider [Thu, 14 Jan 2021 09:43:33 +0000 (10:43 +0100)] 
s4:utils: Migrate oLschema2ldif to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:registry: Migrate regpatch to new cmdline option parser
Andreas Schneider [Thu, 14 Jan 2021 08:23:25 +0000 (09:23 +0100)] 
s4:registry: Migrate regpatch to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:registry: Migrate regtree to new cmdline option parser
Andreas Schneider [Thu, 14 Jan 2021 08:15:57 +0000 (09:15 +0100)] 
s4:registry: Migrate regtree to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:registry: Migrate regdiff to new cmdline option parser
Andreas Schneider [Thu, 14 Jan 2021 07:59:34 +0000 (08:59 +0100)] 
s4:registry: Migrate regdiff to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:registry: Migrate regshell to new cmdline option parser
Andreas Schneider [Fri, 18 Dec 2020 13:25:32 +0000 (14:25 +0100)] 
s4:registry: Migrate regshell to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodsdb periodic: DNS: split aging from tombstone deletion
Douglas Bagnall [Sat, 10 Apr 2021 02:08:09 +0000 (14:08 +1200)] 
dsdb periodic: DNS: split aging from tombstone deletion

We have been conflating two things (under the term "scavenging"):

1. aging out stale DNS records into tombstones, which only happens if
   this feature is switched on in general and for the zone.

2. removing expired DNS tombstones, which should always happen
   (because we tombstone nodes in *other* ways).

With this patch, we un-conflate.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: add an explanatory comment
Douglas Bagnall [Wed, 14 Apr 2021 04:13:01 +0000 (16:13 +1200)] 
dns scavenging: add an explanatory comment

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: ensure tombstoned node has one record
Douglas Bagnall [Sun, 11 Apr 2021 11:39:24 +0000 (23:39 +1200)] 
dns scavenging: ensure tombstoned node has one record

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: avoid leak in dns_tombstone_records
Douglas Bagnall [Tue, 13 Apr 2021 04:31:10 +0000 (16:31 +1200)] 
dns scavenging: avoid leak in dns_tombstone_records

As always, we forget to free our zones. Also to check our zones.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: log tombstone inconsistency
Douglas Bagnall [Fri, 9 Apr 2021 05:50:59 +0000 (17:50 +1200)] 
dns scavenging: log tombstone inconsistency

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: tighten lifetime of filtered records
Douglas Bagnall [Mon, 14 Jun 2021 11:16:46 +0000 (23:16 +1200)] 
dns scavenging: tighten lifetime of filtered records

We were ending up with everything lasting as long as
kccsrv_periodic_run(), which could add to quite a pile.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: avoid useless copy of msg
Douglas Bagnall [Sun, 11 Apr 2021 01:45:19 +0000 (13:45 +1200)] 
dns scavenging: avoid useless copy of msg

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: simplify copy_current_records
Douglas Bagnall [Mon, 29 Mar 2021 00:09:30 +0000 (13:09 +1300)] 
dns scavenging: simplify copy_current_records

We don't need to pull and push to make a byte identical copy of an ldb
value, nor do we need a temporary array.

As part of this, we avoid leaving a dangling el->num_values pointing
into space where there were no actually allocated values, which is not
how we do things, even briefly.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: avoid passing blobs
Douglas Bagnall [Sun, 11 Apr 2021 01:15:29 +0000 (13:15 +1200)] 
dns scavenging: avoid passing blobs

We can construct these ldb values for each zone with minimal cost and
it is less bamboozling to do so.

While we're fiddling with signatures, we can make this used-once local
function static.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: ensure usual ownership of element values
Douglas Bagnall [Mon, 29 Mar 2021 00:11:01 +0000 (13:11 +1300)] 
dns scavenging: ensure usual ownership of element values

An ldb message, its elements, and their values usually all share a
little talloc sub-tree with each other and nobody else. It is
conceivable that somewhere we rely on that.

In this case we were sharing an out-of-subtree values array across
multiple messages, which seems to be asking for trouble.

Also, add a comment explaining what we want.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: avoid setting same flags twice
Douglas Bagnall [Mon, 29 Mar 2021 00:10:50 +0000 (13:10 +1300)] 
dns scavenging: avoid setting same flags twice

We already did this with db_msg_add_empty(), ~20 lines up.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: avoid another small memory leak
Douglas Bagnall [Wed, 14 Apr 2021 05:35:01 +0000 (17:35 +1200)] 
dns scavenging: avoid another small memory leak

We weren't freeing the zones, which is admittedly tricky with the dlink
list.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: avoid a small memory leak
Douglas Bagnall [Mon, 29 Mar 2021 22:25:36 +0000 (11:25 +1300)] 
dns scavenging: avoid a small memory leak

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: correctly set tombstome timestamp
Douglas Bagnall [Sat, 27 Mar 2021 09:59:08 +0000 (22:59 +1300)] 
dns scavenging: correctly set tombstome timestamp

In a DNS tombstone record, the dwTimestamp is, as always, uint32_t hours
since 1601, while the wType-switched .data.EntombedTime timestamp is NTTIME.

We had that wrong, putting the hours in both places.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns scavenging: tombstone deletion uses correct time units
Douglas Bagnall [Sat, 5 Jun 2021 06:04:55 +0000 (18:04 +1200)] 
dns scavenging: tombstone deletion uses correct time units

Before we were comparing hours to 1e-7 second units.

Now we do it both ways. That's because in dns_tombstone_records (in
this same file) we have been putting hour timestamps in EntombedTime,
but this field is supposed to have NTTIME timestamps, and those
timestamps won't have updated themselves.

This wouldn't matter much in pure Samba networks if we weren't also
using the correct timestamp in dns_common_replace().

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest dns_aging: test tombstone timestamp ranges
Douglas Bagnall [Wed, 16 Jun 2021 22:48:56 +0000 (22:48 +0000)] 
pytest dns_aging: test tombstone timestamp ranges

We have always used hours where we are meant to use NTTIME. Let's make
sure we don't break old tombstones.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: remove a test that fails on Windows
Douglas Bagnall [Wed, 16 Jun 2021 22:51:42 +0000 (22:51 +0000)] 
pytest: dns_aging: remove a test that fails on Windows

This fails on Windows due to apparent races between the RPC, DNS, and
LDAP servers. There is no point having it sit there doing nothing.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: add Samba-specific scavenging test
Douglas Bagnall [Mon, 14 Jun 2021 11:41:14 +0000 (23:41 +1200)] 
pytest: dns_aging: add Samba-specific scavenging test

We can't make scavenging happen on demand on Windows, so we just
concentrate on Samba here.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: try queries of recently tombstoned nodes
Douglas Bagnall [Mon, 14 Jun 2021 11:41:07 +0000 (23:41 +1200)] 
pytest: dns_aging: try queries of recently tombstoned nodes

Windows fails this one.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging tests deletions using DNS update
Douglas Bagnall [Mon, 14 Jun 2021 11:39:53 +0000 (23:39 +1200)] 
pytest: dns_aging tests deletions using DNS update

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: remove/fix unused helper functions
Douglas Bagnall [Mon, 14 Jun 2021 11:30:23 +0000 (23:30 +1200)] 
pytest: dns_aging: remove/fix unused helper functions

self.rpc_delete_txt() will be used next commit.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: helper to get non-tombstoned records
Douglas Bagnall [Mon, 14 Jun 2021 11:37:37 +0000 (23:37 +1200)] 
pytest: dns_aging: helper to get non-tombstoned records

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: add helper for DNS delete updates
Douglas Bagnall [Mon, 14 Jun 2021 11:36:57 +0000 (23:36 +1200)] 
pytest: dns_aging: add helper for DNS delete updates

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: correct typo mis-assertions in 2 tests
Douglas Bagnall [Mon, 14 Jun 2021 11:36:04 +0000 (23:36 +1200)] 
pytest: dns_aging: correct typo mis-assertions in 2 tests

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: remind developers to use fl2003
Douglas Bagnall [Fri, 11 Jun 2021 05:31:54 +0000 (17:31 +1200)] 
pytest: dns_aging: remind developers to use fl2003

By "developers", I of course mean "me".

Other environments insist on secure updates, which these tests don't
do.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: dns_aging: use assert_timestamps_equal() widely
Douglas Bagnall [Thu, 10 Jun 2021 23:31:09 +0000 (23:31 +0000)] 
pytest: dns_aging: use assert_timestamps_equal() widely

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: add A and AAAA aging tests
Douglas Bagnall [Thu, 10 Jun 2021 23:30:19 +0000 (23:30 +0000)] 
pytest: add A and AAAA aging tests

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytest: adjust dns_aging to handle some non-TXT records
Douglas Bagnall [Thu, 10 Jun 2021 23:29:15 +0000 (23:29 +0000)] 
pytest: adjust dns_aging to handle some non-TXT records

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopytests: dns_aging get informative assertions
Douglas Bagnall [Wed, 9 Jun 2021 23:58:43 +0000 (11:58 +1200)] 
pytests: dns_aging get informative assertions

When trying to understand the results of these tests, it is not very
helpful to have messages like:

AssertionError: 3685511 != 3685343

when the only thing you want to know is the difference between these two
numbers. So here we make timestamp specific assertions.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopython:tests: Fix group_edit test with system libldb
Andreas Schneider [Thu, 17 Jun 2021 13:02:59 +0000 (15:02 +0200)] 
python:tests: Fix group_edit test with system libldb

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Jun 20 22:52:05 UTC 2021 on sn-devel-184

4 years agopython:tests: Fix user_edit test with system libldb
Andreas Schneider [Thu, 17 Jun 2021 13:00:21 +0000 (15:00 +0200)] 
python:tests: Fix user_edit test with system libldb

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopython:tests: Fix contact_edit test with system libldb
Andreas Schneider [Thu, 17 Jun 2021 12:57:41 +0000 (14:57 +0200)] 
python:tests: Fix contact_edit test with system libldb

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamba-tool: Ensure commands don't crash without ad-dc
David Mulder [Thu, 17 Jun 2021 21:20:41 +0000 (15:20 -0600)] 
samba-tool: Ensure commands don't crash without ad-dc

This simply ensures against import errors when
samba is built without the ad-dc. Calling every
help message guarantees the imports succeeded.
The test is intentionally run against the
fileserver test environment, because it's
configured --without-ad-dc and does not disable
ads.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodns: Enable dnsserver_common install when not ad dc
David Mulder [Thu, 10 Jun 2021 15:53:56 +0000 (09:53 -0600)] 
dns: Enable dnsserver_common install when not ad dc

dnsserver_common is enabled without the ad-dc to
prevent imports from failing when samba-tool is
called where the ad-dc was not built. The
server-side dns code is used in the client when
we do direct LDAP modification of DNS records.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamba-tool: Disable AD DC options in samba-tool domain
David Mulder [Fri, 18 Sep 2020 17:28:02 +0000 (11:28 -0600)] 
samba-tool: Disable AD DC options in samba-tool domain

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamba-tool: Enable samba-tool without ad dc (but with ads)
David Mulder [Thu, 17 Sep 2020 19:26:18 +0000 (13:26 -0600)] 
samba-tool: Enable samba-tool without ad dc (but with ads)

Much of samba-tool can operate without the full AD DC,
for remote operations.

However the samba-tool gpo command depends on ads being
built. Without ads, every samba-tool command
crashes because ads imports fail.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos3:modules: Reduce debug level if file doesn't exists on dfs share
Andreas Schneider [Wed, 26 May 2021 13:04:08 +0000 (15:04 +0200)] 
s3:modules: Reduce debug level if file doesn't exists on dfs share

There is software out there trying to open desktop.ini in every
directory. Avoid spamming the logs with error messages.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 18 18:14:11 UTC 2021 on sn-devel-184

4 years agos3: smbd: Optimization in non_widelink_open(). Don't need to vfs_ChDir(parent_dir_fna...
Jeremy Allison [Wed, 16 Jun 2021 22:10:37 +0000 (15:10 -0700)] 
s3: smbd: Optimization in non_widelink_open(). Don't need to vfs_ChDir(parent_dir_fname) if parent is "."

Save several system calls if we're operating at the root of the share.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jun 18 17:21:31 UTC 2021 on sn-devel-184

4 years agos3: smbd: change_file_owner_to_parent_fsp(). Don't re-stat the pathref.
Jeremy Allison [Wed, 9 Jun 2021 23:43:04 +0000 (16:43 -0700)] 
s3: smbd: change_file_owner_to_parent_fsp(). Don't re-stat the pathref.

Optimization now becomes clear. We already have a valid stat of the parent
directory so we don't need to re-do a system call.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Change change_file_owner_to_parent() -> change_file_owner_to_parent_fsp().
Jeremy Allison [Wed, 9 Jun 2021 19:28:42 +0000 (12:28 -0700)] 
s3: smbd: Change change_file_owner_to_parent() -> change_file_owner_to_parent_fsp().

Same changes as for change_dir_owner_to_parent_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Make change_file_owner_to_parent() static.
Jeremy Allison [Wed, 9 Jun 2021 19:15:42 +0000 (12:15 -0700)] 
s3: smbd: Make change_file_owner_to_parent() static.

Only used inside open.c.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: change_dir_owner_to_parent_fsp(). Don't re-stat the pathref.
Jeremy Allison [Wed, 9 Jun 2021 23:40:08 +0000 (16:40 -0700)] 
s3: smbd: change_dir_owner_to_parent_fsp(). Don't re-stat the pathref.

Optimization now becomes clear. We already have a valid stat of the parent
directory so we don't need to re-do a system call.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Change change_dir_owner_to_parent() -> change_dir_owner_to_parent_fsp().
Jeremy Allison [Wed, 9 Jun 2021 19:13:38 +0000 (12:13 -0700)] 
s3: smbd: Change change_dir_owner_to_parent() -> change_dir_owner_to_parent_fsp().

Operate on handles only.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: open_directory(). Cleanup. We don't need 'int flags' here.
Jeremy Allison [Wed, 9 Jun 2021 19:01:03 +0000 (12:01 -0700)] 
s3: smbd: open_directory(). Cleanup. We don't need 'int flags' here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>