samba.git
5 years agofallout from py_dsdb_DsReplicaAttribute to -> bytes
Noel Power [Thu, 17 May 2018 12:34:00 +0000 (13:34 +0100)]
fallout from py_dsdb_DsReplicaAttribute to -> bytes

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4/dsdb: py_dsdb_DsReplicaAttribute should deal with bytes in py3
Noel Power [Mon, 14 May 2018 19:05:30 +0000 (20:05 +0100)]
s4/dsdb: py_dsdb_DsReplicaAttribute should deal with bytes in py3

Seems the underlying c code expects binary blob, so.. we should
handle str for py2 and byte for py3

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4/selftest: enable samba.tests.samba_tool.rodc for PY3
Noel Power [Fri, 11 May 2018 15:41:44 +0000 (16:41 +0100)]
s4/selftest: enable samba.tests.samba_tool.rodc for PY3

5 years agos4/selftest: enable samba.tests.upgradeprovisionneeddc for py3
Noel Power [Fri, 11 May 2018 15:39:06 +0000 (16:39 +0100)]
s4/selftest: enable samba.tests.upgradeprovisionneeddc for py3

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython/samba/provision: PY3 port to run samba.tests.upgradeprovisionneeddc
Noel Power [Fri, 7 Sep 2018 09:10:56 +0000 (10:10 +0100)]
python/samba/provision: PY3 port to run samba.tests.upgradeprovisionneeddc

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agotorture: Remove unnecesssary #include <fcntl.h>
Christof Schmitt [Sat, 15 Sep 2018 00:00:26 +0000 (17:00 -0700)]
torture: Remove unnecesssary #include <fcntl.h>

This is now provided through system/filesys.h.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agomdssvc: Move a variable declaration closer to its use
Volker Lendecke [Fri, 3 Aug 2018 10:45:59 +0000 (12:45 +0200)]
mdssvc: Move a variable declaration closer to its use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep 14 10:48:47 CEST 2018 on sn-devel-144

5 years agomdssvc: Move a variable declaration closer to its use
Volker Lendecke [Fri, 3 Aug 2018 10:44:31 +0000 (12:44 +0200)]
mdssvc: Move a variable declaration closer to its use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agomdssvc: Move a variable declaration closer to its use
Volker Lendecke [Fri, 3 Aug 2018 10:43:37 +0000 (12:43 +0200)]
mdssvc: Move a variable declaration closer to its use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agomdssvc: Simplify sl_unpack_loop
Volker Lendecke [Fri, 3 Aug 2018 10:38:47 +0000 (12:38 +0200)]
mdssvc: Simplify sl_unpack_loop

Move a variable declaration closer to its use, avoid a redundant
?true:false;

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agostreams_xattr: Make error handling more obvious
Volker Lendecke [Wed, 8 Aug 2018 12:20:58 +0000 (14:20 +0200)]
streams_xattr: Make error handling more obvious

Do the NULL check right after the alloc call

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agostreams_xattr: Make error handling more obvious
Volker Lendecke [Wed, 8 Aug 2018 12:20:58 +0000 (14:20 +0200)]
streams_xattr: Make error handling more obvious

Do the NULL check right after the alloc call

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Simplify parse_share_modes
Volker Lendecke [Mon, 10 Sep 2018 13:14:00 +0000 (15:14 +0200)]
smbd: Simplify parse_share_modes

Since 823bc4c07ad pidl initializes the [skip] entries

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Simplify share_mode_lock.c
Volker Lendecke [Mon, 10 Sep 2018 12:50:40 +0000 (14:50 +0200)]
smbd: Simplify share_mode_lock.c

"the_lock_id" is not required here. The share mode data carry the file
id, so use that.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Fix a false comment
Volker Lendecke [Mon, 10 Sep 2018 10:20:10 +0000 (12:20 +0200)]
smbd: Fix a false comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agotevent: Fix a docu typo
Volker Lendecke [Sat, 22 Oct 2016 11:59:12 +0000 (13:59 +0200)]
tevent: Fix a docu typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Remove "file_sync_all" function
Volker Lendecke [Thu, 13 Sep 2018 04:21:37 +0000 (06:21 +0200)]
smbd: Remove "file_sync_all" function

Replace with a call to files_forall. Why? I just came across this
function that only has one pretty obscure user. This does not justify
a full library function, IMHO at least.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Avoid casts in DEBUG statements
Volker Lendecke [Mon, 10 Sep 2018 10:55:48 +0000 (12:55 +0200)]
smbd: Avoid casts in DEBUG statements

Some indentation changed, best viewed with "git show -w"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Avoid casts in DEBUG statements
Volker Lendecke [Thu, 13 Sep 2018 17:36:47 +0000 (19:36 +0200)]
smbd: Avoid casts in DEBUG statements

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Add a paranoia check for leases
Volker Lendecke [Thu, 13 Sep 2018 16:56:54 +0000 (18:56 +0200)]
smbd: Add a paranoia check for leases

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agodbwrap_tdb: Avoid double-call to talloc_get_type_abort
Volker Lendecke [Thu, 16 Aug 2018 11:18:14 +0000 (13:18 +0200)]
dbwrap_tdb: Avoid double-call to talloc_get_type_abort

We've already retrieved "ctx" in the callers of db_tdb_fetch_locked_internal().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Add some structure protection for durable reconnect
Volker Lendecke [Mon, 10 Sep 2018 12:53:37 +0000 (14:53 +0200)]
smbd: Add some structure protection for durable reconnect

We should consume all data, and the ndr_pull function fills in all
fields. Thus the ZERO_STRUCT(cookie) is not required.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agowafsamba: Only use $DESTDIR in INSTALL_DIR() if it is set
Martin Schwenke [Thu, 13 Sep 2018 00:54:48 +0000 (10:54 +1000)]
wafsamba: Only use $DESTDIR in INSTALL_DIR() if it is set

Otherwise the leading '/' is stripped and directories are created
relative to the current directory.

This fixes a regression introduced in recent commit
26ea0f58daace4adef7c5bb17f19476083bf3b7b.

Reported-by: Ralph Böhme <slow@samba.org>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Sep 13 09:37:23 CEST 2018 on sn-devel-144

5 years agodbwrap_ctdb: return correct record count for a persistent db read-only traverse
Ralph Boehme [Mon, 10 Sep 2018 10:50:01 +0000 (12:50 +0200)]
dbwrap_ctdb: return correct record count for a persistent db read-only traverse

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 13 01:34:30 CEST 2018 on sn-devel-144

5 years agodbwrap_ctdb: increment record count in traverse_callback()
Ralph Boehme [Sun, 9 Sep 2018 16:51:43 +0000 (18:51 +0200)]
dbwrap_ctdb: increment record count in traverse_callback()

state->count wasn't incremented and is returned at the end of a
dbwrap_traverse().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodbwrap_ctdb: use struct initializer in db_ctdb_traverse()
Ralph Boehme [Sun, 9 Sep 2018 16:50:14 +0000 (18:50 +0200)]
dbwrap_ctdb: use struct initializer in db_ctdb_traverse()

This ensures all struct members are implicitly initialized.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodbwrap_ctdb: use struct initializer in db_ctdb_traverse_read()
Ralph Boehme [Sun, 9 Sep 2018 16:48:13 +0000 (18:48 +0200)]
dbwrap_ctdb: use struct initializer in db_ctdb_traverse_read()

This ensures all struct members are implicitly initialized.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodbwrap_ctdb: README.Coding fixes in traverse_callback()
Ralph Boehme [Sun, 9 Sep 2018 16:35:26 +0000 (18:35 +0200)]
dbwrap_ctdb: README.Coding fixes in traverse_callback()

NULL initialize pointers, check function return values, explicit
variable check against NULL.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodbwrap_ctdb: simplify if condition
Ralph Boehme [Tue, 4 Sep 2018 10:47:42 +0000 (12:47 +0200)]
dbwrap_ctdb: simplify if condition

This just moves the talloc_memdup() out of the if condition as per
README.Coding.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodbwrap_ctdb: add error checking to ctdbd_dbpath()
Ralph Boehme [Sun, 4 Mar 2018 22:39:05 +0000 (23:39 +0100)]
dbwrap_ctdb: add error checking to ctdbd_dbpath()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodbwrap_tdb: use struct initializer
Ralph Boehme [Sat, 18 Aug 2018 06:35:27 +0000 (08:35 +0200)]
dbwrap_tdb: use struct initializer

This ensures all struct members are implicitly initialized.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodbwrap_tdb: move a function call out of an if condition
Ralph Boehme [Sat, 18 Aug 2018 07:12:21 +0000 (09:12 +0200)]
dbwrap_tdb: move a function call out of an if condition

At least for me this improves readability somewhat. No change in
behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodbwrap: early return, removes an indentation level
Ralph Boehme [Sat, 18 Nov 2017 11:13:15 +0000 (12:13 +0100)]
dbwrap: early return, removes an indentation level

No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodbwrap: move sockname variable and call to lp_ctdbd_socket into context
Ralph Boehme [Sat, 18 Nov 2017 07:56:09 +0000 (08:56 +0100)]
dbwrap: move sockname variable and call to lp_ctdbd_socket into context

sockname is only needed in a cluster.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoctdb-doc: Remove PIDFILE option from ctdbd_wrapper man page
Ralph Wuerthner [Tue, 11 Sep 2018 08:00:52 +0000 (10:00 +0200)]
ctdb-doc: Remove PIDFILE option from ctdbd_wrapper man page

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

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Sep 12 21:50:57 CEST 2018 on sn-devel-144

5 years agosamba_dnsupdate: honor 'dns zone scavenging' option, only update if needed
Björn Baumbach [Wed, 5 Sep 2018 14:54:01 +0000 (16:54 +0200)]
samba_dnsupdate: honor 'dns zone scavenging' option, only update if needed

Since scavenging is implemented the samba_dnsupdate command always updates all
dns records required by the dc. This is not needed if dns zone scavenging
is not enabled.

This avoids the repeating TSIG error messages:

 # samba_dnsupdate --option='dns zone scavenging = yes' 2>&1 | uniq -c
     29 ; TSIG error with server: tsig verify failure
      1 Failed update of 29 entries
 # echo ${PIPESTATUS[0]}
 29

 # samba_dnsupdate --option='dns zone scavenging = no' 2>&1 | uniq -c
 # echo ${PIPESTATUS[0]}
 0

Note that this results in about 60 lines in the log file,
which triggered every 10 minutes ("dnsupdate:name interval=600" is the default).

This restores the behavior before 8ef42d4dab4dfaf5ad225b33f7748914f14dcd8c,
if "dns zone scavenging" is not switched on (which is still the default).

Avoiding the message from happening at all is subject for more debugging,
most likely they are caused by bugs in 'nsupdate -g' (from the bind package).

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

Pair-programmed-with: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Wed Sep 12 18:03:10 CEST 2018 on sn-devel-144

5 years agoctdb-build: Fix version handling when building tarball
Martin Schwenke [Sat, 8 Sep 2018 22:11:33 +0000 (08:11 +1000)]
ctdb-build: Fix version handling when building tarball

Split get_version() into 2 functions, so that .distversion file can be
created.

Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Sep 12 05:50:46 CEST 2018 on sn-devel-144

5 years agosmbd:vfs: fix mis-spellings of hierarchy in comments
Michael Adam [Mon, 20 Aug 2018 10:04:20 +0000 (12:04 +0200)]
smbd:vfs: fix mis-spellings of hierarchy in comments

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep 12 02:05:47 CEST 2018 on sn-devel-144

5 years agos3: smbd: Ensure dirpath is set to ".", not "\0" so it is always a valid path.
Jeremy Allison [Wed, 22 Aug 2018 20:37:04 +0000 (13:37 -0700)]
s3: smbd: Ensure dirpath is set to ".", not "\0" so it is always a valid path.

Cleanup of the internals of unix_convert().

Ensure check_parent_exists() returns this in the non-optimization
case. Ensure unix_convert() initializes dirpath to ".".

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3: smbd: Restructure check_parent_exists() to ensure all non-optimization returns...
Jeremy Allison [Wed, 22 Aug 2018 16:15:12 +0000 (09:15 -0700)]
s3: smbd: Restructure check_parent_exists() to ensure all non-optimization returns go to one place.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3: smbd: Initialization cleanup.
Jeremy Allison [Wed, 22 Aug 2018 16:09:27 +0000 (09:09 -0700)]
s3: smbd: Initialization cleanup.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:libsmbclient: Fix a typo
Andreas Schneider [Tue, 11 Sep 2018 12:56:54 +0000 (14:56 +0200)]
s3:libsmbclient: Fix a typo

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 11 21:43:28 CEST 2018 on sn-devel-144

5 years agos4: torture: Fix "flakey" notify test on slow cloud filesystems.
Jeremy Allison [Mon, 10 Sep 2018 22:35:03 +0000 (15:35 -0700)]
s4: torture: Fix "flakey" notify test on slow cloud filesystems.

Ensure we keep asking for change notifies until we get them all
(or the request times out).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agosmbd: Use has_other_nonposix_opens in smb_posix_unlink
Volker Lendecke [Sat, 8 Sep 2018 16:05:57 +0000 (18:05 +0200)]
smbd: Use has_other_nonposix_opens in smb_posix_unlink

Almost the same code as in close.c. has_other_nonposix_opens() is a bit
more general, but the purpose is the same.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Factor out "has_other_nonposix_opens"
Volker Lendecke [Sat, 8 Sep 2018 14:58:36 +0000 (16:58 +0200)]
smbd: Factor out "has_other_nonposix_opens"

This is exactly the same in both file and directory cases

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Remove an unneeded #include
Volker Lendecke [Sat, 8 Sep 2018 11:50:46 +0000 (13:50 +0200)]
smbd: Remove an unneeded #include

ndr_open_files already includes open_files.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Simplify close_directory()
Volker Lendecke [Sat, 8 Sep 2018 11:44:30 +0000 (13:44 +0200)]
smbd: Simplify close_directory()

Same patch as in 8541829a9ab20c7fa8c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Remove an unneeded #include
Volker Lendecke [Sat, 8 Sep 2018 10:45:54 +0000 (12:45 +0200)]
smbd: Remove an unneeded #include

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowafsamba: Drop unused, broken install_dir()
Martin Schwenke [Tue, 11 Sep 2018 04:35:38 +0000 (14:35 +1000)]
wafsamba: Drop unused, broken install_dir()

This is broken because it doesn't respect $DESTDIR.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Tue Sep 11 10:00:05 CEST 2018 on sn-devel-144

5 years agowafsamba: Have INSTALL_DIR() log directory creation
Martin Schwenke [Tue, 11 Sep 2018 04:35:02 +0000 (14:35 +1000)]
wafsamba: Have INSTALL_DIR() log directory creation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agowafsamba: Make INSTALL_DIR() respect $DESTDIR
Martin Schwenke [Mon, 10 Sep 2018 00:35:24 +0000 (10:35 +1000)]
wafsamba: Make INSTALL_DIR() respect $DESTDIR

INSTALL_DIR() currently ignores $DESTDIR and just installs directories
into the final destination.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agoctdb-build: Use wafsamba's INSTALL_DIR()
Martin Schwenke [Sun, 9 Sep 2018 10:34:31 +0000 (20:34 +1000)]
ctdb-build: Use wafsamba's INSTALL_DIR()

install_dir() doesn't work (doesn't respect $DESTDIR) and is only
available for backward compatibilty.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 years agowafsamba: remove tru64cc.py as it's not compatible with waf 2
Stefan Metzmacher [Fri, 7 Sep 2018 14:40:44 +0000 (16:40 +0200)]
wafsamba: remove tru64cc.py as it's not compatible with waf 2

third_party/waf/waflib/Tools/compiler_c.py proposed
gcc for osf1V/Tru64.

If there's more needed on Tru64 someone with a Tru64 box needs to
provide a waf 2 compatible fix.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Sep 10 22:49:31 CEST 2018 on sn-devel-144

5 years agowafsamba: remove hpuxcc.py as it's not compatible with waf 2
Stefan Metzmacher [Fri, 7 Sep 2018 14:40:44 +0000 (16:40 +0200)]
wafsamba: remove hpuxcc.py as it's not compatible with waf 2

third_party/waf/waflib/Tools/compiler_c.py proposed
gcc for HPUX.

If there's more needed on HPUX someone with a HPUX box needs to
provide a waf 2 compatible fix.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agowafsamba: remove irixcc.py as we don't support IRIX any more
Stefan Metzmacher [Fri, 7 Sep 2018 14:32:28 +0000 (16:32 +0200)]
wafsamba: remove irixcc.py as we don't support IRIX any more

There's still a irixcc.py in waf itself.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agowafsamba: fix generic_cc.py to work with waf 2
Stefan Metzmacher [Fri, 7 Sep 2018 14:27:58 +0000 (16:27 +0200)]
wafsamba: fix generic_cc.py to work with waf 2

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agobuildtools/wafsamba: undefine a define for a failed test unless asked to keep it
Alexander Bokovoy [Fri, 7 Sep 2018 14:34:48 +0000 (14:34 +0000)]
buildtools/wafsamba: undefine a define for a failed test unless asked to keep it

If conf.CHECK_CODE() is called without `always=True` and the test has
failed, undefine the define already set to '0' by conf.check_code().

This restores expectations that undefined symbols are not considered to
be set by CONFIG_SET() method.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoRevert "wafsamba/samba_autoconf: when setting undefined result, use empty tuple"
Stefan Metzmacher [Mon, 10 Sep 2018 08:22:16 +0000 (10:22 +0200)]
Revert "wafsamba/samba_autoconf: when setting undefined result, use empty tuple"

This reverts commit 95ba6b97441b75f28aef5ec1ee5a9442683f3763.

There was already a better fix under discusion.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoRevert "lib/replace: force to unset defines if check has failed"
Stefan Metzmacher [Mon, 10 Sep 2018 08:22:13 +0000 (10:22 +0200)]
Revert "lib/replace: force to unset defines if check has failed"

This reverts commit 8ec7eb0c0129518557d1f446191860a62ef3ff79.

There was already a better fix under discusion.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftext: Mark py3 visualize test as flapping
Douglas Bagnall [Sun, 9 Sep 2018 22:08:41 +0000 (10:08 +1200)]
selftext: Mark py3 visualize test as flapping

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Sep 10 16:51:09 CEST 2018 on sn-devel-144

5 years agos4: torture: Ensure raw notify tests use different directories.
Jeremy Allison [Fri, 7 Sep 2018 22:14:37 +0000 (15:14 -0700)]
s4: torture: Ensure raw notify tests use different directories.

Should help track down flapping tests.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Sep  8 11:37:44 CEST 2018 on sn-devel-144

5 years agolib/replace: force to unset defines if check has failed
Alexander Bokovoy [Thu, 6 Sep 2018 09:07:28 +0000 (09:07 +0000)]
lib/replace: force to unset defines if check has failed

For HAVE_WORKING_STRPTIME and HAVE_INCOHERENT_MMAP we always want to
have their defines unset as the code is using '#ifdef' rather than just
'#if'. Setting them to 0 means #ifdef will succeed due to a difference
how '#ifdef' and '#if' are working.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agowafsamba/samba_autoconf: when setting undefined result, use empty tuple
Alexander Bokovoy [Thu, 6 Sep 2018 07:51:00 +0000 (07:51 +0000)]
wafsamba/samba_autoconf: when setting undefined result, use empty tuple

A difference between waf 1.x and 2.x is that we gained 0 as an undefined
variable in the cache file. This does not allow to differentiate unset
and set to 0 defines.

Force to use empty tuple () to signify unset defines.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agospoolss-iremotewinspool-tests: Use more recent client OS version
Justin Stephenson [Fri, 31 Aug 2018 19:28:36 +0000 (15:28 -0400)]
spoolss-iremotewinspool-tests: Use more recent client OS version

Set torture test client info build, major, and minor
version numbers to Windows 7 and Windows Server 2008 R2 values

 buildnum: 7007
 major: 6
 minor: 1

Build number taken from
 [MS-RPRN] <168> Section 2.2.3.10.1

Major/Minor numbers taken from
 https://docs.microsoft.com/en-us/windows/desktop/sysinfo/operating-system-version

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Sep  8 04:35:56 CEST 2018 on sn-devel-144

5 years agoiremotewinspool-tests: Add client os build number validation test
Justin Stephenson [Wed, 22 Aug 2018 17:23:18 +0000 (13:23 -0400)]
iremotewinspool-tests: Add client os build number validation test

Add test validating the AsyncOpenPrinter result based on the provided
client info build number

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoiremotewinspool-tests: Allow modification of OS client version information
Justin Stephenson [Wed, 15 Aug 2018 15:10:21 +0000 (11:10 -0400)]
iremotewinspool-tests: Allow modification of OS client version information

Add test_get_client_info() function to set and, or modify the client OS
version values advertised in the iremotewinspool torture tests.

The OS build numbers are used from the table in:

  [MS-RPRN] <168> Section 2.2.3.10.1

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos3-rpcclient: Use spoolss_init_spoolss_UserLevel1 in winspool cmds
Günther Deschner [Fri, 31 Aug 2018 16:22:04 +0000 (18:22 +0200)]
s3-rpcclient: Use spoolss_init_spoolss_UserLevel1 in winspool cmds

Use spoolss initialization function to set client version information for
iremotewinspool printer operations

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos3-rpc_client: Advertise Windows 7 client info
Justin Stephenson [Fri, 31 Aug 2018 17:28:58 +0000 (13:28 -0400)]
s3-rpc_client: Advertise Windows 7 client info

Client printing operations currently fail against Windows
Server 2016 with Access Denied if a client os build number
lower than 6000 is advertised. Increase the default build number,
major, and minor versions to values associated with client
OS versoins Windows 7 and Windows Server 2008 R2.

The build number value specifically needs to be increased to
allow these operations to succeed.

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

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos3-spoolss: Make spoolss client os_major,os_minor and os_build configurable.
Günther Deschner [Fri, 31 Aug 2018 15:36:19 +0000 (17:36 +0200)]
s3-spoolss: Make spoolss client os_major,os_minor and os_build configurable.

Similar to spoolss server options, make the client advertised OS version
values configurable to allow overriding the defaults provided to the print server.

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowafsamba: Fix 'make -j<jobs>'
Andreas Schneider [Thu, 6 Sep 2018 10:40:10 +0000 (12:40 +0200)]
wafsamba: Fix 'make -j<jobs>'

Currently only 'make -j' enables parallel builds and e.g. 'make -j4'
results in no parallel compile jobs at all.

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

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 Sep  7 20:24:46 CEST 2018 on sn-devel-144

5 years agoctdb-tests: Fix CTDB -O3 --picky-developer build on CentOS 7
Martin Schwenke [Thu, 6 Sep 2018 06:06:40 +0000 (16:06 +1000)]
ctdb-tests: Fix CTDB -O3 --picky-developer build on CentOS 7

gcc 4.8.5 complains:

[319/381] Compiling ctdb/tests/src/system_socket_test.c
../tests/src/system_socket_test.c: In function ‘test_tcp’:
../tests/src/system_socket_test.c:196:20: error: ‘rst_out’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  assert((rst != 0) == (rst_out != 0));
                    ^
cc1: all warnings being treated as errors

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agodbwrap: Remove a pointless "return;"
Volker Lendecke [Fri, 31 Aug 2018 04:09:48 +0000 (06:09 +0200)]
dbwrap: Remove a pointless "return;"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agovfs_fruit: fix an uninitialized variable error
Volker Lendecke [Wed, 5 Sep 2018 09:31:10 +0000 (11:31 +0200)]
vfs_fruit: fix an uninitialized variable error

clang does not recognize "smb_panic" as an "exit()" equivalent

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Simplify logic in remove_stale_share_mode_entries
Volker Lendecke [Mon, 30 Jul 2018 11:21:26 +0000 (13:21 +0200)]
smbd: Simplify logic in remove_stale_share_mode_entries

To me, an early "continue" is easier to follow than a "else".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Simplify share_mode_stale_pid
Volker Lendecke [Mon, 30 Jul 2018 11:03:17 +0000 (13:03 +0200)]
smbd: Simplify share_mode_stale_pid

This loop does not need to count valid share modes. A single valid one
is sufficient for keeping the delete token around

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Simplify lease_match() a bit
Volker Lendecke [Fri, 27 Jul 2018 12:16:20 +0000 (14:16 +0200)]
smbd: Simplify lease_match() a bit

This has been implicitly initialized to 0 with the explicit struct
initializer above.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Simplify logic in fsp_lease_update
Volker Lendecke [Thu, 26 Jul 2018 13:46:18 +0000 (15:46 +0200)]
smbd: Simplify logic in fsp_lease_update

One if-condition is better than two

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Simplify logic in smb2_lease_break_send
Volker Lendecke [Thu, 26 Jul 2018 12:52:55 +0000 (14:52 +0200)]
smbd: Simplify logic in smb2_lease_break_send

If/else if chains are hard to follow to me. Simplify the code by using
early returns.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Factor out file_has_read_oplocks()
Volker Lendecke [Thu, 26 Jul 2018 10:35:30 +0000 (12:35 +0200)]
smbd: Factor out file_has_read_oplocks()

Why? This makes it clearer to me that we're not interested in the actual
number of read oplocks. We only want to know if there are any read
oplocks at all.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:lib: Rename server_contexts to global_contexts
Christof Schmitt [Tue, 21 Aug 2018 20:08:42 +0000 (13:08 -0700)]
s3:lib: Rename server_contexts to global_contexts

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:lib/server_contexts: Rename variables
Christof Schmitt [Tue, 21 Aug 2018 18:18:08 +0000 (11:18 -0700)]
s3:lib/server_contexts: Rename variables

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: Rename server_messaging_context() to global_messaging_context()
Christof Schmitt [Tue, 21 Aug 2018 18:09:16 +0000 (11:09 -0700)]
s3: Rename server_messaging_context() to global_messaging_context()

This reflects that the messaging context is also used outside of the
server processes.

The command used for the rename:
find . -name '*.[hc]' -print0 | xargs -0 sed -i 's/server_messaging_context/global_messaging_context/'

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: Rename server_event_context() to global_event_context()
Christof Schmitt [Tue, 21 Aug 2018 18:06:16 +0000 (11:06 -0700)]
s3: Rename server_event_context() to global_event_context()

This reflects that the event context is also used outside of the server
processes.

The command used for the rename:
find . -name '*.[hc]' -print0 | xargs -0 sed -i 's/server_event_context/global_event_context/'

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoexamples: Fix the smb2mount build
Volker Lendecke [Fri, 7 Sep 2018 05:27:46 +0000 (07:27 +0200)]
examples: Fix the smb2mount build

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbget: Use cmdline_messaging_context
Christof Schmitt [Tue, 21 Aug 2018 23:11:02 +0000 (16:11 -0700)]
s3:smbget: Use cmdline_messaging_context

Initialize the messaging context through cmdline_messaging_context to
allow access to config in clustered Samba.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbcontrol: Use cmdline_messaging_context
Christof Schmitt [Tue, 21 Aug 2018 19:35:11 +0000 (12:35 -0700)]
s3:smbcontrol: Use cmdline_messaging_context

Initialize the messaging context through cmdline_messaging_context to
allow access to config in clustered Samba.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:dbwrap_tool: Use cmdline_messaging_context
Christof Schmitt [Tue, 21 Aug 2018 19:34:34 +0000 (12:34 -0700)]
s3:dbwrap_tool: Use cmdline_messaging_context

Initialize the messaging context through cmdline_messaging_context to
allow access to config in clustered Samba.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:eventlogadm: Use cmdline_messaging_context
Christof Schmitt [Mon, 20 Aug 2018 23:21:51 +0000 (16:21 -0700)]
s3:eventlogadm: Use cmdline_messaging_context

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: ntlm_auth: Use cmdline_messaging_context
Christof Schmitt [Mon, 20 Aug 2018 23:18:20 +0000 (16:18 -0700)]
s3: ntlm_auth: Use cmdline_messaging_context

Call cmdline_messaging_context to initialize the messaging context
before accessing clustered Samba config.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:sharesec: Use cmdline_messaging_context
Christof Schmitt [Mon, 20 Aug 2018 23:15:02 +0000 (16:15 -0700)]
s3:sharesec: Use cmdline_messaging_context

Call cmdline_messasging_context to initialize messaging context before
accessing clustered Samba config.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:testparm: Use cmdline_messaging_context
Christof Schmitt [Mon, 20 Aug 2018 23:11:11 +0000 (16:11 -0700)]
s3:testparm: Use cmdline_messaging_context

Call cmdline_messaging_context to initialize a messaging config before
accessing clustered Samba config.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:pdbedit: Use cmdline_messaging_context
Christof Schmitt [Mon, 20 Aug 2018 23:08:21 +0000 (16:08 -0700)]
s3:pdbedit: Use cmdline_messaging_context

Initialize the messaging context through cmdline_messaging_context to
allow access to config in clustered Samba.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:messaging: remove unused messaging_init_client()
Ralph Boehme [Tue, 10 Jul 2018 14:29:46 +0000 (16:29 +0200)]
s3:messaging: remove unused messaging_init_client()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
5 years agos3:net: Use cmdline_messaging_context
Christof Schmitt [Mon, 20 Aug 2018 23:01:00 +0000 (16:01 -0700)]
s3:net: Use cmdline_messaging_context

Use cmdline_messaging_context with its error checking instead of open
coding the same steps.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agorpcclient: Use cmdline_messaging_context
Christof Schmitt [Mon, 20 Aug 2018 22:54:11 +0000 (15:54 -0700)]
rpcclient: Use cmdline_messaging_context

Use cmdline_messaging_context with its error checking instead of open
coding the same steps.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbstatus: Use cmdline_messaging_context
Christof Schmitt [Mon, 20 Aug 2018 22:46:27 +0000 (15:46 -0700)]
s3:smbstatus: Use cmdline_messaging_context

Use cmdline_messaging_context to initialize a messaging context instead
of open coding the same steps.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbpasswd: Use cmdline_messaging_context
Christof Schmitt [Mon, 20 Aug 2018 22:38:33 +0000 (15:38 -0700)]
s3:smbpasswd: Use cmdline_messaging_context

smbpasswd does not use POPT_CREDENTIALS. Call cmdline_messaging_context
to initialize a messaging_context with proper error checking before
calling lp_load_global.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agotest:doc: Skip 'clustering=yes'
Christof Schmitt [Tue, 21 Aug 2018 21:58:01 +0000 (14:58 -0700)]
test:doc: Skip 'clustering=yes'

As testparm will error out when running clustering=yes as non-root, skip
this step to avoid a test failure.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:popt_common: use cmdline_messaging_context() in popt_common_credentials_callback()
Ralph Boehme [Tue, 10 Jul 2018 13:26:40 +0000 (15:26 +0200)]
s3:popt_common: use cmdline_messaging_context() in popt_common_credentials_callback()

This adds a call to cmdline_messaging_context() to the popt
popt_common_credentials_callback() hook and ensures that any client tool
that uses POPT_COMMON_CREDENTIALS gets an implicit messaging context,
ensuring it doesn't crash in the subsequent lp_load_client() with
include=registry in a cluster.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
5 years agoselftest: pass configfile to pdbedit
Ralph Boehme [Tue, 10 Jul 2018 08:38:10 +0000 (10:38 +0200)]
selftest: pass configfile to pdbedit

This is needed otherwise pdbedit fails to initialize messaging in
autobuild.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>