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