]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
5 years agotestprogs: Fix and improve dbcheck-oldrelease test
Andreas Schneider [Wed, 21 Oct 2020 16:03:25 +0000 (18:03 +0200)] 
testprogs: Fix and improve dbcheck-oldrelease test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agotestprogs: Fix and improve functionalprep test
Andreas Schneider [Wed, 21 Oct 2020 15:54:54 +0000 (17:54 +0200)] 
testprogs: Fix and improve functionalprep test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agotestprogs: Fix and improve dbcheck-links test
Andreas Schneider [Wed, 21 Oct 2020 15:41:27 +0000 (17:41 +0200)] 
testprogs: Fix and improve dbcheck-links test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agotestprogs: Fix and improve runtime-links test
Andreas Schneider [Wed, 21 Oct 2020 15:35:34 +0000 (17:35 +0200)] 
testprogs: Fix and improve runtime-links test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agotestprogs: Fix and improve tombstones-expunge test
Andreas Schneider [Wed, 21 Oct 2020 15:04:12 +0000 (17:04 +0200)] 
testprogs: Fix and improve tombstones-expunge test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agotestprogs: Fix and improve demote-saveddb test
Andreas Schneider [Tue, 20 Oct 2020 18:47:43 +0000 (20:47 +0200)] 
testprogs: Fix and improve demote-saveddb test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agotestprogs: Add remove_directory to common test functions
Andreas Schneider [Thu, 22 Oct 2020 09:39:04 +0000 (11:39 +0200)] 
testprogs: Add remove_directory to common test functions

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agopython: Create targetdir recursively
Andreas Schneider [Wed, 21 Oct 2020 05:43:08 +0000 (07:43 +0200)] 
python: Create targetdir recursively

This fixes `make test` in a release tarball.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agolibndr: Avoid assigning duplicate versions to symbols
Amitay Isaacs [Tue, 20 Oct 2020 06:27:14 +0000 (17:27 +1100)] 
libndr: Avoid assigning duplicate versions to symbols

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

Symbols _ndr_push_error and _ndr_pull_error keep getting redefined as
they are included without wildcard in abi_match.  Apparently on linux ld
does not complain about duplicate symbols, but on freebsd ld fails to
link with following error:

  [ 918/3912] Linking bin/default/librpc/libndr.so
  ld: error: duplicate symbol '_ndr_pull_error' in version script
  ld: error: duplicate symbol '_ndr_push_error' in version script
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoAdd VFS-License-clarification.txt as discussed on the Team list.
Jeremy Allison [Wed, 21 Oct 2020 17:53:27 +0000 (10:53 -0700)] 
Add VFS-License-clarification.txt as discussed on the Team list.

Update WHATSNEW.txt with a copy for the next release.

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): Thu Oct 22 15:34:54 UTC 2020 on sn-devel-184

5 years agooss-fuzz: standardise on RPATH for the static-ish binaries
Andrew Bartlett [Thu, 22 Oct 2020 02:39:50 +0000 (15:39 +1300)] 
oss-fuzz: standardise on RPATH for the static-ish binaries

This includes a revert of commit e60df214998afc145ca482cab184691b3ddc3bb2.

We strictly require RPATH, not the modern RUNPATH for the behaviour
we need in oss-fuzz, which is that not just the first line of dependencies
but the full set of libraries used by the program are looked for in the
'$ORIGIN/lib' directory.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu Oct 22 14:10:04 UTC 2020 on sn-devel-184

5 years agofuzzing: Improve robustness and documentation of the ldd-base library copy
Andrew Bartlett [Wed, 21 Oct 2020 23:05:29 +0000 (12:05 +1300)] 
fuzzing: Improve robustness and documentation of the ldd-base library copy

This tries to make progress towards understanding why we sometime see errors like
Step #6: Error occured while running fuzz_reg_parse:
Step #6: /workspace/out/coverage/fuzz_reg_parse: error while loading shared libraries: libavahi-common.so.3: cannot open shared object file: No such file or directory

in the previously failing coverage builds.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agos3:param:service - ensure registry shares loaded before home check
Andrew Walker [Wed, 21 Oct 2020 09:38:45 +0000 (05:38 -0400)] 
s3:param:service - ensure registry shares loaded before home check

Registry shares should be loaded and checked prior to checking home
directories. This ensures that an explicitly defined service takes
priority over home directories (same behavior as non-registry shares).

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

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Alison <jra@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 22 00:30:38 UTC 2020 on sn-devel-184

5 years agolib:util:loadparm - fix leak in lpcfg_dump_a_parameter
Andrew Walker [Wed, 21 Oct 2020 11:47:14 +0000 (07:47 -0400)] 
lib:util:loadparm - fix leak in lpcfg_dump_a_parameter

This function calls talloc_strdup() for the parm_name passed into
it so that we can check whether it's a parametric entry. It's
allocated under the loadparm context passed into the function.
Primary consumer of this is "testparm" and so context short-lived in
typical use-case, but this is also exposed via pyparam and so the
loadparm context may be somewhat longer-lived depending on how it is
being used.

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

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agofuzzing: Fix the oss-fuzz coverage build
Andrew Bartlett [Wed, 21 Oct 2020 18:34:35 +0000 (07:34 +1300)] 
fuzzing: Fix the oss-fuzz coverage build

It was long thought that the issue here was that no seed corpus was
provided, but actually the issue is that to obtain coverage output
just as we already know for gcc gcov, you must provide fuzzing flags
to both the compile and link phase.

Thankfully clang as a linker does not mind the strange non-linker options
from $COVERAGE_FLAGS.

REF: https://stackoverflow.com/questions/56112019/clang-does-not-generate-profraw-file-when-linking-manually
REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19495#c48

Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Oct 21 23:07:37 UTC 2020 on sn-devel-184

5 years agolib: Add tevent_req_received() to messaging_filtered_read_recv()
Volker Lendecke [Thu, 15 Oct 2020 14:31:46 +0000 (16:31 +0200)] 
lib: Add tevent_req_received() to messaging_filtered_read_recv()

Early talloc_free() for the msg_rec if it's not picked up

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): Wed Oct 21 20:27:57 UTC 2020 on sn-devel-184

5 years agolibsmb: Simplify cli_resolve_path()
Volker Lendecke [Wed, 14 Oct 2020 05:09:13 +0000 (07:09 +0200)] 
libsmb: Simplify cli_resolve_path()

The additional conditions in cli_dfs_check_error() were covered
earlier in cli_resolve_path() via cli_conn_have_dfs(). Without those
it's more obvious to directly call NT_STATUS_EQUAL here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Factor out cli_conn_have_dfs() from cli_resolve_path()
Volker Lendecke [Wed, 14 Oct 2020 05:06:15 +0000 (07:06 +0200)] 
libsmb: Factor out cli_conn_have_dfs() from cli_resolve_path()

This also does the checks from cli_dfs_check_error(), which can be
removed in the next step.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoincludes: nt_printing.h does not need client.h
Volker Lendecke [Sun, 18 Oct 2020 16:31:17 +0000 (18:31 +0200)] 
includes: nt_printing.h does not need client.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Fix a typo
Volker Lendecke [Sun, 18 Oct 2020 15:40:30 +0000 (17:40 +0200)] 
libsmb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Use a direct struct initialization to avoid a memset
Volker Lendecke [Sun, 18 Oct 2020 20:43:41 +0000 (22:43 +0200)] 
libsmb: Use a direct struct initialization to avoid a memset

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Use ZERO_STRUCTP
Volker Lendecke [Sun, 18 Oct 2020 20:43:24 +0000 (22:43 +0200)] 
libsmb: Use ZERO_STRUCTP

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Use "struct" in self-references
Volker Lendecke [Sun, 18 Oct 2020 20:42:39 +0000 (22:42 +0200)] 
libsmb: Use "struct" in self-references

Don't go via the typedefs for next and prev pointers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbcacls: Use direct struct initialization
Volker Lendecke [Tue, 20 Oct 2020 07:24:06 +0000 (09:24 +0200)] 
smbcacls: Use direct struct initialization

Use implicit NULL/false initialization

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbcacls: Use ISDOT[DOT] instead of strequal
Volker Lendecke [Tue, 20 Oct 2020 07:07:29 +0000 (09:07 +0200)] 
smbcacls: Use ISDOT[DOT] instead of strequal

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibcli: Align integer types
Volker Lendecke [Fri, 16 Oct 2020 12:21:16 +0000 (14:21 +0200)] 
libcli: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Modernize DBG statements in notify_msg.c
Volker Lendecke [Fri, 16 Oct 2020 12:01:54 +0000 (14:01 +0200)] 
smbd: Modernize DBG statements in notify_msg.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agonotifyd: Modernize DBG statements
Volker Lendecke [Tue, 6 Oct 2020 15:04:05 +0000 (17:04 +0200)] 
notifyd: Modernize DBG statements

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Remove an unused anonymous struct definition
Volker Lendecke [Tue, 13 Oct 2020 11:02:27 +0000 (13:02 +0200)] 
smbd: Remove an unused anonymous struct definition

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Fix a typo
Volker Lendecke [Tue, 13 Oct 2020 06:49:45 +0000 (08:49 +0200)] 
libsmb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Fix a typo
Volker Lendecke [Tue, 13 Oct 2020 09:38:49 +0000 (11:38 +0200)] 
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4:dsdb:acl_read: Implement "List Object" mode feature
Stefan Metzmacher [Tue, 13 Oct 2020 10:43:39 +0000 (12:43 +0200)] 
s4:dsdb:acl_read: Implement "List Object" mode feature

See [MS-ADTS] 5.1.3.3.6 Checking Object Visibility

I tried to avoid any possible overhead for the common cases:

- SEC_ADS_LIST (List Children) is already granted by default
- fDoListObject is off by default

Overhead is only added if the administrator turned on
the fDoListObject feature and removed SEC_ADS_LIST (List Children)
from a parent object.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Oct 21 08:48:02 UTC 2020 on sn-devel-184

5 years agos4:dsdb:util: add dsdb_do_list_object() helper
Stefan Metzmacher [Tue, 6 Oct 2020 09:21:34 +0000 (11:21 +0200)] 
s4:dsdb:util: add dsdb_do_list_object() helper

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agos4:dsdb:acl_read: defer LDB_ERR_NO_SUCH_OBJECT
Stefan Metzmacher [Mon, 12 Oct 2020 15:59:34 +0000 (17:59 +0200)] 
s4:dsdb:acl_read: defer LDB_ERR_NO_SUCH_OBJECT

We may need to return child objects even if the base dn
is invisible.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agos4:dsdb:acl_read: make use of aclread_check_object_visible() for the search base
Stefan Metzmacher [Tue, 6 Oct 2020 13:10:33 +0000 (15:10 +0200)] 
s4:dsdb:acl_read: make use of aclread_check_object_visible() for the search base

We should only have one place to do access checks.

Use 'git show -w' to see the minimal diff.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agos4:dsdb:acl_read: fully set up 'struct aclread_context' before the search base acl...
Stefan Metzmacher [Tue, 6 Oct 2020 13:10:33 +0000 (15:10 +0200)] 
s4:dsdb:acl_read: fully set up 'struct aclread_context' before the search base acl check

This makes further change much easier.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agos4:dsdb:acl_read: introduce aclread_check_object_visible() helper
Stefan Metzmacher [Tue, 6 Oct 2020 13:07:19 +0000 (15:07 +0200)] 
s4:dsdb:acl_read: introduce aclread_check_object_visible() helper

In future this will do more than aclread_check_parent(),
if we implement fDoListObject and SEC_ADS_LIST_OBJECT handling.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agos4:dsdb:tests: add AclVisibiltyTests
Stefan Metzmacher [Wed, 7 Oct 2020 11:21:06 +0000 (13:21 +0200)] 
s4:dsdb:tests: add AclVisibiltyTests

This tests a sorts of combinations in order to
demonstrate the visibility of objects depending on:

- with or without fDoListObject
- with or without explicit DENY ACEs
- A hierachy of objects with 4 levels from the base dn
- SEC_ADS_LIST (List Children)
- SEC_ADS_LIST_LIST_OBJECT (List Object)
- SEC_ADS_READ_PROP
- all possible scopes and basedns

This demonstrates that NO_SUCH_OBJECT doesn't depend purely
on the visibility of the base dn, it's still possible to
get children returned und an invisible base dn.

It also demonstrates the additional behavior with "List Object" mode.
See [MS-ADTS] 5.1.3.3.6 Checking Object Visibility

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agopython/tests: add DynamicTestCase setUpDynamicTestCases() infrastructure
Stefan Metzmacher [Mon, 20 Apr 2020 18:00:51 +0000 (20:00 +0200)] 
python/tests: add DynamicTestCase setUpDynamicTestCases() infrastructure

This can be used in order to run a sepcific test (coded just once)
with an autogenerated set of arguments.

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

Pair-Programmed-With: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agoctdb-common: Avoid aliasing errors during code optimization
Amitay Isaacs [Mon, 27 Jul 2020 02:51:41 +0000 (12:51 +1000)] 
ctdb-common: Avoid aliasing errors during code optimization

When compiling with GCC 10.x and -O3 optimization, the IP checksum
calculation code generates wrong checksum.  The function uint16_checksum
gets inlined during optimization and ip4pkt->tcp data gets wrongly
aliased.

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Oct 21 05:52:28 UTC 2020 on sn-devel-184

5 years agofuzz/oss-fuzz/build_samba: fetch fuzz seeds
Douglas Bagnall [Thu, 15 Oct 2020 01:34:04 +0000 (14:34 +1300)] 
fuzz/oss-fuzz/build_samba: fetch fuzz seeds

There is a git repository at
https://gitlab.com/samba-team/samba-fuzz-seeds that contains the
seeds. When the master branch of that repository is updated, a CI job
runs that creates a zip file of all the seeds as an artifact. That zip
file is downloaded and unpacked by oss_fuzz/build_samba. The contents
of that zip are further zips that contain the seeds for each fuzzing
binary; these are placed next to the binaries in the manner that
oss-fuzz expects.

That is, beside 'fuzz_foo', we put 'fuzz_foo_seed_corpus.zip' which
contains a pile of fuzz_foo seeds.

There may be times when a new fuzz target does not have a seed corpus,
and times when a removed fuzz target leaves behind a seed corpus.
This is OK, so we don't insist on an exact match between the target
names and the zip names, only that there is some overlap.

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): Wed Oct 21 03:47:35 UTC 2020 on sn-devel-184

5 years agofuzz/oss-fuzz/build-samba: note the calling site
Douglas Bagnall [Thu, 15 Oct 2020 01:31:15 +0000 (14:31 +1300)] 
fuzz/oss-fuzz/build-samba: note the calling site

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agofuzzing/README: link to wiki
Douglas Bagnall [Thu, 15 Oct 2020 01:07:10 +0000 (14:07 +1300)] 
fuzzing/README: link to wiki

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:tests: Add tests for 'valid users'.
Denis Karpelevich [Mon, 19 Oct 2020 13:20:04 +0000 (16:20 +0300)] 
s3:tests: Add tests for 'valid users'.

Extending testsuite for option 'valid/invalid users' from smb.conf.

Signed-off-by: Denis Karpelevich <dkarpele@redhat.com>
Reviewed-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 Oct 21 01:17:05 UTC 2020 on sn-devel-184

5 years agoRename Samba's DCO to Samba Developer's Declaration
Bradley M. Kuhn [Thu, 15 Oct 2020 14:52:21 +0000 (07:52 -0700)] 
Rename Samba's DCO to Samba Developer's Declaration

In an effort to reduce any confusion about the differences
between the Samba DCO and the Linux DCO, and as a favor to the
Linux community, rename the Samba DCO to the Samba Developer's
Declaration.

Signed-off-by: Bradley M. Kuhn <bkuhn@sfconservancy.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 20 22:54:01 UTC 2020 on sn-devel-184

5 years agoUpdate Samba's DCO license in compliance with CC-BY-SA 4.0
Bradley M. Kuhn [Thu, 15 Oct 2020 18:55:13 +0000 (11:55 -0700)] 
Update Samba's DCO license in compliance with CC-BY-SA 4.0

The text of "Samba's Developer Certificate of Origin" is copyrighted
and licensed CC-BY-SA.  Add notice for compliance with CC-BY-SA 4.0.

Signed-off-by: Bradley M. Kuhn <bkuhn@sfconservancy.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 20 18:10:50 UTC 2020 on sn-devel-184

5 years agosmb.conf.5: add clarification how configuration changes reflected by Samba
Alexander Bokovoy [Sat, 17 Oct 2020 07:58:12 +0000 (10:58 +0300)] 
smb.conf.5: add clarification how configuration changes reflected by Samba

Users of Linux distributions know to read smb.conf(5) manual page but
apparently not many of them read smbd(8) and winbindd(8) to understand
how changes to smb.conf file are reflected in the running processes.

Add a small section that makes it clear where to find relevant
information. Also correct the information in smbd, nmbd, and winbindd
manual pages.

The interval at which smbd does check for smb.conf changes was increased
from 60 seconds to 180 seconds in 1999 with commit 3db52feb1f3b.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Tue Oct 20 08:50:13 UTC 2020 on sn-devel-184

5 years agos3:ctdbd_conn: Fix the build on FreeBSD
Martin Schwenke [Tue, 20 Oct 2020 03:47:20 +0000 (14:47 +1100)] 
s3:ctdbd_conn: Fix the build on FreeBSD

Commit 6b9564c1084d8dc7319857fac984808571ef0eb9 broke the build on
FreeBSD:

[2321/3909] Compiling source3/smbd/process.c
../../source3/smbd/process.c:2797:10: error: use of undeclared identifier 'EREMOTEIO'
                return EREMOTEIO;
                       ^
../../source3/smbd/process.c:2833:14: error: use of undeclared identifier 'EREMOTEIO'
                if (ret == EREMOTEIO) {
                           ^
2 errors generated.

Use one of the POSIX error codes instead.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Oct 20 07:22:08 UTC 2020 on sn-devel-184

5 years agofuzz_dcerpc_parse_binding: don't leak
Douglas Bagnall [Sat, 17 Oct 2020 22:59:40 +0000 (11:59 +1300)] 
fuzz_dcerpc_parse_binding: don't leak

Also, by not tallocing at all in the too-long case, we can short
circuit quicker.

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): Tue Oct 20 02:26:40 UTC 2020 on sn-devel-184

5 years agos3:tests: Improve test_force_close_share test
Andreas Schneider [Wed, 2 Sep 2020 07:25:43 +0000 (09:25 +0200)] 
s3:tests: Improve test_force_close_share test

This fixes the test with fast disks where 20MB transfers are done in
less than a second.

This also cleans up the code to have less sleeping time!

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): Mon Oct 19 21:14:21 UTC 2020 on sn-devel-184

5 years agospoolss.idl: remove obviously bogous PROCESSOR_ARM 0 define
Björn Jacke [Wed, 7 Oct 2020 17:23:33 +0000 (19:23 +0200)] 
spoolss.idl: remove obviously bogous PROCESSOR_ARM 0 define

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Oct 17 10:46:12 UTC 2020 on sn-devel-184

5 years agoprinting/spoolss: add ARM64 support
Björn Jacke [Wed, 7 Oct 2020 16:00:25 +0000 (18:00 +0200)] 
printing/spoolss: add ARM64 support

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoprinting: move archi_table declarations into nt_printing.h
Björn Jacke [Wed, 7 Oct 2020 15:54:19 +0000 (17:54 +0200)] 
printing: move archi_table declarations into nt_printing.h

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agospoolss.idl: add spoolss architecture defines, that we require
Björn Jacke [Wed, 7 Oct 2020 15:24:45 +0000 (17:24 +0200)] 
spoolss.idl: add spoolss architecture defines, that we require

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agospoolss.idl: add some missing processor defines
Björn Jacke [Wed, 7 Oct 2020 14:07:24 +0000 (16:07 +0200)] 
spoolss.idl: add some missing processor defines

information from wine's winnt.h

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agospoolss.idl: add some missing PROCESSOR_ARCHITECTURE defines
Björn Jacke [Tue, 6 Oct 2020 22:12:11 +0000 (00:12 +0200)] 
spoolss.idl: add some missing PROCESSOR_ARCHITECTURE defines

information from wine's winnt.h and MSDN

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotest: Get the clusteredmember environment out of its smb1 corner
Volker Lendecke [Fri, 16 Oct 2020 14:09:33 +0000 (16:09 +0200)] 
test: Get the clusteredmember environment out of its smb1 corner

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Oct 16 18:30:18 UTC 2020 on sn-devel-184

5 years agotest: Lift clusteredmember_smb1 to use smb2
Volker Lendecke [Fri, 16 Oct 2020 14:08:03 +0000 (16:08 +0200)] 
test: Lift clusteredmember_smb1 to use smb2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agotest: Use the smb2-based deny2 test in clusteredmember_smb1
Volker Lendecke [Fri, 16 Oct 2020 14:06:36 +0000 (16:06 +0200)] 
test: Use the smb2-based deny2 test in clusteredmember_smb1

There is no reason to use the SMB1-based ntdeny2 test. It was just
an arbitrary test that depends on clustering to work.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoCVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 zero password
Gary Lockyer [Sun, 27 Sep 2020 21:02:16 +0000 (10:02 +1300)] 
CVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 zero password

Ensure that a password of all zeros shorter than the maximum length is
rejected.

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): Fri Oct 16 06:09:06 UTC 2020 on sn-devel-184

5 years agoCVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 max len password
Gary Lockyer [Sun, 27 Sep 2020 21:01:34 +0000 (10:01 +1300)] 
CVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 max len password

Ensure that a maximum length password (512) is still accepted

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoCVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 all zero password
Gary Lockyer [Sun, 27 Sep 2020 21:00:54 +0000 (10:00 +1300)] 
CVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 all zero password

Check that an all zero password is rejected, Note this test user ARC4
encryption so that it passes the self encryption test.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoCVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 confounder
Gary Lockyer [Sun, 27 Sep 2020 21:00:00 +0000 (10:00 +1300)] 
CVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 confounder

Test that a confounder that encrypts to itself is rejected

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoCVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 all zero password
Gary Lockyer [Sun, 27 Sep 2020 20:54:41 +0000 (09:54 +1300)] 
CVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 all zero password

Check that a password buffer containing all zeros is rejected.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoCVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 all zero enc req
Gary Lockyer [Sun, 27 Sep 2020 20:45:28 +0000 (09:45 +1300)] 
CVE-2020-1472(ZeroLogon): torture: ServerSetPassword2 all zero enc req

Check that a request that encrypts to all zeros, is rejected if the length
encrypts to itself.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoCVE-2020-1472(ZeroLogon): torture: Move existing tests
Gary Lockyer [Sun, 27 Sep 2020 20:33:35 +0000 (09:33 +1300)] 
CVE-2020-1472(ZeroLogon): torture: Move existing tests

Move the existing ZeroLogon tests into the ZeroLogon testsuite.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoCVE-2020-1472(ZeroLogon): Add zerologon test suite
Gary Lockyer [Sun, 27 Sep 2020 20:29:25 +0000 (09:29 +1300)] 
CVE-2020-1472(ZeroLogon): Add zerologon test suite

Add a ZeroLogon test suite, to allow the ZeroLogon tests to be run against
the s3 and s4 netlogon servers.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoCVE-2020-1472(ZeroLogon): rpc_server/netlogon: Fix confounder check
Gary Lockyer [Thu, 24 Sep 2020 01:35:47 +0000 (13:35 +1200)] 
CVE-2020-1472(ZeroLogon): rpc_server/netlogon: Fix confounder check

Add check for zero length confounder, to allow setting of passwords 512
bytes long. This does not need to be backported, as it is extremely
unlikely that anyone is using 512 byte passwords.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agotevent: also use portable __has_attribute macro to check for "deprecated" attribute
Björn Jacke [Thu, 8 Oct 2020 10:21:31 +0000 (12:21 +0200)] 
tevent: also use portable __has_attribute macro to check for "deprecated" attribute

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

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoreplace: also use portable __has_attribute macro to check for "deprecated" attribute
Björn Jacke [Thu, 8 Oct 2020 10:10:35 +0000 (12:10 +0200)] 
replace: also use portable __has_attribute macro to check for "deprecated" attribute

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

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agotalloc: also use portable __has_attribute macro to check for "deprecated" attribute
Björn Jacke [Thu, 8 Oct 2020 10:05:41 +0000 (12:05 +0200)] 
talloc: also use portable __has_attribute macro to check for "deprecated" attribute

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

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agofuzz: add fuzz_cli_credentials_parse_string
Douglas Bagnall [Thu, 8 Oct 2020 03:22:44 +0000 (16:22 +1300)] 
fuzz: add fuzz_cli_credentials_parse_string

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agofuzz: add fuzz_dcerpc_parse_binding
Douglas Bagnall [Wed, 30 Sep 2020 02:34:37 +0000 (15:34 +1300)] 
fuzz: add fuzz_dcerpc_parse_binding

We parse a binding and do a few tricks with it, including turning it
into a tower and back.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agovfs_zfsacl: add zfs configuration guidance to manpage
Andrew Walker [Thu, 24 Sep 2020 20:57:59 +0000 (16:57 -0400)] 
vfs_zfsacl: add zfs configuration guidance to manpage

Provide minimal background information on recommended ZFS settings
for a samba share.

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-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 Oct 15 20:27:34 UTC 2020 on sn-devel-184

5 years agovfs_zfsacl: only grant DELETE_CHILD if ACL tag is special
Andrew Walker [Thu, 24 Sep 2020 20:04:12 +0000 (16:04 -0400)] 
vfs_zfsacl: only grant DELETE_CHILD if ACL tag is special

When ZFS aclmode is set to "passthrough" chmod(2)/fchmod(2) will result
in special entries being modified in a way such that delete, delete_child,
write_named_attr, write_attribute are stripped from the returned ACL entry,
and the kernel / ZFS treats this as having rights equivalent to the desired
POSIX mode. Historically, samba has added delete_child to the NFSv4 ACL, but
this is only really called for in the case of special entries in this
particular circumstance.

Alter circumstances in which delete_child is granted so that it only
is added to special entries. This preserves the intend post-chmod behavior,
but avoids unnecessarily increasing permissions in cases where it's not
intended. Further modification of this behavior may be required so that
we grant a general read or general write permissions set in case of
POSIX read / POSIX write on special entries.

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

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_zfsacl: use a helper variable in zfs_get_nt_acl_common()
Ralph Boehme [Thu, 20 Aug 2020 14:41:36 +0000 (16:41 +0200)] 
vfs_zfsacl: use a helper variable in zfs_get_nt_acl_common()

No change in behaviour.

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

Pair-Programmed-With: Andrew Walker <awalker@ixsystems.com>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_zfsacl: README.Coding fix
Ralph Boehme [Thu, 20 Aug 2020 14:42:17 +0000 (16:42 +0200)] 
vfs_zfsacl: README.Coding fix

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

Pair-Programmed-With: Andrew Walker <awalker@ixsystems.com>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_zfsacl: Add new parameter to stop automatic addition of special entries
Andrew Walker [Thu, 24 Sep 2020 15:42:16 +0000 (11:42 -0400)] 
vfs_zfsacl: Add new parameter to stop automatic addition of special entries

Prevent ZFS from automatically adding NFSv4 special entries (owner@, group@,
everyone@). ZFS will automatically add these these entries when calculating the
inherited ACL of new files if the ACL of the parent directory lacks an
inheriting special entry. This may result in user confusion and unexpected
change in permissions of files and directories as the inherited ACL is
generated. Blocking this behavior is achieved by setting an inheriting
everyone@ that grants no permissions and not adding the entry to the file's
Security Descriptor.

This change also updates behavior so that the fd-based syscall facl() is
used where possible.

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

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_zfsacl: use handle based facl() call to query ZFS filesytem ACL
Ralph Boehme [Thu, 20 Aug 2020 14:18:35 +0000 (16:18 +0200)] 
vfs_zfsacl: use handle based facl() call to query ZFS filesytem ACL

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

Pair-Programmed-With: Andrew Walker <awalker@ixsystems.com>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:ctdbd_conn: simplify get_public_ips() / find_in_public_ips() API
David Disseldorp [Sun, 6 Sep 2020 22:17:11 +0000 (00:17 +0200)] 
s3:ctdbd_conn: simplify get_public_ips() / find_in_public_ips() API

These calls are used to check whether an IP address is static to the
host, or whether it could be migrated by ctdb.

Combine the calls into a simple ctdbd_public_ip_foreach(cb) function,
which avoids the need to expose struct ctdb_public_ip_list_old.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Oct 14 12:29:56 UTC 2020 on sn-devel-184

5 years agos3:smbd: rename has_ctdb_public_ip to has_cluster_movable_ip
David Disseldorp [Sun, 6 Sep 2020 20:59:20 +0000 (22:59 +0200)] 
s3:smbd: rename has_ctdb_public_ip to has_cluster_movable_ip

This provides a little more detail to what's actually being tracked
with this boolean.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agosmb2_ioctl_network_fs: fix minor leak in error path
David Disseldorp [Sun, 6 Sep 2020 21:59:04 +0000 (23:59 +0200)] 
smb2_ioctl_network_fs: fix minor leak in error path

The struct fsctl_net_iface_info array needs to be cleaned up.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agointerface: fix if_index is not parsed correctly
Jones Syue [Mon, 28 Sep 2020 01:10:03 +0000 (09:10 +0800)] 
interface: fix if_index is not parsed correctly

Replace probed_ifaces[i] with ifs.

In SDC 2020 SMB3 Virtual IO Lab,
run Windows Protocol Test Suite to test FileServer multichannel test cases.
Samba server has 2 virtual interfaces for VPN connection:
> name=tun2001, ip/mask=192.168.144.9/22
> name=tun2002, ip/mask=192.168.144.10/22
test suite client can ping these 2 ip addresses and browse shares.
Then client try to use IOCTL FSCTL_QUERY_NETWORK_INTERFACE_INFO to get the
virtual ip addresses of samba server, but samba server responded it
without the virtual ip addresses. My VPN setup is point-to-point and the
virtual interfaces 'tun2001' & 'tun2002' are without flag IFF_BROADCAST.
So edit smb.conf and add
"interfaces = ${virtual_ip}/${mask_length};if_index=${id}", like this:
> interfaces = eth4 eth8 eth11 eth10 qvs0 "192.168.144.9/22;if_index=50" "192.168.144.10/22;if_index=51"
then samba server IOCTL response could return the virtual ip addresses,
but found a issue:
the interface index of virtual ip addresses is always 4294967295
(0xFFFFFFFF, -1).

Quote Metze: https://gitlab.com/samba-team/devel/samba/-/commit/6cadb55d975a6348a417caed8b3258f5be2acba4#note_419181789
This looks good, I think that also explains
the possible memory corruption/crash I mentioned in the bug report.
As 'i' is most likely the same as 'total_probed' and
probed_ifaces[i] is not valid, so we overwrite unrelated memory.
Later I see 'realloc(): invalid pointer' and this backtrace:
  BACKTRACE:
   #0 log_stack_trace + 0x29 [ip=0x7f2f1b6fffa9] [sp=0x7ffcd0ab53e0]
   #1 smb_panic + 0x11 [ip=0x7f2f1b700301] [sp=0x7ffcd0ab5d10]
   #2 sig_fault + 0x54 [ip=0x7f2f1b7004f4] [sp=0x7ffcd0ab5e20]
   #3 funlockfile + 0x50 [ip=0x7f2f17ce6dd0] [sp=0x7ffcd0ab5ec0]
   #4 gsignal + 0x10f [ip=0x7f2f1794970f] [sp=0x7ffcd0ab6b90]
   #5 abort + 0x127 [ip=0x7f2f17933b25] [sp=0x7ffcd0ab6cb0]
   #6 __libc_message + 0x297 [ip=0x7f2f1798c897] [sp=0x7ffcd0ab6de0]
   #7 malloc_printerr + 0x1c [ip=0x7f2f17992fdc] [sp=0x7ffcd0ab6ef0]
   #8 realloc + 0x23a [ip=0x7f2f17997f6a] [sp=0x7ffcd0ab6f00]
   #9 _talloc_realloc + 0xee [ip=0x7f2f1a365d2e] [sp=0x7ffcd0ab6f50]
   #10 messaging_filtered_read_send + 0x18c [ip=0x7f2f1a10f54c] [sp=0x7ffcd0ab6fb0]
   #11 messaging_read_send + 0x55 [ip=0x7f2f1a10f705] [sp=0x7ffcd0ab7000]
   #12 smb2srv_session_table_init + 0x83 [ip=0x7f2f1b3a6cd3] [sp=0x7ffcd0ab7040]
   #13 smbXsrv_connection_init_tables + 0x2d [ip=0x7f2f1b373f4d] [sp=0x7ffcd0ab7060]
   #14 smbd_smb2_request_process_negprot + 0x827 [ip=0x7f2f1b38cb47] [sp=0x7ffcd0ab7080]
   #15 smbd_smb2_request_dispatch + 0x19db [ip=0x7f2f1b38921b] [sp=0x7ffcd0ab71d0]
   #16 smbd_smb2_process_negprot + 0x298 [ip=0x7f2f1b38bb38] [sp=0x7ffcd0ab7260]
   #17 process_smb + 0x2ca [ip=0x7f2f1b37537a] [sp=0x7ffcd0ab72b0]
   #18 smbd_server_connection_read_handler + 0xd0 [ip=0x7f2f1b376420] [sp=0x7ffcd0ab7350]

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

Signed-off-by: Jones Syue <jonessyue@qnap.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agovfs_shadow_copy2: Avoid closing snapsdir twice
Anoop C S [Mon, 12 Oct 2020 11:25:40 +0000 (16:55 +0530)] 
vfs_shadow_copy2: Avoid closing snapsdir twice

As per man page for closedir(3):

. . .
The  closedir() function closes the directory stream associated with
dirp.  A successful call to closedir() also closes the underlying file
descriptor associated with dirp.
. . .

Therefore we don't have to attempt an additional close of file
descriptor after closedir().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Oct 14 10:08:24 UTC 2020 on sn-devel-184

5 years agos3:lib: Move interface prototypes to own header file
Andreas Schneider [Tue, 11 Aug 2020 08:41:07 +0000 (10:41 +0200)] 
s3:lib: Move interface prototypes to own header file

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 Oct  9 20:36:13 UTC 2020 on sn-devel-184

5 years agos3:include: Move loadparm prototypes to own header file
Andreas Schneider [Mon, 10 Aug 2020 13:47:35 +0000 (15:47 +0200)] 
s3:include: Move loadparm prototypes to own header file

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:libsmb: Remove max_protocol from clidfs do_connect()
Andreas Schneider [Thu, 27 Aug 2020 14:46:29 +0000 (16:46 +0200)] 
s3:libsmb: Remove max_protocol from clidfs do_connect()

The if check for max_protocol == 0 is part of lp_client_max_protocol().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:libcmb: Remove max_protocol from cli_cm_connect()
Andreas Schneider [Thu, 27 Aug 2020 14:45:12 +0000 (16:45 +0200)] 
s3:libcmb: Remove max_protocol from cli_cm_connect()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:libsmb: Remove max_protocol from cli_cm_open()
Andreas Schneider [Thu, 27 Aug 2020 14:43:46 +0000 (16:43 +0200)] 
s3:libsmb: Remove max_protocol from cli_cm_open()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:client: Remove global max_protocol
Andreas Schneider [Thu, 27 Aug 2020 14:40:49 +0000 (16:40 +0200)] 
s3:client: Remove global max_protocol

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:libsmb: Pass cli_credentials to cli_resolve_path(), using helper variables.
Andreas Schneider [Tue, 18 Aug 2020 15:42:25 +0000 (17:42 +0200)] 
s3:libsmb: Pass cli_credentials to cli_resolve_path(), using helper variables.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
5 years agos3:libsmb: Pass cli_credentials to cli_cm_open()
Andreas Schneider [Tue, 18 Aug 2020 15:26:54 +0000 (17:26 +0200)] 
s3:libsmb: Pass cli_credentials to cli_cm_open()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:libsmb: Pass cli_credentials to cli_cm_connect()
Andreas Schneider [Tue, 18 Aug 2020 15:18:16 +0000 (17:18 +0200)] 
s3:libsmb: Pass cli_credentials to cli_cm_connect()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:libsmb: Pass cli_credentials to clidfs do_connect()
Andreas Schneider [Tue, 18 Aug 2020 15:15:09 +0000 (17:15 +0200)] 
s3:libsmb: Pass cli_credentials to clidfs do_connect()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:libsmb: Remove force_encrypt from cli_check_msdfs_proxy()
Andreas Schneider [Thu, 27 Aug 2020 13:52:11 +0000 (15:52 +0200)] 
s3:libsmb: Remove force_encrypt from cli_check_msdfs_proxy()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:libsmb: Remove force_encrypt from clidfs do_connect()
Andreas Schneider [Thu, 27 Aug 2020 13:28:28 +0000 (15:28 +0200)] 
s3:libsmb: Remove force_encrypt from clidfs do_connect()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:libsmb: Remove force_encrypt from cli_cm_connect()
Andreas Schneider [Thu, 27 Aug 2020 13:26:39 +0000 (15:26 +0200)] 
s3:libsmb: Remove force_encrypt from cli_cm_connect()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:libsmb: Remove force_encrypt from cli_cm_open()
Andreas Schneider [Thu, 27 Aug 2020 13:24:27 +0000 (15:24 +0200)] 
s3:libsmb: Remove force_encrypt from cli_cm_open()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:client: Remove global smb_encrypt
Andreas Schneider [Thu, 27 Aug 2020 13:19:27 +0000 (15:19 +0200)] 
s3:client: Remove global smb_encrypt

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:tests: Add smbclient tests for 'client smb encrypt'
Andreas Schneider [Tue, 8 Sep 2020 08:15:20 +0000 (10:15 +0200)] 
s3:tests: Add smbclient tests for 'client smb encrypt'

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>