]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
5 years agosamba-tool: Add a gpo command for setting Security Group Policy
David Mulder [Fri, 6 Nov 2020 19:19:12 +0000 (12:19 -0700)] 
samba-tool: Add a gpo command for setting Security Group Policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agosamba-tool: Test gpo Security set command
David Mulder [Tue, 10 Nov 2020 15:05:37 +0000 (08:05 -0700)] 
samba-tool: Test gpo Security set command

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agosamba-tool: Add a gpo command for removing Sudoers Group Policy
David Mulder [Fri, 6 Nov 2020 16:54:59 +0000 (09:54 -0700)] 
samba-tool: Add a gpo command for removing Sudoers Group Policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agosamba-tool: Test gpo Sudoers remove command
David Mulder [Mon, 9 Nov 2020 23:08:59 +0000 (16:08 -0700)] 
samba-tool: Test gpo Sudoers remove command

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agosamba-tool: Add a gpo command for adding Sudoers Group Policy
David Mulder [Fri, 6 Nov 2020 16:30:35 +0000 (09:30 -0700)] 
samba-tool: Add a gpo command for adding Sudoers Group Policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agosamba-tool: Test gpo Sudoers add command
David Mulder [Mon, 9 Nov 2020 22:48:28 +0000 (15:48 -0700)] 
samba-tool: Test gpo Sudoers add command

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agosamba-tool: Add a gpo command for listing Sudoers Group Policies
David Mulder [Fri, 6 Nov 2020 16:29:57 +0000 (09:29 -0700)] 
samba-tool: Add a gpo command for listing Sudoers Group Policies

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agosamba-tool: Test gpo Sudoers list command
David Mulder [Mon, 9 Nov 2020 15:34:28 +0000 (08:34 -0700)] 
samba-tool: Test gpo Sudoers list command

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agodbcheck: err_normalise-mismatch_replace: no msg if no error
Douglas Bagnall [Thu, 3 Dec 2020 22:53:48 +0000 (11:53 +1300)] 
dbcheck: err_normalise-mismatch_replace: no msg if no error

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Dec  9 17:04:23 UTC 2020 on sn-devel-184

5 years agodbcheck: fix doc for err_normalise_mismatch*
Douglas Bagnall [Thu, 3 Dec 2020 22:52:40 +0000 (11:52 +1300)] 
dbcheck: fix doc for err_normalise_mismatch*

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodbcheck: fix doc for do_rename()
Douglas Bagnall [Thu, 3 Dec 2020 22:51:42 +0000 (11:51 +1300)] 
dbcheck: fix doc for do_rename()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodbcheck: remove unused fix_incorrect_deleted_objects flag
Douglas Bagnall [Thu, 3 Dec 2020 22:19:50 +0000 (11:19 +1300)] 
dbcheck: remove unused fix_incorrect_deleted_objects flag

This was introduced in db15993401f927fd2fcea1687c4155dce2272aa8
but not actually referenced then or since.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodbcheck: improve some duplicate doc strings
Douglas Bagnall [Thu, 3 Dec 2020 21:15:24 +0000 (10:15 +1300)] 
dbcheck: improve some duplicate doc strings

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodbcheck: drop py2 support from dump_attr_values()
Douglas Bagnall [Thu, 3 Dec 2020 21:10:50 +0000 (10:10 +1300)] 
dbcheck: drop py2 support from dump_attr_values()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodbcheck: don't try to stringify values list twice
Douglas Bagnall [Thu, 3 Dec 2020 21:12:08 +0000 (10:12 +1300)] 
dbcheck: don't try to stringify values list twice

dump_attr_values already turns it into a comma separated list.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodbcheck: add docstring for err_odd_userParameters
Douglas Bagnall [Thu, 3 Dec 2020 23:34:52 +0000 (12:34 +1300)] 
dbcheck: add docstring for err_odd_userParameters

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodbcheck: fix documentation for err_doubled_userParameters
Douglas Bagnall [Thu, 3 Dec 2020 23:34:22 +0000 (12:34 +1300)] 
dbcheck: fix documentation for err_doubled_userParameters

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodbcheck: fix documentation and typo for err_utf_userParameters
Douglas Bagnall [Thu, 3 Dec 2020 23:34:02 +0000 (12:34 +1300)] 
dbcheck: fix documentation and typo for err_utf_userParameters

pseudo, not psudo.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodbcheck: fix documentation for err_base64_userParameters
Douglas Bagnall [Thu, 3 Dec 2020 23:33:27 +0000 (12:33 +1300)] 
dbcheck: fix documentation for err_base64_userParameters

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodbcheck: fix documentation for err_duplicate_values
Douglas Bagnall [Thu, 3 Dec 2020 22:56:00 +0000 (11:56 +1300)] 
dbcheck: fix documentation for err_duplicate_values

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agoselftest/subunit: python file modernisation
Douglas Bagnall [Thu, 19 Nov 2020 03:44:42 +0000 (16:44 +1300)] 
selftest/subunit: python file modernisation

Python idioms for iterating over a line and closing it have improved,
and we should keep up.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agodrs_utils: remove unused sendRemoveDsServer()
Douglas Bagnall [Wed, 18 Nov 2020 23:43:01 +0000 (12:43 +1300)] 
drs_utils: remove unused sendRemoveDsServer()

The only caller of this was `samba-tool domain demote` which stopped
using it in 2015 with commit f121173cbf46fe64746d73adf40015c43d5c55fc.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agopython: remove unused provision.check_install()
Douglas Bagnall [Wed, 18 Nov 2020 23:23:45 +0000 (12:23 +1300)] 
python: remove unused provision.check_install()

Unused for at last 10 years.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agosamba-tool gpo: use common attr_default
Douglas Bagnall [Wed, 18 Nov 2020 22:24:47 +0000 (11:24 +1300)] 
samba-tool gpo: use common attr_default

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agosamba-tool drs: move attr_default to common
Douglas Bagnall [Wed, 18 Nov 2020 22:24:25 +0000 (11:24 +1300)] 
samba-tool drs: move attr_default to common

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agosamba-tool pso uses common timestamp functions
Douglas Bagnall [Wed, 18 Nov 2020 22:20:35 +0000 (11:20 +1300)] 
samba-tool pso uses common timestamp functions

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agosamba-tool domain: move timestamp functions to common
Douglas Bagnall [Wed, 18 Nov 2020 22:19:04 +0000 (11:19 +1300)] 
samba-tool domain: move timestamp functions to common

Other tools use identical functions, and they too can use common.py

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos4:torture:smb2: remove unused fallback defines in oplock.c
Stefan Metzmacher [Mon, 7 Dec 2020 11:06:11 +0000 (12:06 +0100)] 
s4:torture:smb2: remove unused fallback defines in oplock.c

F_SETLEASE/F_SETSIG were all included in the kernel
and glibc in 2002, there's no need to have fallbacks 18 years later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Dec  7 20:07:18 UTC 2020 on sn-devel-184

5 years agos3:smbd: remove unused fallback defines in oplock_linux.c
Stefan Metzmacher [Mon, 7 Dec 2020 11:06:11 +0000 (12:06 +0100)] 
s3:smbd: remove unused fallback defines in oplock_linux.c

F_GETLEASE/F_SETLEASE/F_SETSIG were all included in the kernel
and glibc in 2002, there's no need to have fallbacks 18 years later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/wscript: only check for F_SETLEASE being available at compile time
Stefan Metzmacher [Mon, 7 Dec 2020 10:38:59 +0000 (11:38 +0100)] 
s3/wscript: only check for F_SETLEASE being available at compile time

F_GETLEASE/F_SETLEASE are available (at least) since Linux 2.4.0 from
2002.

We also should not have the configure check depend on the filesystem
we find at build time. It's very common that the build-environment is
much more restricted than the runtime-environment will be.

As a history we had this check on Samba 3.6:

 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
 AC_TRY_RUN([
 #include <sys/types.h>
 #include <fcntl.h>
 #ifndef F_GETLEASE
 #define F_GETLEASE 1025
 #endif
 main() {
        int fd = open("/dev/null", O_RDONLY);
        return fcntl(fd, F_GETLEASE, 0) == -1;
 }
 ],
 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
    AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX,1,[Whether to use linux kernel oplocks])
 fi

which didn't depend on the filesystem.

Then we got a broken check introduced in Samba 4.0 (a copy of the
F_NOTIFY check):

 # Check for Linux kernel oplocks
 conf.CHECK_CODE('''
 #include <sys/types.h>
 #include <fcntl.h>
 #include <signal.h>
 #ifndef F_NOTIFY
 #define F_NOTIFY 1026
 #endif
 main() {
         exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ?  1 : 0);
 }''', 'HAVE_KERNEL_OPLOCKS_LINUX', addmain=False, execute=True,
        msg="Checking for Linux kernel oplocks")

this got "fixed" in Samba 4.7 (and backports to 4.6, 4.5 and 4.4) into

 # Check for Linux kernel oplocks
 conf.CHECK_CODE('''
 #include <sys/types.h>
 #include <fcntl.h>
 #include <signal.h>
 #ifndef F_GETLEASE
 #define F_GETLEASE 1025
 #endif
 main() {
         exit(fcntl(open("/tmp", O_RDONLY), F_GETLEASE, 0) == -1 ?  1 : 0);
 }''', 'HAVE_KERNEL_OPLOCKS_LINUX', addmain=False, execute=True,
        msg="Checking for Linux kernel oplocks")

Lately it became dependend on the filesystem in the build-environment:

 # Check for Linux kernel oplocks
 conf.CHECK_CODE('''
 #include <sys/types.h>
 #include <fcntl.h>
 #include <signal.h>
 #ifndef F_GETLEASE
 #define F_GETLEASE 1025
 #endif
 main() {
       const char *fname="/tmp/oplock-test.txt";
       int fd = open(fname, O_RDWR|O_CREAT, 0644);
       int ret = fcntl(fd, F_SETLEASE, F_WRLCK);
       unlink(fname);
       return (ret == -1) ? 1 : 0;
 }''', 'HAVE_KERNEL_OPLOCKS_LINUX', addmain=False, execute=True,
        msg="Checking for Linux kernel oplocks")

Now we just check for F_SETLEASE being available in linux/fcntl.h.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/wscript: remove unused check for F_NOTIFY
Stefan Metzmacher [Mon, 7 Dec 2020 10:24:43 +0000 (11:24 +0100)] 
s3/wscript: remove unused check for F_NOTIFY

There're no references to F_NOTIFY nor HAVE_KERNEL_CHANGE_NOTIFY in the
code, so the configure check is not needed at all.

We only use the inotify or fam abstractions.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4/samba: call force_check_log_size() in standard_new_task()
Ralph Boehme [Thu, 26 Nov 2020 14:24:44 +0000 (15:24 +0100)] 
s4/samba: call force_check_log_size() in standard_new_task()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248
RN: samba process does not honor max log size

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): Mon Dec  7 18:54:29 UTC 2020 on sn-devel-184

5 years agos4/samba: call force_check_log_size() in standard_accept_connection()
Ralph Boehme [Thu, 26 Nov 2020 14:24:26 +0000 (15:24 +0100)] 
s4/samba: call force_check_log_size() in standard_accept_connection()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4/samba: call force_check_log_size() in prefork_reload_after_fork()
Ralph Boehme [Thu, 26 Nov 2020 14:23:58 +0000 (15:23 +0100)] 
s4/samba: call force_check_log_size() in prefork_reload_after_fork()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
5 years agos4: call reopen_logs_internal() in the SIGHUP handler of the prefork process model
Ralph Boehme [Mon, 23 Nov 2020 15:44:04 +0000 (16:44 +0100)] 
s4: call reopen_logs_internal() in the SIGHUP handler of the prefork process model

With debug_schedule_reopen_logs() the actual reopen only takes place at some
point in the future when a DEBUG message is processed.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4: replace low-level SIGUP handler with a tevent handler
Ralph Boehme [Fri, 20 Nov 2020 14:21:03 +0000 (15:21 +0100)] 
s4: replace low-level SIGUP handler with a tevent handler

Replace the low-level signal handler for SIGHUP with a nice tevent signal
handler. The low-level handler sig_hup() installed by setup_signals() remains
being used during early startup before a tevent context is available.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4: install tevent tracing hooks to trigger logfile rotation
Ralph Boehme [Thu, 26 Nov 2020 13:21:58 +0000 (14:21 +0100)] 
s4: install tevent tracing hooks to trigger logfile rotation

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4: add samba server tevent trace helper stuff
Ralph Boehme [Mon, 23 Nov 2020 16:53:57 +0000 (17:53 +0100)] 
s4: add samba server tevent trace helper stuff

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodebug: detect logrotation by checking inode number
Ralph Boehme [Mon, 23 Nov 2020 15:04:03 +0000 (16:04 +0100)] 
debug: detect logrotation by checking inode number

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodebug: pass struct debug_class *config to do_one_check_log_size()
Ralph Boehme [Mon, 23 Nov 2020 14:51:09 +0000 (15:51 +0100)] 
debug: pass struct debug_class *config to do_one_check_log_size()

Pass a pointer to the struct instead of all struct members individually. No
change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodebug: pass struct debug_class *config to reopen_one_log()
Ralph Boehme [Mon, 23 Nov 2020 14:46:47 +0000 (15:46 +0100)] 
debug: pass struct debug_class *config to reopen_one_log()

Pass a pointer to the struct instead of all struct members individually. No
change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoloadparm: setup debug subsystem setting max_log_size from config
Ralph Boehme [Fri, 13 Nov 2020 11:34:50 +0000 (12:34 +0100)] 
loadparm: setup debug subsystem setting max_log_size from config

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoWHATSNEW.txt: fix version to 4.14
Stefan Metzmacher [Sat, 5 Dec 2020 21:19:07 +0000 (22:19 +0100)] 
WHATSNEW.txt: fix version to 4.14

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Dec  5 22:35:04 UTC 2020 on sn-devel-184

5 years agosmbd: Remove "have_share_modes" from "struct share_mode_data"
Volker Lendecke [Thu, 3 Dec 2020 16:16:25 +0000 (17:16 +0100)] 
smbd: Remove "have_share_modes" from "struct share_mode_data"

Nobody in share_mode_lock.c looked at that value anymore, so we don't
need to manually maintain it.

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): Fri Dec  4 22:32:38 UTC 2020 on sn-devel-184

5 years agosmbd: Simplify share_mode_entry_do()
Volker Lendecke [Thu, 3 Dec 2020 16:12:20 +0000 (17:12 +0100)] 
smbd: Simplify share_mode_entry_do()

Rely on the truth in locking.tdb wrt existence of share entries

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Remove a comment that was not helpful for me
Volker Lendecke [Thu, 3 Dec 2020 16:03:32 +0000 (17:03 +0100)] 
smbd: Remove a comment that was not helpful for me

Also avoid an "else" branch

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Simplify share_mode_lock_destructor()
Volker Lendecke [Thu, 3 Dec 2020 16:02:10 +0000 (17:02 +0100)] 
smbd: Simplify share_mode_lock_destructor()

Rely on the truth in the database whether we found share modes or
not, share_mode_data_store() has that information for free.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Remove unused share_mode_have_entries()
Volker Lendecke [Thu, 3 Dec 2020 15:23:58 +0000 (16:23 +0100)] 
smbd: Remove unused share_mode_have_entries()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Simplify open_mode_check()
Volker Lendecke [Thu, 3 Dec 2020 15:18:25 +0000 (16:18 +0100)] 
smbd: Simplify open_mode_check()

The call to share_mode_have_entries() was put in before
fresh_share_mode_lock() initialized d->flags to be completely
permissive. With that correct initialization the call to
share_conflict() a few lines down will also make open_mode_check()
pass for any share_access/access_mask.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Simplify share_mode_memcache_fetch()
Volker Lendecke [Tue, 1 Dec 2020 12:50:32 +0000 (13:50 +0100)] 
smbd: Simplify share_mode_memcache_fetch()

Take a struct file_id instead of a locking.tdb key,
share_mode_memcache_store() also operates on the implicit fid in
struct share_mode_data.

To do this, parse_share_modes() also needs to take file_id.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agobuild: Fix kernel oplock test
Volker Lendecke [Fri, 20 Nov 2020 13:19:21 +0000 (14:19 +0100)] 
build: Fix kernel oplock test

In a pure docker environment with overlayfs F_GETLEASE works on /tmp,
but F_SETLEASE does not. This test now correctly detects that.

The effect is that the samba-fileserver environment would run fine in
a shared gitlab runner, at the price of not testing kernel oplocks. We
could move the kernel oplock tests to another environment that for
other reasons can't run on shared gitlab runners.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Align integer types
Volker Lendecke [Tue, 1 Dec 2020 12:27:11 +0000 (13:27 +0100)] 
smbd: Align integer types

full_path_tos() return ssize_t

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agospoolssd: Align integer types
Volker Lendecke [Thu, 3 Dec 2020 15:23:39 +0000 (16:23 +0100)] 
spoolssd: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoclitar: Align integer types
Volker Lendecke [Wed, 2 Dec 2020 10:13:11 +0000 (11:13 +0100)] 
clitar: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: Align integer types
Volker Lendecke [Mon, 30 Nov 2020 12:39:15 +0000 (13:39 +0100)] 
lib: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: smbd: Quiet log messages from usershares for an unknown share.
Jeremy Allison [Wed, 2 Dec 2020 19:47:02 +0000 (11:47 -0800)] 
s3: smbd: Quiet log messages from usershares for an unknown share.

No need to log missing shares/sharenames at debug level zero.

Keep the debug level zero for all other usershare problems.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Rowland penny <rpenny@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec  4 20:54:06 UTC 2020 on sn-devel-184

5 years agovfs_zfsacl: add missing inherited flag on hidden "magic" everyone@ ACE
Ralph Boehme [Mon, 30 Nov 2020 11:28:58 +0000 (12:28 +0100)] 
vfs_zfsacl: add missing inherited flag on hidden "magic" everyone@ ACE

This was an omission in the fixes for bug 14470.

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

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): Tue Dec  1 20:29:34 UTC 2020 on sn-devel-184

5 years agovfs_zfsacl: reformatting
Ralph Boehme [Mon, 30 Nov 2020 11:28:00 +0000 (12:28 +0100)] 
vfs_zfsacl: reformatting

No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoselftest: Remove samba3.blackbox.smbclient_tar from flapping tests
Noel Power [Mon, 30 Nov 2020 09:21:50 +0000 (09:21 +0000)] 
selftest: Remove samba3.blackbox.smbclient_tar from flapping tests

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoclitar: Use do_list()'s recursion in clitar.c
Volker Lendecke [Tue, 1 Dec 2020 07:58:14 +0000 (08:58 +0100)] 
clitar: Use do_list()'s recursion in clitar.c

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Aurelien Aptel <aaptel@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
5 years agos3/script/tests: Ensure all remote test files are removed
Jeremy Allison [Mon, 30 Nov 2020 17:19:29 +0000 (17:19 +0000)] 
s3/script/tests: Ensure all remote test files are removed

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
5 years agos3/script/tests: call smbclient deltree to remove remote files
Noel Power [Mon, 30 Nov 2020 10:41:57 +0000 (10:41 +0000)] 
s3/script/tests: call smbclient deltree to remove remote files

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/script/tests: Make smb_client 'die' behaviour configurable
Noel Power [Mon, 30 Nov 2020 10:18:32 +0000 (10:18 +0000)] 
s3/script/tests: Make smb_client 'die' behaviour configurable

smb_client behaviour is to die if there is an error. This is
a little heavy handed and make it impossible for example to
use smb_client to run a command that might fail (where such
a failure isn't really an error) E.G. Calling deltree and
the directory doesn't exist

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/script/tests: Remove make_path (for remote dir)
Noel Power [Mon, 30 Nov 2020 09:59:58 +0000 (09:59 +0000)] 
s3/script/tests: Remove make_path (for remote dir)

LOCALPATH is actually the local path to the share, we should
not need to create the share path (it should already exist)

Note: When we remove the tree located at LOCALPATH we keep the root
      so the share path should always be there

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoselftest: make samba3.blackbox.smbclient_tar runnable (even manually)
Noel Power [Mon, 30 Nov 2020 11:15:06 +0000 (11:15 +0000)] 
selftest: make samba3.blackbox.smbclient_tar runnable (even manually)

samba3.blackbox.smbclient_tar is marked as flapping so it
seems we have missed that it has stopped working. The local path
passed to script/tests/test_smbclient_tarmode.pl must point to a
valid share

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/script/tests: Fix samba3.blackbox.smbclient_tarmode cleanup
Noel Power [Mon, 30 Nov 2020 17:39:25 +0000 (17:39 +0000)] 
s3/script/tests: Fix samba3.blackbox.smbclient_tarmode cleanup

Make sure samba3.blackbox.smbclient_tarmode removes data files
not just before running the test but also after

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/script: Use smbclient deltree to clean up smbclient_tarmode subdir
Noel Power [Fri, 27 Nov 2020 15:52:27 +0000 (15:52 +0000)] 
s3/script: Use smbclient deltree to clean up smbclient_tarmode subdir

Replace rm -rf of local dir (that is hosted remotely)
with smbclient deltree

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/script/tests: Use tarmode share for samba3.blackbox.smbclient_tar*
Noel Power [Fri, 27 Nov 2020 15:33:26 +0000 (15:33 +0000)] 
s3/script/tests: Use tarmode share for samba3.blackbox.smbclient_tar*

After this change both samba3.blackbox.smbclient_tar &
samba3.blackbox.smbclient_tarmode now use the same dedicated share

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/script/test: Use different testdir for samba3.blackbox.smbclient_tarmode
Noel Power [Fri, 27 Nov 2020 15:25:21 +0000 (15:25 +0000)] 
s3/script/test: Use different testdir for samba3.blackbox.smbclient_tarmode

The other tarmode torture test samba3.blackbox.smbclient_tar now uses a share
'tarmode' which uses the same source path as samba3.blackbox.smbclient_tarmode

Avoid conflicting paths and use a new subdir (of the test share) called
'smbclient_tarmode'

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoselftest: Add a new tarmode shares
Noel Power [Thu, 26 Nov 2020 17:31:50 +0000 (17:31 +0000)] 
selftest: Add a new tarmode shares

samba3.blackbox.smbclient_tar & samba3.blackbox.smbclient_tar
need separate shares with own xattr tdb(s)

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/script/tests: Fix 'Unrecognized option(s) passed to mkpath()' error
Noel Power [Fri, 27 Nov 2020 12:01:49 +0000 (12:01 +0000)] 
s3/script/tests: Fix 'Unrecognized option(s) passed to mkpath()' error

'keep_root' is an unrecognised option for make_path/mkpath

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotest: Fix the FreeBSD build
Volker Lendecke [Thu, 26 Nov 2020 13:30:36 +0000 (14:30 +0100)] 
test: Fix the FreeBSD build

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): Mon Nov 30 23:48:02 UTC 2020 on sn-devel-184

5 years agosmbd: Fix the 32-bit build on FreeBSD
Volker Lendecke [Thu, 26 Nov 2020 13:23:24 +0000 (14:23 +0100)] 
smbd: Fix the 32-bit build on FreeBSD

log->rec_index is not size_t, it's uint64_t

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowbinfo: Align some integer types
Volker Lendecke [Thu, 26 Nov 2020 13:18:20 +0000 (14:18 +0100)] 
wbinfo: Align some integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: Change make_file_id_from_itime() prototype
Volker Lendecke [Mon, 23 Nov 2020 14:37:44 +0000 (15:37 +0100)] 
lib: Change make_file_id_from_itime() prototype

SMB_STRUCT_STAT is defined in includes.h. This way including file_id.h
is possible without including includes.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotorture: Align integer types
Volker Lendecke [Mon, 23 Nov 2020 15:15:34 +0000 (16:15 +0100)] 
torture: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Slightly beautify internal_resolve_name()
Volker Lendecke [Tue, 24 Nov 2020 20:22:55 +0000 (21:22 +0100)] 
libsmb: Slightly beautify internal_resolve_name()

We have "goto done;" at the end of every if-branch, we don't need
else.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Move a variable closer to its use in internal_resolve_name()
Volker Lendecke [Tue, 24 Nov 2020 20:24:34 +0000 (21:24 +0100)] 
libsmb: Move a variable closer to its use in internal_resolve_name()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosamldb: Align two integer types
Volker Lendecke [Wed, 25 Nov 2020 15:33:32 +0000 (16:33 +0100)] 
samldb: Align two integer types

ARRAY_SIZE is size_t

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotest: smbtorture3's OPLOCK5 test only available with kernel oplocks
Volker Lendecke [Thu, 26 Nov 2020 08:56:50 +0000 (09:56 +0100)] 
test: smbtorture3's OPLOCK5 test only available with kernel oplocks

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Align integer types
Volker Lendecke [Mon, 23 Nov 2020 11:27:38 +0000 (12:27 +0100)] 
libsmb: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Fix a typo
Volker Lendecke [Sat, 21 Nov 2020 20:17:39 +0000 (21:17 +0100)] 
libsmb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowinbind: Align integer types
Volker Lendecke [Sat, 21 Nov 2020 12:02:28 +0000 (13:02 +0100)] 
winbind: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibcli: Align integer types
Volker Lendecke [Sat, 14 Nov 2020 15:31:09 +0000 (16:31 +0100)] 
libcli: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibrpc: talloc_stackframe() panics on failure
Volker Lendecke [Sat, 14 Nov 2020 09:16:57 +0000 (10:16 +0100)] 
librpc: talloc_stackframe() panics on failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibrpc: Make ep_register a bit easier to understand
Volker Lendecke [Sat, 14 Nov 2020 09:15:33 +0000 (10:15 +0100)] 
librpc: Make ep_register a bit easier to understand

I found the pointer dereference a bit confusing

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibrpc: Fix a talloc_stackframe() leak
Volker Lendecke [Sat, 14 Nov 2020 09:12:20 +0000 (10:12 +0100)] 
librpc: Fix a talloc_stackframe() leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibcli: Align a few integer types
Volker Lendecke [Sun, 29 Nov 2020 17:25:07 +0000 (18:25 +0100)] 
libcli: Align a few integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodocs: Fix "async dns timeout" manpage entry
Volker Lendecke [Sun, 29 Nov 2020 12:06:34 +0000 (13:06 +0100)] 
docs: Fix "async dns timeout" manpage entry

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoloadparm: Simplify lp_get_async_dns_timeout()
Volker Lendecke [Sun, 29 Nov 2020 12:05:02 +0000 (13:05 +0100)] 
loadparm: Simplify lp_get_async_dns_timeout()

Use MAX, and per README.Coding we don't need the intermediate
variable. This can be inspected in the debugger directly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodsgetdcname: Fix talloc hierarchy
Volker Lendecke [Fri, 27 Nov 2020 21:00:10 +0000 (22:00 +0100)] 
dsgetdcname: Fix talloc hierarchy

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotests python krb5: Extra canonicalization tests
Gary Lockyer [Wed, 18 Nov 2020 01:49:28 +0000 (14:49 +1300)] 
tests python krb5: Extra canonicalization tests

Add tests that set the server name to the client name for the machine
account in the kerberos AS_REQ.  This replicates the TEST_AS_REQ_SELF
test phase in source4/torture/krb5/kdc-canon-heimdal.c.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov 30 05:21:42 UTC 2020 on sn-devel-184

5 years agovfs_glusterfs: print exact cmdline for disabling write-behind translator
Günther Deschner [Tue, 24 Nov 2020 14:38:41 +0000 (15:38 +0100)] 
vfs_glusterfs: print exact cmdline for disabling write-behind translator

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Nov 27 17:15:07 UTC 2020 on sn-devel-184

5 years agodocs-xml: Add a section about weak crypto in testparm manpage
Andreas Schneider [Fri, 27 Nov 2020 10:22:15 +0000 (11:22 +0100)] 
docs-xml: Add a section about weak crypto in testparm manpage

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

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): Fri Nov 27 13:48:20 UTC 2020 on sn-devel-184

5 years agos4: rename source4/smbd/ to source4/samba/
Ralph Boehme [Fri, 20 Nov 2020 14:27:17 +0000 (15:27 +0100)] 
s4: rename source4/smbd/ to source4/samba/

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov 27 10:07:18 UTC 2020 on sn-devel-184

5 years agosamba-tool: Give better error information when the 'domain backup restore' fails...
Andrew Bartlett [Fri, 13 Nov 2020 02:26:07 +0000 (15:26 +1300)] 
samba-tool: Give better error information when the 'domain backup restore' fails with a duplicate SID

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Thu Nov 26 21:15:40 UTC 2020 on sn-devel-184

5 years agos3:libsmb: Return early if dir is NULL
Andreas Schneider [Wed, 25 Nov 2020 12:01:46 +0000 (13:01 +0100)] 
s3:libsmb: Return early if dir is NULL

This makes sure we do not dereference a NULL poineter.

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Nov 26 11:07:09 UTC 2020 on sn-devel-184

5 years agos3:mdssd: Fix creating binding string for error message
Andreas Schneider [Wed, 25 Nov 2020 11:55:56 +0000 (12:55 +0100)] 
s3:mdssd: Fix creating binding string for error message

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:lsasd: Fix creating binding string for error message
Andreas Schneider [Wed, 25 Nov 2020 11:55:24 +0000 (12:55 +0100)] 
s3:lsasd: Fix creating binding string for error message

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:spoolssd: Fix creating binding string for error message
Andreas Schneider [Wed, 25 Nov 2020 10:46:05 +0000 (11:46 +0100)] 
s3:spoolssd: Fix creating binding string for error message

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>