]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
4 years agos3: VFS: zfsacl: Add zfsacl_fail__sys_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 22:46:49 +0000 (15:46 -0700)] 
s3: VFS: zfsacl: Add zfsacl_fail__sys_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: solarisacl: Add solarisacl_sys_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 22:43:09 +0000 (15:43 -0700)] 
s3: VFS: solarisacl: Add solarisacl_sys_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: posixacl: Add posixacl_sys_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 22:39:33 +0000 (15:39 -0700)] 
s3: VFS: posixacl: Add posixacl_sys_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: nfs4acl_xattr. Add nfs4acl_xattr_fail__sys_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 22:12:50 +0000 (15:12 -0700)] 
s3: VFS: nfs4acl_xattr. Add nfs4acl_xattr_fail__sys_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: hpuxacl. Add hpuxacl_sys_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 22:11:20 +0000 (15:11 -0700)] 
s3: VFS: hpuxacl. Add hpuxacl_sys_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: fake_acls: Add fake_acls_sys_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 21:39:12 +0000 (14:39 -0700)] 
s3: VFS: fake_acls: Add fake_acls_sys_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: gpfs: Add gpfsacl_sys_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 21:36:26 +0000 (14:36 -0700)] 
s3: VFS: gpfs: Add gpfsacl_sys_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: glusterfs: Make gluster call posixacl_xattr_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 21:34:27 +0000 (14:34 -0700)] 
s3: VFS: glusterfs: Make gluster call posixacl_xattr_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: ceph: Make ceph call posixacl_xattr_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 21:33:43 +0000 (14:33 -0700)] 
s3: VFS: ceph: Make ceph call posixacl_xattr_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: posixacl_xattr: Add posixacl_xattr_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 21:32:53 +0000 (14:32 -0700)] 
s3: VFS: posixacl_xattr: Add posixacl_xattr_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: VFS: aixacl2: Add aixjfs2_sys_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 21:30:29 +0000 (14:30 -0700)] 
s3: VFS: aixacl2: Add aixjfs2_sys_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3: VFS: aixacl: Add aixacl_sys_acl_delete_def_fd().
Jeremy Allison [Fri, 14 May 2021 21:29:17 +0000 (14:29 -0700)] 
s3: VFS: aixacl: Add aixacl_sys_acl_delete_def_fd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3: VFS: Add SMB_VFS_SYS_ACL_DELETE_DEF_FD(),
Jeremy Allison [Fri, 14 May 2021 21:20:50 +0000 (14:20 -0700)] 
s3: VFS: Add SMB_VFS_SYS_ACL_DELETE_DEF_FD(),

Not yet used. Eventually will replace SMB_VFS_SYS_ACL_DELETE_DEF_FILE().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agolib:cmdline: Fix setting 'log file' from smb.conf
Andreas Schneider [Mon, 17 May 2021 09:00:29 +0000 (11:00 +0200)] 
lib:cmdline: Fix setting 'log file' from smb.conf

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue May 18 11:32:41 UTC 2021 on sn-devel-184

4 years agoctdb: Fix a crash in run_proc_signal_handler()
Volker Lendecke [Tue, 18 May 2021 06:32:45 +0000 (08:32 +0200)] 
ctdb: Fix a crash in run_proc_signal_handler()

If a script times out the caller can talloc_free() the script_list
output of run_event_recv, which talloc_free's proc->output from
run_proc.c as well. If the script generates further output after the
timeout and then exits after a while, the SIGCHLD handler in the
eventd tries to read into proc->output, which was already free'ed.

Fix this by not doing just a talloc_steal but a talloc_move. This way
proc_read_handler() called from run_proc_signal_handler() does not try
to realloc the stale reference to proc->output but gets a NULL
reference.

I don't really know how to do a knownfail in ctdb, so this commit
actually activates catching the signal by waiting long enough for
22.bar to exit and generate the SIGCHLD.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14475
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoctdb: Introduce output before and after the 10-second timeout
Volker Lendecke [Tue, 18 May 2021 06:28:16 +0000 (08:28 +0200)] 
ctdb: Introduce output before and after the 10-second timeout

This will lead to a crash in run_event_test.c soon

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14475
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoctdb: Wait for SIGCHLD if script timed out
Volker Lendecke [Tue, 18 May 2021 06:23:05 +0000 (08:23 +0200)] 
ctdb: Wait for SIGCHLD if script timed out

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14475
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoctdb: Introduce a helper variable in run_event_test.c
Volker Lendecke [Tue, 18 May 2021 06:18:25 +0000 (08:18 +0200)] 
ctdb: Introduce a helper variable in run_event_test.c

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14475
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoctdb: Call run_event_recv() in a callback function
Volker Lendecke [Tue, 18 May 2021 06:01:06 +0000 (08:01 +0200)] 
ctdb: Call run_event_recv() in a callback function

Triggers a different code path in run_event_* and aligns it more what
the ctdb eventd really does.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14475
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoctdb: fix typos
Volker Lendecke [Fri, 7 May 2021 15:36:58 +0000 (17:36 +0200)] 
ctdb: fix typos

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14475
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agodlz: remove support for ancient binds
Douglas Bagnall [Fri, 23 Apr 2021 07:37:55 +0000 (19:37 +1200)] 
dlz: remove support for ancient binds

We no longer support versions of bind that have
DLZ_DLOPEN_VERSION != 3, so we no longer need all these ifdefs.

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): Mon May 17 22:29:01 UTC 2021 on sn-devel-184

4 years agodlz: do not build for Bind 9.8 or 9.9
Douglas Bagnall [Sat, 24 Apr 2021 03:25:25 +0000 (15:25 +1200)] 
dlz: do not build for Bind 9.8 or 9.9

If we drop support for versions before Bind 9.10 (which itself went
EOL in 2018) we can get rid of a whole lot of ifdefs for old API
versions that no-one should be using.

This patch stops the build, the next one clears out the ifdefs.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodlz torture: update to supported DLZ API
Douglas Bagnall [Sat, 24 Apr 2021 03:25:44 +0000 (15:25 +1200)] 
dlz torture: update to supported DLZ API

Bind 9.8 went EOL in 2014, but we still run our tests using the API
version that it alone uses.

This patch changes it to use the API of versions 9.10 onwards.

We don't change what we test or make use of the new API, just pass
around some NULL pointers.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamba-tool:testparm: Display nicer parameter dump error messages
Joseph Sutton [Wed, 28 Apr 2021 03:46:46 +0000 (15:46 +1200)] 
samba-tool:testparm: Display nicer parameter dump error messages

Now we catch errors for unknown sections or parameters and turn them
into CommandErrors.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamba-tool:testparm: Test error handling for unknown sections and parameters
Joseph Sutton [Thu, 29 Apr 2021 08:23:21 +0000 (20:23 +1200)] 
samba-tool:testparm: Test error handling for unknown sections and parameters

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamba-tool:testparm: Fix error with --section-name
Joseph Sutton [Thu, 22 Apr 2021 00:57:24 +0000 (12:57 +1200)] 
samba-tool:testparm: Fix error with --section-name

Pass the correct parameters into LoadparmService.dump() so that
--section-name works properly.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agosamba-tool:testparm: Test that --section-name works without --parameter-name
Joseph Sutton [Thu, 29 Apr 2021 08:17:09 +0000 (20:17 +1200)] 
samba-tool:testparm: Test that --section-name works without --parameter-name

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agonmbd: Reduce the wait interface loop sleep time
Samuel Cabrero [Fri, 14 May 2021 10:35:44 +0000 (12:35 +0200)] 
nmbd: Reduce the wait interface loop sleep time

Under some circumstances the network-online.target can be reached
without an IPv4 address, for example when using systemd-networkd and
having systemd-networkd-wait-online.service disabled. This will trigger
a five seconds sleep which seems a bit excessive. It is specially
critical when winbind.service is enabled as it won't be started until
nmbd.service is running, delaying the systemd-logind.service five seconds.

Reduce the sleep time from 5 seconds to 250ms to exit the loop as soon
as possible.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May 14 20:52:47 UTC 2021 on sn-devel-184

4 years agos3: VFS: Remove SMB_VFS_READDIR_ATTR(), no longer used
Samuel Cabrero [Thu, 13 May 2021 11:36:31 +0000 (13:36 +0200)] 
s3: VFS: Remove SMB_VFS_READDIR_ATTR(), no longer used

                             ----------------
                            /                \
                           /       REST       \
                          /         IN         \
                         /         PEACE        \
                        /                        \
                        |                        |
                        |  SMB_VFS_READDIR_ATTR  |
                        |                        |
                        |                        |
                        |         13 May         |
                        |          2021          |
                        |                        |
                        |                        |
                       *|     *  *  *            | *
              _________)/\\_//(\/(/\)/\//\/\///\/|_)_______

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: VFS: fruit: Remove SMB_VFS_READDIR_ATTR()
Samuel Cabrero [Thu, 13 May 2021 11:19:09 +0000 (13:19 +0200)] 
s3: VFS: fruit: Remove SMB_VFS_READDIR_ATTR()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: VFS: catia: Remove SMB_VFS_READDIR_ATTR()
Samuel Cabrero [Thu, 13 May 2021 11:18:23 +0000 (13:18 +0200)] 
s3: VFS: catia: Remove SMB_VFS_READDIR_ATTR()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: smbd: Skip calling SMB_VFS_FREADDIR_ATTR() for symlinks
Samuel Cabrero [Thu, 13 May 2021 15:01:47 +0000 (17:01 +0200)] 
s3: smbd: Skip calling SMB_VFS_FREADDIR_ATTR() for symlinks

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
4 years agos3: smbd: Switch from SMB_VFS_READDIR_ATTR() to SMB_VFS_FREADDIR_ATTR()
Samuel Cabrero [Thu, 13 May 2021 11:17:19 +0000 (13:17 +0200)] 
s3: smbd: Switch from SMB_VFS_READDIR_ATTR() to SMB_VFS_FREADDIR_ATTR()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: VFS: fruit: Implement SMB_VFS_FREADDIR_ATTR()
Samuel Cabrero [Thu, 13 May 2021 11:08:20 +0000 (13:08 +0200)] 
s3: VFS: fruit: Implement SMB_VFS_FREADDIR_ATTR()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoVFS: Add SMB_VFS_FREADDIR_ATTR()
Samuel Cabrero [Mon, 10 May 2021 10:38:58 +0000 (12:38 +0200)] 
VFS: Add SMB_VFS_FREADDIR_ATTR()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agobuild: wscript. Fix the build on FreeBSD with the clang ld.lld-XX linker.
Jeremy Allison [Thu, 13 May 2021 20:20:17 +0000 (13:20 -0700)] 
build: wscript. Fix the build on FreeBSD with the clang ld.lld-XX linker.

FreeBSD is broken. It doesn't include 'extern char **environ'
in any shared library, but statically inside crt0.o.

If we're running on a FreeBSD with the GNU linker ld we
can get around this by explicitly telling the linker to
ignore 'environ' as an unresolved symbol in a shared library.

However, the clang linker ld.lld-XX is broken in that it
doesn't have that option.
First try to see if have '-Wl,--ignore-unresolved-symbol,environ'
and just use that if so.

If not, we have to use '-Wl,--allow-shlib-undefined' instead
and remove all instances of '-Wl,-no-undefined'.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May 14 01:50:25 UTC 2021 on sn-devel-184

4 years agolib:util: Fix return value of tdb_fetch_uint32_byblob()
Andreas Schneider [Tue, 11 May 2021 09:31:33 +0000 (11:31 +0200)] 
lib:util: Fix return value of tdb_fetch_uint32_byblob()

The initialize_winbindd_cache() function uses tdb_fetch_uint32_byblob()
to check if the cache version is valid and up to date. As
tdb_fetch_uint32_byblob() returns false for a successful fetch, we
always remove the winbind cache database. This breaks the winbind
offline logon feature.

This also affects other caches and pdb.

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

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): Wed May 12 21:19:03 UTC 2021 on sn-devel-184

4 years agos3:winbind: Code cleanup for initialize_winbindd_cache()
Andreas Schneider [Tue, 11 May 2021 09:34:40 +0000 (11:34 +0200)] 
s3:winbind: Code cleanup for initialize_winbindd_cache()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:winbind: Remove global variable for winbindd_offline_state
Andreas Schneider [Mon, 10 May 2021 15:55:13 +0000 (17:55 +0200)] 
s3:winbind: Remove global variable for winbindd_offline_state

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoautobuild: Add ad_member_offline_logon
Andreas Schneider [Mon, 10 May 2021 11:08:21 +0000 (13:08 +0200)] 
autobuild: Add ad_member_offline_logon

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agotestprogs: Add test for offline logon support
Andreas Schneider [Mon, 10 May 2021 10:52:18 +0000 (12:52 +0200)] 
testprogs: Add test for offline logon support

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoselftest: Set winbind offline in ad_member_offline_logon target
Andreas Schneider [Mon, 10 May 2021 08:40:31 +0000 (10:40 +0200)] 
selftest: Set winbind offline in ad_member_offline_logon target

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoselftest: Add skip_wait to check_or_start
Andreas Schneider [Mon, 10 May 2021 14:37:16 +0000 (16:37 +0200)] 
selftest: Add skip_wait to check_or_start

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoselftest: Turn on offline logon for ad_member_offline_logon
Andreas Schneider [Mon, 10 May 2021 08:40:27 +0000 (10:40 +0200)] 
selftest: Turn on offline logon for ad_member_offline_logon

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoselftest: Add ad_member_offline_logon env
Andreas Schneider [Mon, 10 May 2021 08:37:11 +0000 (10:37 +0200)] 
selftest: Add ad_member_offline_logon env

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoselftest: Pass down the machine account name to provision_ad_member
Andreas Schneider [Tue, 11 May 2021 15:59:51 +0000 (17:59 +0200)] 
selftest: Pass down the machine account name to provision_ad_member

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoselftest: Also add SERVER_LOG_LEVEL support for s3 targets
Andreas Schneider [Mon, 10 May 2021 10:32:51 +0000 (12:32 +0200)] 
selftest: Also add SERVER_LOG_LEVEL support for s3 targets

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: lib: If we're reporting getaddrinfo fail, print the name we were looking up in...
Richard Sharpe [Wed, 12 May 2021 18:46:24 +0000 (11:46 -0700)] 
s3: lib: If we're reporting getaddrinfo fail, print the name we were looking up in the same debug.

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprinting: Avoid a few references to background_lpq_updater_pid
Volker Lendecke [Fri, 30 Apr 2021 19:52:00 +0000 (21:52 +0200)] 
printing: Avoid a few references to background_lpq_updater_pid

We have the bgqd in the pidfile now

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 May 11 23:45:21 UTC 2021 on sn-devel-184

4 years agoprinting: Introduce samba-bgqd
Volker Lendecke [Thu, 22 Apr 2021 11:39:31 +0000 (13:39 +0200)] 
printing: Introduce samba-bgqd

This is a separate binary executed from start_background_queue(). As
such it does not really gain much, but the idea is to move all the
code this runs out of the smbd and spoolssd binaries to just link
here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Add str_list_add_printf()
Volker Lendecke [Tue, 4 May 2021 10:30:02 +0000 (12:30 +0200)] 
lib: Add str_list_add_printf()

Build up execv argument lists

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Add parent_watch_fd()
Volker Lendecke [Tue, 27 Apr 2021 16:03:57 +0000 (18:03 +0200)] 
lib: Add parent_watch_fd()

Make the parent watcher pipe used in reinit_after_fork() available for
external users that can't call reinit_after_fork().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprinting: Factor out register_printing_bq_handlers()
Volker Lendecke [Fri, 23 Apr 2021 08:32:43 +0000 (10:32 +0200)] 
printing: Factor out register_printing_bq_handlers()

The printing background jobs can be provided independently of the
start_background_queue() implementation.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoparam: Enable including source3/param/param_proto.h without vfs.h
Volker Lendecke [Thu, 22 Apr 2021 13:44:10 +0000 (15:44 +0200)] 
param: Enable including source3/param/param_proto.h without vfs.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprinting: Simplify calling print commands
Volker Lendecke [Fri, 30 Apr 2021 10:12:40 +0000 (12:12 +0200)] 
printing: Simplify calling print commands

We have fstr_sprintf for this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Simplify str_list_make_empty()
Volker Lendecke [Tue, 27 Apr 2021 09:38:53 +0000 (11:38 +0200)] 
lib: Simplify str_list_make_empty()

We have talloc_zero_array() for this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Make share_mode_lock.h includable on its own
Volker Lendecke [Tue, 27 Apr 2021 16:01:33 +0000 (18:01 +0200)] 
smbd: Make share_mode_lock.h includable on its own

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprinting: Consolidate add_to_jobs_list()
Volker Lendecke [Fri, 30 Apr 2021 08:36:57 +0000 (10:36 +0200)] 
printing: Consolidate add_to_jobs_list()

add_to_jobs_changed() and add_to_jobs_added() only differed in the key
string.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: smbd: Remove a STAT/LSTAT call on the parent pathname in a hot code path.
Jeremy Allison [Tue, 11 May 2021 18:41:42 +0000 (11:41 -0700)] 
s3: smbd: Remove a STAT/LSTAT call on the parent pathname in a hot code path.

This optimization uses the stored errno result from check_parent_exists()
which already did a STAT/LSTAT if needed.

Best viewed with 'git show -b'.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May 11 22:52:58 UTC 2021 on sn-devel-184

4 years agos3: smbd: Allow check_parent_exists() to return the errno from STAT/LSTAT on the...
Jeremy Allison [Tue, 11 May 2021 18:31:55 +0000 (11:31 -0700)] 
s3: smbd: Allow check_parent_exists() to return the errno from STAT/LSTAT on the parent name.

Not yet used.

This will allow us to avoid an duplicate STAT/LSTAT system call
on the parent pathname in a hot code path of the caller in the next commit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
4 years agoVFS: Update status of SMB_VFS_STREAMINFO
Noel Power [Thu, 29 Apr 2021 14:41:28 +0000 (15:41 +0100)] 
VFS: Update status of SMB_VFS_STREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May 11 16:38:40 UTC 2021 on sn-devel-184

4 years agos3: VFS: Remove SMB_VFS_STREAMINFO(), no longer used
Noel Power [Wed, 28 Apr 2021 16:55:35 +0000 (17:55 +0100)] 
s3: VFS: Remove SMB_VFS_STREAMINFO(), no longer used

                   ---------------
                  /               \
                 /      REST       \
                /        IN         \
               /        PEACE        \
              /                       \
              |                       |
              |   SMB_VFS_STREAMINFO  |
              |                       |
              |                       |
              |       28 April        |
              |         2021          |
              |                       |
              |                       |
             *|     *  *  *           | *
    _________)/\\_//(\/(/\)/\//\/\////|_)_______

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/modules: VFS: glusterfs: Remove SMB_VFS_STREAMINFO
Jeremy Allison [Mon, 10 May 2021 22:07:35 +0000 (15:07 -0700)] 
s3/modules: VFS: glusterfs: Remove SMB_VFS_STREAMINFO

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/modules: VFS: unityed_media: Remove SMB_VFS_STREAMINFO
Noel Power [Wed, 28 Apr 2021 16:42:37 +0000 (17:42 +0100)] 
s3/modules: VFS: unityed_media: Remove SMB_VFS_STREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/modules: VFS: stream_xattr: Remove SMB_VFS_STREAMINFO
Noel Power [Wed, 28 Apr 2021 16:40:07 +0000 (17:40 +0100)] 
s3/modules: VFS: stream_xattr: Remove SMB_VFS_STREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/modules: VFS: streams_depo: Remove SMB_VFS_STREAMINFO
Noel Power [Wed, 28 Apr 2021 16:32:33 +0000 (17:32 +0100)] 
s3/modules: VFS: streams_depo: Remove SMB_VFS_STREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/modules: VFS: media_harmony: Remove SMB_VFS_STREAMINFO
Noel Power [Wed, 28 Apr 2021 16:30:23 +0000 (17:30 +0100)] 
s3/modules: VFS: media_harmony: Remove SMB_VFS_STREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/modules: VFS: fruit: Remove SMB_VFS_STREAMINFO
Noel Power [Wed, 28 Apr 2021 16:20:21 +0000 (17:20 +0100)] 
s3/modules: VFS: fruit: Remove SMB_VFS_STREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/modules: VFS: catia: Remove SMB_VFS_STREAMINFO
Noel Power [Wed, 28 Apr 2021 15:13:55 +0000 (16:13 +0100)] 
s3/modules: VFS: catia: Remove SMB_VFS_STREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: Remove vfs_streaminfo function
Noel Power [Wed, 28 Apr 2021 15:59:11 +0000 (16:59 +0100)] 
s3: Remove vfs_streaminfo function

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/module: VFS: fruit: vfs_streaminfo -> vfs_fstreaminfo
Noel Power [Wed, 28 Apr 2021 15:58:35 +0000 (16:58 +0100)] 
s3/module: VFS: fruit: vfs_streaminfo -> vfs_fstreaminfo

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/lib: adouble: vfs_streaminfo -> vfs_fstreaminfo
Noel Power [Wed, 28 Apr 2021 15:00:52 +0000 (16:00 +0100)] 
s3/lib: adouble: vfs_streaminfo -> vfs_fstreaminfo

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/smbd: open: vfs_streaminfo -> vfs_fstreaminfo
Noel Power [Wed, 28 Apr 2021 14:35:59 +0000 (15:35 +0100)] 
s3/smbd: open: vfs_streaminfo -> vfs_fstreaminfo

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/smbd: filename: vfs_streaminfo -> vfs_fstreaminfo
Noel Power [Wed, 28 Apr 2021 14:10:07 +0000 (15:10 +0100)] 
s3/smbd: filename: vfs_streaminfo -> vfs_fstreaminfo

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/smbd: close vfs_streaminfo->vfs_fstreaminfo
Noel Power [Wed, 28 Apr 2021 13:33:02 +0000 (14:33 +0100)] 
s3/smbd: close vfs_streaminfo->vfs_fstreaminfo

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/smbd: trans2: vfs_streaminfo -> vfs_fstreaminfo
Noel Power [Wed, 28 Apr 2021 12:59:22 +0000 (13:59 +0100)] 
s3/smbd: trans2: vfs_streaminfo -> vfs_fstreaminfo

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/smbd: ntrans: vfs_streaminfo -> vfs_fstreaminfo
Noel Power [Wed, 28 Apr 2021 12:13:36 +0000 (13:13 +0100)] 
s3/smbd: ntrans: vfs_streaminfo -> vfs_fstreaminfo

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/smbd: add new toplevel vfs_fstreaminfo wrapper
Noel Power [Wed, 28 Apr 2021 08:51:05 +0000 (09:51 +0100)] 
s3/smbd: add new toplevel vfs_fstreaminfo wrapper

This will allow for calling SMB_VFS_FSTREAMINFO in a piecemeal
fashion, at the end of the patch set vfs_fstreaminfo will replace
vfs_streaminfo

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: VFS: streams_xattr: Add impl for SMB_VFS_FSTREAMINFO
Noel Power [Tue, 27 Apr 2021 15:57:57 +0000 (16:57 +0100)] 
s3: VFS: streams_xattr: Add impl for SMB_VFS_FSTREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: VFS: streams_depot SMB_VFS_FSTREAMINFO impl
Noel Power [Tue, 27 Apr 2021 15:51:35 +0000 (16:51 +0100)] 
s3: VFS: streams_depot SMB_VFS_FSTREAMINFO impl

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: VFS: glusterfs: Initialise fstreaminfo_fn to NULL
Noel Power [Tue, 27 Apr 2021 15:14:27 +0000 (16:14 +0100)] 
s3: VFS: glusterfs: Initialise fstreaminfo_fn to NULL

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: vfs: fruit: Implement SMB_VFS_FSTREAMINFO
Noel Power [Tue, 27 Apr 2021 15:09:35 +0000 (16:09 +0100)] 
s3: vfs: fruit: Implement SMB_VFS_FSTREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: VFS: catia: Implement SMB_VFS_FSTREAMINFO
Noel Power [Tue, 27 Apr 2021 14:49:36 +0000 (15:49 +0100)] 
s3: VFS: catia: Implement SMB_VFS_FSTREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoVFS: Add SMB_VFS_FSTREAMINFO
Noel Power [Fri, 7 May 2021 23:11:46 +0000 (16:11 -0700)] 
VFS: Add SMB_VFS_FSTREAMINFO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoaudit logging tests: Fix flapping test
Joseph Sutton [Mon, 10 May 2021 22:03:34 +0000 (10:03 +1200)] 
audit logging tests: Fix flapping test

On Linux, gettimeofday() uses the clock's microsecond field to adjust
the returned time in seconds, while time() only takes the seconds field
into account. As a result, time() would occasionally return a smaller
value than gettimeofday(), despite being called later.

Changing the time() calls to gettimeofday() as used in audit_logging.c
makes the time values consistent.

https://stackoverflow.com/questions/22917318/time-and-gettimeofday-return-different-seconds

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May 11 07:03:35 UTC 2021 on sn-devel-184

4 years agos3:smbd - support streams larger than 64 KiB
Andrew Walker [Fri, 7 May 2021 10:37:25 +0000 (06:37 -0400)] 
s3:smbd - support streams larger than 64 KiB

Add support for streams that are larger than 64 KiB in size. Upper
and lower bound are controlled by the parameters smbd max_xattr_size.
Testing against ReFS on Windows (where ADS size is limited in size
shows the server responding with STATUS_FILESYSTEM_LIMITATION.
Do the same in samba for this case.

Currently, large xattrs are supported in FreeBSD.

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon May 10 20:16:21 UTC 2021 on sn-devel-184

4 years agobootstrap: Add Fedora 34 CI runner
Andreas Schneider [Thu, 6 May 2021 13:24:06 +0000 (15:24 +0200)] 
bootstrap: Add Fedora 34 CI runner

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri May  7 07:18:02 UTC 2021 on sn-devel-184

4 years agobootstrap: Remove libnsl as we dropped NIS support
Andreas Schneider [Thu, 6 May 2021 13:36:20 +0000 (15:36 +0200)] 
bootstrap: Remove libnsl as we dropped NIS support

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agolib:replace: Do not build strndup test with gcc 11 or newer
Andreas Schneider [Thu, 6 May 2021 17:07:04 +0000 (19:07 +0200)] 
lib:replace: Do not build strndup test with gcc 11 or newer

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

gcc11 with -O3 detects that the size is incorrect:

lib/replace/tests/testsuite.c:286:13: error: ‘strndup’ specified bound 10 exceeds source size 4 [-Werror=stringop-overread]
  286 |         x = strndup("bla", 10);
      |             ^~~~~~~~~~~~~~~~~~

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agoFix gcc11 compiler issue "-Werror=stringop-overflow="
Günther Deschner [Mon, 3 May 2021 19:27:58 +0000 (21:27 +0200)] 
Fix gcc11 compiler issue "-Werror=stringop-overflow="

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

[3548/3991] Compiling source3/winbindd/winbindd_pam.c
../../source3/winbindd/winbindd_pam.c: In function ‘winbindd_dual_pam_auth_cached’:
../../source3/winbindd/winbindd_pam.c:1069:18: error: ‘winbindd_get_creds’ accessing 128 bytes in a region of size 8 [-Werror=stringop-overflow=]
 1069 |         result = winbindd_get_creds(domain,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
 1070 |                                     state->mem_ctx,
      |                                     ~~~~~~~~~~~~~~~
 1071 |                                     &sid,
      |                                     ~~~~~
 1072 |                                     &my_info3,
      |                                     ~~~~~~~~~~
 1073 |                                     &cached_nt_pass,
      |                                     ~~~~~~~~~~~~~~~~
 1074 |                                     &cached_salt);
      |                                     ~~~~~~~~~~~~~
../../source3/winbindd/winbindd_pam.c:1069:18: note: referencing argument 5 of type ‘const uint8_t **’ {aka ‘const unsigned char **’}
../../source3/winbindd/winbindd_pam.c:1069:18: error: ‘winbindd_get_creds’ accessing 128 bytes in a region of size 8 [-Werror=stringop-overflow=]
../../source3/winbindd/winbindd_pam.c:1069:18: note: referencing argument 6 of type ‘const uint8_t **’ {aka ‘const unsigned char **’}
In file included from ../../source3/winbindd/winbindd.h:359,
                 from ../../source3/winbindd/winbindd_pam.c:26:
../../source3/winbindd/winbindd_proto.h:251:10: note: in a call to function ‘winbindd_get_creds’
  251 | NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
      |          ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoFix gcc11 compiler issue "-Werror=maybe-uninitialized"
Günther Deschner [Mon, 3 May 2021 19:27:43 +0000 (21:27 +0200)] 
Fix gcc11 compiler issue "-Werror=maybe-uninitialized"

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

../../source4/dsdb/common/util_links.c: In function ‘ndr_guid_compare’:
../../source4/dsdb/common/util_links.c:38:29: error: ‘v1_data’ may be used uninitialized [-Werror=maybe-uninitialized]
   38 |         struct ldb_val v1 = data_blob_const(v1_data, sizeof(v1_data));
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../source4/../lib/util/samba_util.h:48,
                 from ../../source4/include/includes.h:62,
                 from ../../source4/dsdb/common/util_links.c:22:
../../lib/util/data_blob.h:116:20: note: by argument 1 of type ‘const void *’ to ‘data_blob_const’ declared here
  116 | _PUBLIC_ DATA_BLOB data_blob_const(const void *p, size_t length);
      |                    ^~~~~~~~~~~~~~~
../../source4/dsdb/common/util_links.c:37:17: note: ‘v1_data’ declared here
   37 |         uint8_t v1_data[16];
      |                 ^~~~~~~
cc1: all warnings being treated as errors

[1729/3991] Compiling source3/smbd/smbXsrv_open.c
../../libcli/auth/smbencrypt.c: In function ‘decode_wkssvc_join_password_buffer’:
../../libcli/auth/smbencrypt.c:1045:32: error: ‘_confounder’ may be used uninitialized [-Werror=maybe-uninitialized]
 1045 |         DATA_BLOB confounder = data_blob_const(_confounder, 8);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../source4/../lib/util/samba_util.h:48,
                 from ../../source4/include/includes.h:62,
                 from ../../libcli/auth/smbencrypt.c:24:
../../lib/util/data_blob.h:116:20: note: by argument 1 of type ‘const void *’ to ‘data_blob_const’ declared here
  116 | _PUBLIC_ DATA_BLOB data_blob_const(const void *p, size_t length);
      |                    ^~~~~~~~~~~~~~~
../../libcli/auth/smbencrypt.c:1044:17: note: ‘_confounder’ declared here
 1044 |         uint8_t _confounder[8];
      |                 ^~~~~~~~~~~
cc1: all warnings being treated as errors

[2624/3991] Compiling source4/torture/rpc/samr.c
../../source3/rpc_client/cli_samr.c: In function ‘dcerpc_samr_chgpasswd_user2’:
../../source3/rpc_client/cli_samr.c:158:33: error: ‘old_nt_hash’ may be used uninitialized [-Werror=maybe-uninitialized]
  158 |         DATA_BLOB session_key = data_blob_const(old_nt_hash, 16);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../source3/../lib/util/samba_util.h:48,
                 from ../../source3/include/includes.h:256,
                 from ../../source3/rpc_client/cli_samr.c:24:
../../lib/util/data_blob.h:116:20: note: by argument 1 of type ‘const void *’ to ‘data_blob_const’ declared here
  116 | _PUBLIC_ DATA_BLOB data_blob_const(const void *p, size_t length);
      |                    ^~~~~~~~~~~~~~~
../../source3/rpc_client/cli_samr.c:152:17: note: ‘old_nt_hash’ declared here
  152 |         uint8_t old_nt_hash[16];
      |                 ^~~~~~~~~~~
../../source3/rpc_client/cli_samr.c: In function ‘dcerpc_samr_chgpasswd_user3’:
../../source3/rpc_client/cli_samr.c:365:33: error: ‘old_nt_hash’ may be used uninitialized [-Werror=maybe-uninitialized]
  365 |         DATA_BLOB session_key = data_blob_const(old_nt_hash, 16);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../source3/../lib/util/samba_util.h:48,
                 from ../../source3/include/includes.h:256,
                 from ../../source3/rpc_client/cli_samr.c:24:
../../lib/util/data_blob.h:116:20: note: by argument 1 of type ‘const void *’ to ‘data_blob_const’ declared here
  116 | _PUBLIC_ DATA_BLOB data_blob_const(const void *p, size_t length);
      |                    ^~~~~~~~~~~~~~~
../../source3/rpc_client/cli_samr.c:358:17: note: ‘old_nt_hash’ declared here
  358 |         uint8_t old_nt_hash[16];
      |                 ^~~~~~~~~~~
cc1: all warnings being treated as errors

[3399/3991] Compiling source3/rpcclient/cmd_spotlight.c
../../source3/smbd/smbXsrv_open.c: In function ‘smbXsrv_open_set_replay_cache’:
../../source3/smbd/smbXsrv_open.c:936:26: error: ‘data’ may be used uninitialized [-Werror=maybe-uninitialized]
  936 |         DATA_BLOB blob = data_blob_const(data, ARRAY_SIZE(data));
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../source3/../lib/util/samba_util.h:48,
                 from ../../source3/include/includes.h:256,
                 from ../../source3/smbd/smbXsrv_open.c:21:
../../lib/util/data_blob.h:116:20: note: by argument 1 of type ‘const void *’ to ‘data_blob_const’ declared here
  116 | _PUBLIC_ DATA_BLOB data_blob_const(const void *p, size_t length);
      |                    ^~~~~~~~~~~~~~~
../../source3/smbd/smbXsrv_open.c:935:17: note: ‘data’ declared here
  935 |         uint8_t data[SMBXSRV_OPEN_REPLAY_CACHE_FIXED_SIZE];
      |                 ^~~~
cc1: all warnings being treated as errors

../../source3/rpcclient/cmd_spotlight.c: In function ‘cmd_mdssvc_fetch_properties’:
../../source3/rpcclient/cmd_spotlight.c:60:18: error: ‘share_path’ may be used uninitialized [-Werror=maybe-uninitialized]
   60 |         status = dcerpc_mdssvc_open(b, mem_ctx,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   61 |                                     &device_id,
      |                                     ~~~~~~~~~~~
   62 |                                     &unkn1,
      |                                     ~~~~~~~
   63 |                                     &unkn2,
      |                                     ~~~~~~~
   64 |                                     argv[2],
      |                                     ~~~~~~~~
   65 |                                     argv[1],
      |                                     ~~~~~~~~
   66 |                                     share_path,
      |                                     ~~~~~~~~~~~
   67 |                                     &share_handle);
      |                                     ~~~~~~~~~~~~~~
In file included from ../../source3/rpcclient/cmd_spotlight.c:24:
source3/../librpc/gen_ndr/ndr_mdssvc_c.h:26:10: note: by argument 8 of type ‘const char *’ to ‘dcerpc_mdssvc_open’ declared here
   26 | NTSTATUS dcerpc_mdssvc_open(struct dcerpc_binding_handle *h,
      |          ^~~~~~~~~~~~~~~~~~
../../source3/rpcclient/cmd_spotlight.c:40:14: note: ‘share_path’ declared here
   40 |         char share_path[1025];
      |              ^~~~~~~~~~
cc1: all warnings being treated as errors

../../source4/torture/rpc/samr.c: In function ‘test_ChangePasswordUser2’:
../../source4/torture/rpc/samr.c:2266:19: error: ‘old_nt_hash’ may be used uninitialized [-Werror=maybe-uninitialized]
 2266 |                 = data_blob_const(old_nt_hash, sizeof(old_nt_hash));
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../source4/../lib/util/samba_util.h:48,
                 from ../../source4/include/includes.h:62,
                 from ../../source4/torture/rpc/samr.c:24:
../../lib/util/data_blob.h:116:20: note: by argument 1 of type ‘const void *’ to ‘data_blob_const’ declared here
  116 | _PUBLIC_ DATA_BLOB data_blob_const(const void *p, size_t length);
      |                    ^~~~~~~~~~~~~~~
../../source4/torture/rpc/samr.c:2263:17: note: ‘old_nt_hash’ declared here
 2263 |         uint8_t old_nt_hash[16], new_nt_hash[16];
      |                 ^~~~~~~~~~~
../../source4/torture/rpc/samr.c: In function ‘test_ChangePasswordUser2_ntstatus’:
../../source4/torture/rpc/samr.c:2371:19: error: ‘old_nt_hash’ may be used uninitialized [-Werror=maybe-uninitialized]
 2371 |                 = data_blob_const(old_nt_hash, sizeof(old_nt_hash));
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../source4/../lib/util/samba_util.h:48,
                 from ../../source4/include/includes.h:62,
                 from ../../source4/torture/rpc/samr.c:24:
../../lib/util/data_blob.h:116:20: note: by argument 1 of type ‘const void *’ to ‘data_blob_const’ declared here
  116 | _PUBLIC_ DATA_BLOB data_blob_const(const void *p, size_t length);
      |                    ^~~~~~~~~~~~~~~
../../source4/torture/rpc/samr.c:2368:17: note: ‘old_nt_hash’ declared here
 2368 |         uint8_t old_nt_hash[16], new_nt_hash[16];
      |                 ^~~~~~~~~~~
../../source4/torture/rpc/samr.c: In function ‘test_ChangePasswordUser3’:
../../source4/torture/rpc/samr.c:2478:38: error: ‘old_nt_hash’ may be used uninitialized [-Werror=maybe-uninitialized]
 2478 |         DATA_BLOB old_nt_hash_blob = data_blob_const(old_nt_hash, 16);
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../source4/../lib/util/samba_util.h:48,
                 from ../../source4/include/includes.h:62,
                 from ../../source4/torture/rpc/samr.c:24:
../../lib/util/data_blob.h:116:20: note: by argument 1 of type ‘const void *’ to ‘data_blob_const’ declared here
  116 | _PUBLIC_ DATA_BLOB data_blob_const(const void *p, size_t length);
      |                    ^~~~~~~~~~~~~~~
../../source4/torture/rpc/samr.c:2473:17: note: ‘old_nt_hash’ declared here
 2473 |         uint8_t old_nt_hash[16], new_nt_hash[16];
      |                 ^~~~~~~~~~~
../../source4/torture/rpc/samr.c: In function ‘test_ChangePasswordRandomBytes’:
../../source4/torture/rpc/samr.c:2794:19: error: ‘old_nt_hash’ may be used uninitialized [-Werror=maybe-uninitialized]
 2794 |                 = data_blob_const(old_nt_hash,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2795 |                                   sizeof(old_nt_hash));
      |                                   ~~~~~~~~~~~~~~~~~~~~
In file included from ../../source4/../lib/util/samba_util.h:48,
                 from ../../source4/include/includes.h:62,
                 from ../../source4/torture/rpc/samr.c:24:
../../lib/util/data_blob.h:116:20: note: by argument 1 of type ‘const void *’ to ‘data_blob_const’ declared here
  116 | _PUBLIC_ DATA_BLOB data_blob_const(const void *p, size_t length);
      |                    ^~~~~~~~~~~~~~~
../../source4/torture/rpc/samr.c:2792:17: note: ‘old_nt_hash’ declared here
 2792 |         uint8_t old_nt_hash[16], new_nt_hash[16];
      |                 ^~~~~~~~~~~
cc1: all warnings being treated as errors

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: utils: Remove debug2html utility. Not used, installed or tested.
Richard Sharpe [Thu, 6 May 2021 20:33:18 +0000 (13:33 -0700)] 
s3: utils: Remove debug2html utility. Not used, installed or tested.

No reference to it on the web since the year 2000.

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May  7 03:20:46 UTC 2021 on sn-devel-184

4 years agolib:cmdline: Align integer types
Andreas Schneider [Thu, 6 May 2021 10:01:05 +0000 (12:01 +0200)] 
lib:cmdline: Align integer types

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu May  6 13:29:28 UTC 2021 on sn-devel-184

4 years agolib:cmdline: We need to always set a log file
Andreas Schneider [Thu, 6 May 2021 09:21:53 +0000 (11:21 +0200)] 
lib:cmdline: We need to always set a log file

We need to always set a log file name based on the process name. This
defines e.g. the log file for smbd.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agolib:cmdline: Also set logfilebase for -l|--log-basename
Andreas Schneider [Fri, 30 Apr 2021 14:12:29 +0000 (16:12 +0200)] 
lib:cmdline: Also set logfilebase for -l|--log-basename

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agolib:cmdline: Rename to cmdline_sanity_checker
Andreas Schneider [Mon, 3 May 2021 11:35:37 +0000 (13:35 +0200)] 
lib:cmdline: Rename to cmdline_sanity_checker

Will give nicer output if we find duplicates!

$ net help
cmdline_sanity_checker: Duplicate option --long|-l detected!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agolib:cmdline: Improve error message for duplicate options
Andreas Schneider [Thu, 29 Apr 2021 15:04:43 +0000 (17:04 +0200)] 
lib:cmdline: Improve error message for duplicate options

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agogpo: Correct name of files gpo
David Mulder [Wed, 28 Apr 2021 16:32:44 +0000 (10:32 -0600)] 
gpo: Correct name of files gpo

This is important, since having the incorrect
name will prevent policies from removing
correctly on an unapply, or when the policy
is deleted from AD.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 29 22:27:20 UTC 2021 on sn-devel-184

4 years agos3: smbd: SMB1 SMBsplwr doesn't send a reply packet on success.
Jeremy Allison [Thu, 29 Apr 2021 16:50:30 +0000 (09:50 -0700)] 
s3: smbd: SMB1 SMBsplwr doesn't send a reply packet on success.

Missing call to set up req->outbuf means no reply is sent.

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

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 Apr 29 21:27:58 UTC 2021 on sn-devel-184

4 years agowinbindd: remove obsolete sequence_number from struct winbindd_methods
Ralph Boehme [Tue, 27 Apr 2021 14:03:29 +0000 (16:03 +0200)] 
winbindd: remove obsolete sequence_number from struct winbindd_methods

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Apr 29 15:49:16 UTC 2021 on sn-devel-184