gary/samba-autobuild/.git
2 years agos4:client: Migrate smbclient4 to new cmdline option parser
Andreas Schneider [Thu, 19 Nov 2020 08:40:53 +0000 (09:40 +0100)]
s4:client: Migrate smbclient4 to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:client: Use a creds helper variable
Andreas Schneider [Thu, 19 Nov 2020 08:33:53 +0000 (09:33 +0100)]
s4:client: Use a creds helper variable

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotestprogs: Remove --debuglevel from test_kinit_trusts_mit.sh
Andreas Schneider [Tue, 1 Jun 2021 09:12:07 +0000 (11:12 +0200)]
testprogs: Remove --debuglevel from test_kinit_trusts_mit.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoheimdal_build: Use lib/asn1/rfc2459.opt rather than hard-coded
Andrew Bartlett [Tue, 15 Jun 2021 03:24:17 +0000 (15:24 +1200)]
heimdal_build: Use lib/asn1/rfc2459.opt rather than hard-coded

Based on patch by Stefan Metzmacher in his Heimdal upgrade branch

lib/asn1/rfc2459.opt imported from
lorikeet-heimdal-abartlet/lorikeet-heimdal-201107241840-plus-recent-changes
which is the closest tree I could find, and matches the options being
removed from the wscript_build file.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jun 15 23:25:27 UTC 2021 on sn-devel-184

2 years agoheimdal_build: Add C99 struct initializer in source4/heimdal_build/krb5-glue.c
Stefan Metzmacher [Fri, 22 Nov 2019 15:01:07 +0000 (16:01 +0100)]
heimdal_build: Add C99 struct initializer in source4/heimdal_build/krb5-glue.c

This avoids uninitiliased structure members in this dummy
structure we include to avoid including more of Heimdal.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agobuild: in SAMBA_BINARY use TO_LIST(cflags)
Stefan Metzmacher [Fri, 22 Nov 2019 15:11:41 +0000 (16:11 +0100)]
build: in SAMBA_BINARY use TO_LIST(cflags)

This avoids unfortunate issues when the cflags is
already a list, as then -fPIC becomes ['-f', 'P', 'I', 'C'].

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoheimdal_build: Provide C defines showing which Kerberos library is in use
Stefan Metzmacher [Thu, 2 Apr 2020 07:31:33 +0000 (07:31 +0000)]
heimdal_build: Provide C defines showing which Kerberos library is in use

Squashed from patches by Stefan Metzmacher as part of his Heimdal update branch

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agogse_krb5: Provide keytab name in fill_mem_keytab_from_dedicated_keytab() error strings.
Andrew Bartlett [Mon, 25 Sep 2017 02:18:34 +0000 (15:18 +1300)]
gse_krb5: Provide keytab name in fill_mem_keytab_from_dedicated_keytab() error strings.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agoheimdal_build: check for secure_getenv
Andrew Bartlett [Mon, 25 Sep 2017 23:01:37 +0000 (12:01 +1300)]
heimdal_build: check for secure_getenv

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agoheimdal_build: Set up new build groups for the Heimdal hostcc components
Andrew Bartlett [Tue, 15 Jun 2021 01:50:48 +0000 (13:50 +1200)]
heimdal_build: Set up new build groups for the Heimdal hostcc components

This is based on various patches by Stefan Metzmacher in the patch set for
the Heimdal upgrade.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agoheimdal_build: Rework Heimdal warning handling
Andrew Bartlett [Sun, 13 Jun 2021 23:14:06 +0000 (11:14 +1200)]
heimdal_build: Rework Heimdal warning handling

If we have all the right -Wno-error flags then we can enable warnings
more generally, otherwise just set -Wno-strict-overflow (if available)

Adapted from patches by Stefan Metzmacher <metze@samba.org> in his
branch to update Heimdal.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agodocs: Improve wording, fix a typo
Volker Lendecke [Sat, 12 Jun 2021 06:33:42 +0000 (08:33 +0200)]
docs: Improve wording, fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun 15 19:02:18 UTC 2021 on sn-devel-184

2 years agolibsmbclient: Avoid a call to SMBC_errno() in SMBC_mkdir_ctx()
Volker Lendecke [Tue, 15 Dec 2020 16:15:21 +0000 (17:15 +0100)]
libsmbclient: Avoid a call to SMBC_errno() in SMBC_mkdir_ctx()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmb: Factor out cli_status_to_errno() from cli_errno()
Volker Lendecke [Tue, 15 Dec 2020 16:05:34 +0000 (17:05 +0100)]
libsmb: Factor out cli_status_to_errno() from cli_errno()

cli_errno() calls far too many trivial but subtle functions, all
referencing cli->raw_status. This might be the first step towards
getting rid of that.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agorpc_server: Make get_domain_userlist() independent of errno
Volker Lendecke [Sat, 12 Jun 2021 18:46:20 +0000 (20:46 +0200)]
rpc_server: Make get_domain_userlist() independent of errno

In the "num_users==0" case (previously just return NULL) we depended
on errno==0 implicitly. When list_sessions() above in this routine had
to open smbXsrv_session_global, it could however happen that errno was
set. If then there were no users, get_domain_userlist() returned NULL
with errno set, which the callers interpreted then as a real error.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agorpc_server: Make errno return of get_logged_on_userlist explicit
Volker Lendecke [Sat, 12 Jun 2021 18:39:49 +0000 (20:39 +0200)]
rpc_server: Make errno return of get_logged_on_userlist explicit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agorpc_server: Don't rely on TCP-bind() to return EADDRINUSE
Volker Lendecke [Sat, 12 Jun 2021 10:45:30 +0000 (12:45 +0200)]
rpc_server: Don't rely on TCP-bind() to return EADDRINUSE

socket_wrapper can't do EADDRINUSE because unix domain sockets don't
do it.

This currently works correctly because right now all RPC servers
either use explicit ports or all listen on the same socket.

The new code uses a static variable, so it only helps if a single
process listens for multiple RPC sockets. It won't work if multiple
processes start listening. But in case samba-dcerpcd goes in this will
be exactly the right thing to do.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3: torture: Add POSIX-SYMLINK-GETPATHINFO regression test.
Jeremy Allison [Mon, 14 Jun 2021 23:34:14 +0000 (16:34 -0700)]
s3: torture: Add POSIX-SYMLINK-GETPATHINFO regression test.

This ensure we never blunder into indirecting a NULL fsp pointer
in the server. We already pass this, but this test will ensure
we continue to do so as we make fileserver changes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power<npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Jun 15 11:06:23 UTC 2021 on sn-devel-184

2 years agoFix for https://bugzilla.samba.org/show_bug.cgi?id=9634
Julien ROPÉ [Fri, 23 Nov 2018 14:56:59 +0000 (15:56 +0100)]
Fix for https://bugzilla.samba.org/show_bug.cgi?id=9634

Add an option to smb.conf to list authorized zone transfer clients.
Implement restriction in dlz_bind9 module to allow transfers only to selected IPs.
Deny zone transfer by default in dlz_bind9.

Adds test for the restriction in DNZ zone transfer clients.

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

Signed-off-by: Julien ROPÉ <jrope@linagora.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 11 19:28:10 UTC 2021 on sn-devel-184

2 years agos3: smbd: Remove erroneous TALLOC_FREE(smb_fname_parent) in change_file_owner_to_pare...
Jeremy Allison [Wed, 9 Jun 2021 19:22:26 +0000 (12:22 -0700)]
s3: smbd: Remove erroneous TALLOC_FREE(smb_fname_parent) in change_file_owner_to_parent() error path.

Caller is still using this !

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power<npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Fri Jun 11 10:17:46 UTC 2021 on sn-devel-184

2 years agoVFX: vxfs: Fixup some warnings
Noel Power [Wed, 9 Jun 2021 13:58:41 +0000 (14:58 +0100)]
VFX: vxfs: Fixup some warnings

../../source3/modules/vfs_vxfs.c:343:6: error: unused variable ‘i’ [-Werror=unused-variable]
  int i, offset = 0;
      ^
../../source3/modules/vfs_vxfs.c:342:17: error: unused variable ‘n_id’ [-Werror=unused-variable]
  uint32_t e_id, n_id;
                 ^~~~
../../source3/modules/vfs_vxfs.c:342:11: error: unused variable ‘e_id’ [-Werror=unused-variable]
  uint32_t e_id, n_id;
           ^~~~
../../source3/modules/vfs_vxfs.c:341:35: error: unused variable ‘n_perm’ [-Werror=unused-variable]
  uint16_t e_type, n_type, e_perm, n_perm;
                                   ^~~~~~
../../source3/modules/vfs_vxfs.c:341:27: error: unused variable ‘e_perm’ [-Werror=unused-variable]
  uint16_t e_type, n_type, e_perm, n_perm;
                           ^~~~~~
../../source3/modules/vfs_vxfs.c: In function ‘vxfs_compare’:
../../source3/modules/vfs_vxfs.c:407:6: error: unused variable ‘i’ [-Werror=unused-variable]
  int i, count = 0;
      ^

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoVFS: vxfs: ifdef out vxfs_sys_acl_set_fd
Noel Power [Thu, 10 Jun 2021 13:52:04 +0000 (14:52 +0100)]
VFS: vxfs: ifdef out vxfs_sys_acl_set_fd

as the sys_acl_set_fd_fn definition for vxfs_sys_acl_set_fd is ifdef'ed
out we also need ifdef out the vxfs_sys_acl_set_fd implementation itself
otherwise we get the following error.

source3/modules/vfs_vxfs.c:484:12: error: ‘vxfs_sys_acl_set_fd’ defined but not used [-Werror=unused-function]
 static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle,

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3/smbd: Remove unecessary 'else' block
Noel Power [Thu, 10 Jun 2021 13:11:03 +0000 (14:11 +0100)]
s3/smbd: Remove unecessary 'else' block

This is an inconsequential cosmetic change, it just caught my eye
as looking a bit out of place compared to the surrounding code style.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3/smbd: dos_mode_check_compressed: remove smb_fname, conn fn parms
Noel Power [Thu, 10 Jun 2021 10:32:06 +0000 (11:32 +0100)]
s3/smbd: dos_mode_check_compressed: remove smb_fname, conn fn parms

smb_fname is unused and we can get conn from the fsp passed in

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3/smbd: dos_mode_post: remove smb_fname param
Noel Power [Thu, 10 Jun 2021 09:04:39 +0000 (10:04 +0100)]
s3/smbd: dos_mode_post: remove smb_fname param

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org
2 years agos3/smbd: call dos_mode_post with fsp
Noel Power [Thu, 10 Jun 2021 08:45:02 +0000 (09:45 +0100)]
s3/smbd: call dos_mode_post with fsp

Next commit can remove smb_name param from dos_mode_post
signature.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3: smbd: Protect dos_mode_at_send() from running into a symlink.
Jeremy Allison [Thu, 10 Jun 2021 17:30:17 +0000 (10:30 -0700)]
s3: smbd: Protect dos_mode_at_send() from running into a symlink.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power<npower@samba.org>
2 years agopytests: add dns_aging, embracing and extending ageing tests
Douglas Bagnall [Wed, 28 Apr 2021 05:40:08 +0000 (17:40 +1200)]
pytests: add dns_aging, embracing and extending ageing tests

This incorporates tests from various dns*.py files, but makes them
correct.

All but one of these tests pass against Windows 2012r2.

Further patches will remove the broken tests in other files, and fix
Samba so it passes these.

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): Fri Jun 11 09:29:23 UTC 2021 on sn-devel-184

2 years agopy: samba.dnsserver: add helper for record buffers
Douglas Bagnall [Thu, 13 May 2021 03:51:45 +0000 (03:51 +0000)]
py: samba.dnsserver: add helper for record buffers

We *always* make these steps when we get a record.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest:dns_base: make_txt_update can set arbitrary TTL
Douglas Bagnall [Wed, 19 May 2021 02:39:00 +0000 (02:39 +0000)]
pytest:dns_base: make_txt_update can set arbitrary TTL

Also, improve a variable name.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopydns: expose dns_records_match() as dsdb_dns.records.match()
Douglas Bagnall [Fri, 28 May 2021 06:08:56 +0000 (18:08 +1200)]
pydns: expose dns_records_match() as dsdb_dns.records.match()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodns: merge dns_records_match and dns_record_match
Douglas Bagnall [Sat, 29 May 2021 09:25:29 +0000 (21:25 +1200)]
dns: merge dns_records_match and dns_record_match

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodlz: remove pretense of HINFO support
Douglas Bagnall [Fri, 23 Apr 2021 07:49:05 +0000 (19:49 +1200)]
dlz: remove pretense of HINFO support

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodns_record_match: drop pretense of HINFO support
Douglas Bagnall [Tue, 13 Apr 2021 00:06:16 +0000 (12:06 +1200)]
dns_record_match: drop pretense of HINFO support

We don't support it really, and if we did there is no sense in which
it could be updated, which is the context in which this function is
used.

(modern HINFO returns the constant string "RFC8482". See RFC 8482).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodns common: dns_records_match() matches tombstones
Douglas Bagnall [Mon, 12 Apr 2021 21:57:33 +0000 (09:57 +1200)]
dns common: dns_records_match() matches tombstones

This will be needed by the RPC server. Other callers already filter
out tombstones, so this is OK.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodns: merge dlz/internal dns_records_match()
Douglas Bagnall [Mon, 12 Apr 2021 19:00:41 +0000 (07:00 +1200)]
dns: merge dlz/internal dns_records_match()

We have had three nearly identical functions called
dns_record[s]_match. This patch merges two of them, attempting to keep
the good bits and not the bugs.

That means:

1. We use the AAAA match from dlz, which is agnostic to all the
billions of ways you can write the same IPv6 address (case sensitivity
is just the beginning).

2. We lean more on the TXT match from dns_utils, because the dlz used
a weird bitwise &= operator, but we adjust to exit early.

3. Keep HINFO from dlz (for now).

4. Use the dns_name_equal() that was already in dns_common, which was
used by dlz. dns_utils had a strange one that probably did the same
thing.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodlz_bind9: remove redundant logging in b9_record_match()
Douglas Bagnall [Mon, 12 Apr 2021 18:36:03 +0000 (06:36 +1200)]
dlz_bind9: remove redundant logging in b9_record_match()

This log message will never be seen. We know because:

1. Always (two places) we are comparing an incoming record against a
   database record.

2. The incoming record has come from b9_parse(), which makes the same
   check.

3. If the database record is bad, we will never get here because the
   first check is b9_record_match() is

       if (rec1->wType != rec2->wType) {
               return false;
       }

   and rec1->wType is not going to equal the corrupt database record's
   wType, because point 2.

OK, but why? So we can shift this into dnsserver_common.c, because
the internal dns server has an inferior record_match() and it could do
with sharing this one.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:subunit: Avoid misleading "Test was never started" error message
Joseph Sutton [Wed, 28 Apr 2021 01:55:02 +0000 (13:55 +1200)]
python:subunit: Avoid misleading "Test was never started" error message

subunithelper.py keeps track of tests that have been started, and
displays an error message if a test reports an outcome without having
previously been started. However, it makes the assumption that a test
has finished once it has reported a single outcome. This means that a
misleading error message will be displayed if it receives multiple
outcomes from the same test (which can happen if a test using the Python
unittest framework does not complete successfully, and the cleanup
subsequently fails), and any actual errors from the cleanup remain
undisplayed.

This commit ensures that only a single outcome is reported for each
test, and only after the test has finished. Outcomes are buffered up
until the stopTest() function is called, when a single outcome is
determined and all errors received for that test are output.

FilterOps still needs to output test outcomes immediately rather than
buffering them, otherwise they are never picked up and passed on to the
remote test case by subunithelper.parse_results(). This would result in
an error as the test would be considered to have never finished.

    Example subunitrun output before the change:

time: 2021-04-28 01:28:49.862123Z
test: samba.tests.example.ExampleTests.test
time: 2021-04-28 01:28:49.862215Z
failure: samba.tests.example.ExampleTests.test [
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 28, in test
    self.fail()
AssertionError: None
]
time: 2021-04-28 01:28:49.862407Z
failure: samba.tests.example.ExampleTests.test [
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 31, in tearDown
    self.fail()
AssertionError: None
]
time: 2021-04-28 01:28:49.862467Z
time: 2021-04-28 01:28:49.862510Z

    and after:

time: 2021-04-28 01:29:19.949347Z
test: samba.tests.example.ExampleTests.test
time: 2021-04-28 01:29:19.949440Z
time: 2021-04-28 01:29:19.949590Z
time: 2021-04-28 01:29:19.949640Z
failure: samba.tests.example.ExampleTests.test [
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 28, in test
    self.fail()
AssertionError: None
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 31, in tearDown
    self.fail()
AssertionError: None
]
time: 2021-04-28 01:29:19.949702Z

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:subunit: Remove write_traceback()
Joseph Sutton [Wed, 28 Apr 2021 01:54:44 +0000 (13:54 +1200)]
python:subunit: Remove write_traceback()

This functionality is already present in the Python unittest framework,
and so is not necessary to include here.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:subunit: Fix skipping a test with no reason given
Joseph Sutton [Wed, 28 Apr 2021 02:17:56 +0000 (14:17 +1200)]
python:subunit: Fix skipping a test with no reason given

Not specifying a reason means addSkip() is passed an empty string rather
than None. As a result, this condition was never hit, and the call to
_addOutcome() had an incorrect parameter.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodbcheck: formatting
Joseph Sutton [Thu, 3 Jun 2021 23:37:56 +0000 (11:37 +1200)]
dbcheck: formatting

Reduce the length of some lines to 79 characters or less.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jun 11 08:28:28 UTC 2021 on sn-devel-184

2 years agodbcheck: Refactor RID Set check to use free_rid_bounds()
Joseph Sutton [Thu, 3 Jun 2021 23:32:00 +0000 (11:32 +1200)]
dbcheck: Refactor RID Set check to use free_rid_bounds()

This function provides a simpler method of getting the bounds of the
range of RIDs we want to check. We also now check that the low bound is
less than the high bound for both rIDAllocationPool and
rIDPreviousAllocationPool.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agonetcmd: Avoid conflicting SIDs when creating an offline backup
Joseph Sutton [Wed, 2 Jun 2021 05:00:33 +0000 (17:00 +1200)]
netcmd: Avoid conflicting SIDs when creating an offline backup

To allow the new DC object to be created in a restored domain while
avoiding conflicts with existing SIDS, we fetch a SID that is available
at the time of backing up and store it in the backed-up database.
However, if a new security principal is created on this DC during the
backup process, the stored SID may be reused for that object, resulting
in an error on restoration.

By getting the SID for restore only after all the database files have
been backed up, we ensure that the chosen SID does not conflict with any
objects in the backed-up database.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoridalloc: Don't skip the first RID of a pool
Joseph Sutton [Tue, 1 Jun 2021 00:03:38 +0000 (12:03 +1200)]
ridalloc: Don't skip the first RID of a pool

Previously, if either of the rIDPreviousAllocation and rIDNextRID
attributes were not present in a RID Set, the first RID in
rIDAllocationPool was skipped over when determining their values.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agonetcmd: Use next_free_rid() function to calculate a SID for restoring a backup
Joseph Sutton [Thu, 27 May 2021 03:35:35 +0000 (15:35 +1200)]
netcmd: Use next_free_rid() function to calculate a SID for restoring a backup

This means we won't get errors if the DC doesn't have a rIDNextRID
attribute, but we will still error if there is no RID Set or if all its
pools are exhausted.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agopython/tests/dsdb: Add tests for RID allocation functions
Joseph Sutton [Mon, 24 May 2021 04:46:28 +0000 (16:46 +1200)]
python/tests/dsdb: Add tests for RID allocation functions

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agodsdb: Add next_free_rid() function to allocate a RID without modifying the database
Joseph Sutton [Mon, 24 May 2021 00:59:59 +0000 (12:59 +1200)]
dsdb: Add next_free_rid() function to allocate a RID without modifying the database

If used to generate SIDs for objects, care should be taken, as the
possibility for having duplicate objectSIDs can arise.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agonetcmd: Add tests for performing an offline backup immediately after joining a domain
Joseph Sutton [Mon, 24 May 2021 02:58:40 +0000 (14:58 +1200)]
netcmd: Add tests for performing an offline backup immediately after joining a domain

This currently fails due to the DC not having a rIDNextRID attribute,
which is required for the restore process.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agodbcheck: check correct RID set attributes when looking for SID conflicts
Andrew Bartlett [Thu, 27 Sep 2018 08:28:26 +0000 (20:28 +1200)]
dbcheck: check correct RID set attributes when looking for SID conflicts

The previous code would only work for the first rid set ever given to a DC
because the names are so misleading.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agonetcmd: Refactor seizing DNS roles while restoring from a backup
Joseph Sutton [Thu, 27 May 2021 03:38:03 +0000 (15:38 +1200)]
netcmd: Refactor seizing DNS roles while restoring from a backup

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agonetcmd: Use correct path for state directory during offline backup
Joseph Sutton [Wed, 26 May 2021 23:47:36 +0000 (11:47 +1200)]
netcmd: Use correct path for state directory during offline backup

During the restore process, we use make_smbconf() to create a new
smb.conf file with the default paths. The default location for 'state
directory' is 'state', but we currently rename this directory to
'statedir' on backing up, so it will end up pointing to a non-existent
directory. This commit ensures the names are consistent.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agotests: Specify additional modules for 'vfs objects' parameter
Joseph Sutton [Wed, 26 May 2021 23:48:52 +0000 (11:48 +1200)]
tests: Specify additional modules for 'vfs objects' parameter

This helps to avoid a warning 'vfs objects specified without required AD
DC module'.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agonetcmd: Ignore rIDUsedPool attribute in offline domain backup test
Joseph Sutton [Wed, 26 May 2021 01:40:30 +0000 (13:40 +1200)]
netcmd: Ignore rIDUsedPool attribute in offline domain backup test

The RID Set of the newly created DC account has all its values
initialised to zero. If the rIDUsedPool attribute was previously
non-zero, then the restore process will cause its value to change.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agonetcmd: Fix error-checking condition
Joseph Sutton [Mon, 24 May 2021 04:40:55 +0000 (16:40 +1200)]
netcmd: Fix error-checking condition

This condition probably meant to check the argument of the most recently
thrown exception, rather than the previous one again.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoprovision: Refactor another usage of create_dns_dir_keytab_link
Joseph Sutton [Thu, 6 May 2021 03:08:19 +0000 (15:08 +1200)]
provision: Refactor another usage of create_dns_dir_keytab_link

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agosambadns: Create BINDDNS_DIR/dns.keytab link to PRIVATE_DIR/dns.keytab on DC join
Derek Lambert [Wed, 22 Apr 2020 20:30:53 +0000 (15:30 -0500)]
sambadns: Create BINDDNS_DIR/dns.keytab link to PRIVATE_DIR/dns.keytab on DC join

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

Signed-off-by: Derek Lambert <dlambert@dereklambert.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agosamba_upgradedns: Create binddns_dir if it doesn't already exist
Joseph Sutton [Wed, 26 May 2021 01:44:15 +0000 (13:44 +1200)]
samba_upgradedns: Create binddns_dir if it doesn't already exist

Without doing this, the upgrade process can fail if the directory is not
present, e.g. after restoring from an offline backup (which specifically
ignores this directory).

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agotestprogs: Test that dns.keytab is created after a dns upgrade
Joseph Sutton [Thu, 6 May 2021 04:51:26 +0000 (16:51 +1200)]
testprogs: Test that dns.keytab is created after a dns upgrade

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agopyldb: Fix Message.items() for a message containing elements
Joseph Sutton [Fri, 28 May 2021 02:15:43 +0000 (14:15 +1200)]
pyldb: Fix Message.items() for a message containing elements

Previously, message elements were being freed before the call to
Py_BuildValue(), resulting in an exception being raised. Additionally,
only the first element of the returned list was ever assigned to.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agopyldb: Add test for Message.items()
Joseph Sutton [Fri, 28 May 2021 02:15:27 +0000 (14:15 +1200)]
pyldb: Add test for Message.items()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agosambadns: Fix docstring for create_dns_dir()
Joseph Sutton [Wed, 26 May 2021 01:38:22 +0000 (13:38 +1200)]
sambadns: Fix docstring for create_dns_dir()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agopytest: Fix typo in docstring
Joseph Sutton [Thu, 6 May 2021 03:40:44 +0000 (15:40 +1200)]
pytest: Fix typo in docstring

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agosamldb: Fix function name typo in error message
Joseph Sutton [Mon, 24 May 2021 01:01:39 +0000 (13:01 +1200)]
samldb: Fix function name typo in error message

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoselftest: Remove duplicate variable assignment
Joseph Sutton [Wed, 26 May 2021 03:21:02 +0000 (15:21 +1200)]
selftest: Remove duplicate variable assignment

This line currently produces a warning.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoselftest: Only set netbios aliases for the ad_member env
Andreas Schneider [Thu, 10 Jun 2021 14:20:28 +0000 (16:20 +0200)]
selftest: Only set netbios aliases for the ad_member env

The provision_ad_member() function is reused by different
setup_ad_member*() functions. Each environment needs to have unique
netbios aliases as they are all in the same network.
The aliases should only be set for the 'ad_member' environment.

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 11 01:26:36 UTC 2021 on sn-devel-184

2 years agos3:tests: Fix passing the configuration to Smbclient_netbios_aliases test
Andreas Schneider [Thu, 10 Jun 2021 12:28:44 +0000 (12:28 +0000)]
s3:tests: Fix passing the configuration to Smbclient_netbios_aliases test

Signed-Off-By: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3: smbd: Cleanup - Remove #ifdef'ed out load_inherited_info().
Jeremy Allison [Wed, 9 Jun 2021 16:39:04 +0000 (09:39 -0700)]
s3: smbd: Cleanup - Remove #ifdef'ed out load_inherited_info().

I commented this out but forgot to remove in the
previous mega-patch.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 10 21:36:11 UTC 2021 on sn-devel-184

2 years agosmbd: remove more dead code from dos_mode_at_vfs_get_dosmode_done()
Jeremy Allison [Thu, 10 Jun 2021 17:55:30 +0000 (10:55 -0700)]
smbd: remove more dead code from dos_mode_at_vfs_get_dosmode_done()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agosmbd: remove unneeded code from dos_mode_at_vfs_get_dosmode_done()
Ralph Boehme [Thu, 10 Jun 2021 14:15:25 +0000 (16:15 +0200)]
smbd: remove unneeded code from dos_mode_at_vfs_get_dosmode_done()

This is not used anymore since e7a90fd7a173d8e3cd5a2bb163df61758b2b973f.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 10 19:22:23 UTC 2021 on sn-devel-184

2 years agos3:smbd: Remove unnessesary NULL check for req
Andreas Schneider [Thu, 10 Jun 2021 07:14:22 +0000 (09:14 +0200)]
s3:smbd: Remove unnessesary NULL check for req

We already dereference req earlier. So if it is NULL it already
segfaulted much earlier.

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Thu Jun 10 11:22:19 UTC 2021 on sn-devel-184

2 years agos3:smbd: Remove unnessesary NULL check for fsp
Andreas Schneider [Thu, 10 Jun 2021 07:05:53 +0000 (09:05 +0200)]
s3:smbd: Remove unnessesary NULL check for fsp

We already dereference fsp earlier. So if it is NULL it already
segfaulted much earlier.

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Noel Power <npower@samba.org>
2 years agolibrpc: Make sure num_protocols is initialized
Andreas Schneider [Thu, 10 Jun 2021 06:53:19 +0000 (08:53 +0200)]
librpc: Make sure num_protocols is initialized

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Noel Power <npower@samba.org>
2 years agos3:smbd: Make sure smb_fname is set and not NULL in dos_mode_post()
Andreas Schneider [Thu, 10 Jun 2021 06:51:03 +0000 (08:51 +0200)]
s3:smbd: Make sure smb_fname is set and not NULL in dos_mode_post()

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Noel Power <npower@samba.org>
2 years agos3: VFS: default: Add proc_fd's fallback for vfswrap_fchown().
Jeremy Allison [Wed, 9 Jun 2021 22:57:38 +0000 (15:57 -0700)]
s3: VFS: default: Add proc_fd's fallback for vfswrap_fchown().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Thu Jun 10 09:16:22 UTC 2021 on sn-devel-184

2 years agoselftest/gdb_backtrace: remove duplicate assignment.
Douglas Bagnall [Thu, 27 May 2021 02:50:55 +0000 (14:50 +1200)]
selftest/gdb_backtrace: remove duplicate assignment.

See 18 or so lines up.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 10 01:17:52 UTC 2021 on sn-devel-184

2 years agosamba-tool: stick to the point with --version
Douglas Bagnall [Tue, 1 Jun 2021 00:48:24 +0000 (00:48 +0000)]
samba-tool: stick to the point with --version

We were doing this:

    $ bin/samba-tool --version
    samba-tool: no such subcommand: --version

    4.15.0pre1-DEVELOPERBUILD
    $

which is silly. Now we'll just see the version.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosamba-tool dns zoneoptions --help improvement
Douglas Bagnall [Tue, 1 Jun 2021 00:58:28 +0000 (12:58 +1200)]
samba-tool dns zoneoptions --help improvement

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoidl: two comment typos in two lines
Douglas Bagnall [Thu, 22 Apr 2021 13:00:56 +0000 (01:00 +1200)]
idl: two comment typos in two lines

it is the density that got to me.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:pylibsmb: improve return types (false => NULL)
Douglas Bagnall [Thu, 27 May 2021 03:39:19 +0000 (15:39 +1200)]
s3:pylibsmb: improve return types (false => NULL)

NULL, a.k.a. (void *)false;

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:pylibsmb: avoid small leaks in cli_notify_get_changes
Douglas Bagnall [Thu, 27 May 2021 03:32:45 +0000 (15:32 +1200)]
s3:pylibsmb: avoid small leaks in cli_notify_get_changes

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agopython: remove obsolete samba_external directory
Douglas Bagnall [Fri, 21 May 2021 04:50:02 +0000 (16:50 +1200)]
python: remove obsolete samba_external directory

It seems this was once meant to contain third-party python libraries
that we hoped would already be on the system, of which there was only
ever one candidate, dnspython, which we moved then stopped bundling
years ago.

The ancestor of this directory, 'source4/scripting/python/samba_external/'
was unused since 4bbc3ff037026c72f3249f59c1b5af69a6ad6d69 (2010) and
the current location has never done anything.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosamba-tool domain: improve error message when `patch` fails
Douglas Bagnall [Thu, 20 May 2021 23:41:37 +0000 (11:41 +1200)]
samba-tool domain: improve error message when `patch` fails

The old message confused even the wisest among us:

https://lists.samba.org/archive/samba/2021-May/236021.html

and while /user/bin/patch might be overly specific, it should point
people in the right direction.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:tests: Fix the test_smbclient_netbios_aliases
Andreas Schneider [Wed, 9 Jun 2021 15:06:45 +0000 (17:06 +0200)]
s3:tests: Fix the test_smbclient_netbios_aliases

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): Thu Jun 10 00:24:22 UTC 2021 on sn-devel-184

2 years agosamba-tool: gpo admxload mkdir -p
David Mulder [Tue, 8 Jun 2021 15:30:37 +0000 (09:30 -0600)]
samba-tool: gpo admxload mkdir -p

Ensure all directories in the path are created,
otherwise admx upload fails here.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Wed Jun  9 22:26:42 UTC 2021 on sn-devel-184

2 years agosmbd: return correct timestamps for quota fake file
Ralph Boehme [Mon, 7 Jun 2021 17:02:56 +0000 (19:02 +0200)]
smbd: return correct timestamps for quota fake file

Prior to 572d4e3a56eef00e29f93482daa21647af7310d0 it was sufficient to
initialize struct timespec to zero to return NTTIME 0 (ie not set) over
SMB.

This fixes the same problem from bug 14714 where the timestamps in an SMB2 CLOSE
response.

Windows of course does return *some* timestamps, but as it's neither documented
nor was I able to figure out where they would be coming from, as well as the
Windows client apparently doesn't care, I didn't bother with implementing some
sophisticated heuristic to return some timestamps.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun  9 20:38:02 UTC 2021 on sn-devel-184

2 years agosmbd: handle fake file handles in fdos_mode()
Ralph Boehme [Fri, 4 Jun 2021 13:54:20 +0000 (15:54 +0200)]
smbd: handle fake file handles in fdos_mode()

This ensures SMB requests on the quote fake file "$Extend/$Quota" don't hit the
VFS, where specifically in vfs_gpfs we log an error message if we fail to read
the DOS attributes for a file with

  vfs_gpfs_get_dos_attributes: Getting winattrs failed for $Extend/$Quota

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: add dosmode_from_fake_filehandle()
Ralph Boehme [Fri, 4 Jun 2021 14:31:20 +0000 (16:31 +0200)]
smbd: add dosmode_from_fake_filehandle()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbtorture: verify attributes on fake quota file handle
Ralph Boehme [Mon, 7 Jun 2021 17:03:05 +0000 (19:03 +0200)]
smbtorture: verify attributes on fake quota file handle

The expected DOS attributes are taken from a Windows 2016 server. The expected
timestamps are what Samba has returned before commit 572d4e3a56eef00e29f9348:
NTTIME(0), ie no value.

The upcoming fix will restore this behaviour. Windows of course does
return *some* timestamps, but as it's neither documented nor was I able to
figure out where they would be coming from, as well as the Windows client apparently
doesn't care, I didn't bother with implementing some sophisticated heuristic to
return some timestamps.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agogpo: Apply Group Policy GNOME Settings
David Mulder [Tue, 18 May 2021 15:37:10 +0000 (15:37 +0000)]
gpo: Apply Group Policy GNOME Settings

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun  9 17:44:25 UTC 2021 on sn-devel-184

2 years agogpo: Test Group Policy GNOME Setting
David Mulder [Tue, 18 May 2021 15:35:24 +0000 (15:35 +0000)]
gpo: Test Group Policy GNOME Setting

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agogpo: Add GNOME Settings ADMX templates
David Mulder [Mon, 17 May 2021 18:46:56 +0000 (12:46 -0600)]
gpo: Add GNOME Settings ADMX templates

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib:mscat: Don't use deprecated types
Andreas Schneider [Tue, 8 Jun 2021 10:53:00 +0000 (12:53 +0200)]
lib:mscat: Don't use deprecated types

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jun  9 16:54:23 UTC 2021 on sn-devel-184

2 years agos3: VFS: solarisacl: Remove solarisacl_sys_acl_set_file().
Jeremy Allison [Wed, 9 Jun 2021 00:09:51 +0000 (17:09 -0700)]
s3: VFS: solarisacl: Remove solarisacl_sys_acl_set_file().

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): Wed Jun  9 14:04:13 UTC 2021 on sn-devel-184

2 years agos3: VFS: aixacl: Remove aixacl_sys_acl_set_file().
Jeremy Allison [Wed, 9 Jun 2021 00:08:42 +0000 (17:08 -0700)]
s3: VFS: aixacl: Remove aixacl_sys_acl_set_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: posixacl: Remove posixacl_sys_acl_set_file().
Jeremy Allison [Wed, 9 Jun 2021 00:07:23 +0000 (17:07 -0700)]
s3: VFS: posixacl: Remove posixacl_sys_acl_set_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: lib: sysacls: Remove all implementations of sys_acl_set_file().
Jeremy Allison [Wed, 9 Jun 2021 00:05:53 +0000 (17:05 -0700)]
s3: lib: sysacls: Remove all implementations of sys_acl_set_file().

No longer called.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: default: Remove the sys_proc_fd_path() fallback code in vfswrap_sys_acl_set_...
Jeremy Allison [Wed, 9 Jun 2021 00:01:02 +0000 (17:01 -0700)]
s3: VFS: default: Remove the sys_proc_fd_path() fallback code in vfswrap_sys_acl_set_fd().

Just pass through to sys_acl_set_fd(), which goes to posixacl_sys_acl_set_fd()
on posix ACL systems.

We already have identical code in posixacl_sys_acl_set_fd()
and these fallbacks are really system specific so we shouldn't
be doing them in more than one place.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: hpuxacl: Fix the funtion signature for hpuxacl_sys_acl_set_fd()
Jeremy Allison [Tue, 8 Jun 2021 23:56:44 +0000 (16:56 -0700)]
s3: VFS: hpuxacl: Fix the funtion signature for hpuxacl_sys_acl_set_fd()

This is really unmaintained code and should be removed unless
someone from HP steps up..

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: lib: sysacls: Add the 'SMB_ACL_TYPE_T type' parameter to sys_acl_set_fd().
Jeremy Allison [Tue, 8 Jun 2021 23:49:33 +0000 (16:49 -0700)]
s3: lib: sysacls: Add the 'SMB_ACL_TYPE_T type' parameter to sys_acl_set_fd().

Pass it through to the backends. The default posixacl_sys_acl_set_fd()
already copes with this anyway, as does the AIX, and Solaris backends.

The HPUX code isn't compiled and was broken anyway (there was a
missmatch of the number of parameters being passed to the
sys_acl_set_fd_fn backend hpuxacl_sys_acl_set_fd()), and HPUX
doesn't have fd-based ACLs, so just switch to calling hpuxacl_sys_acl_set_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: non_posix_acls: Remove non_posix_sys_acl_blob_get_file_helper(). No longer...
Jeremy Allison [Tue, 8 Jun 2021 23:35:24 +0000 (16:35 -0700)]
s3: VFS: non_posix_acls: Remove non_posix_sys_acl_blob_get_file_helper(). No longer used.

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