metze/samba/wip.git
5 years agoRevert "s3:smb2_lock: pass in_lock_sequence to smbd_smb2_lock_send()"
Stefan Metzmacher [Mon, 13 Aug 2018 15:29:38 +0000 (17:29 +0200)]
Revert "s3:smb2_lock: pass in_lock_sequence to smbd_smb2_lock_send()"

This reverts commit 15a96df54a351516f6e00d5ae46e961452c5b69a.

5 years agoRevert "TODO test pidl/ServerNDR: ignore functions marked as "todo""
Stefan Metzmacher [Mon, 12 Nov 2012 09:23:17 +0000 (10:23 +0100)]
Revert "TODO test pidl/ServerNDR: ignore functions marked as "todo""

This reverts commit 76e32fa6f74d12b64ac731b558b9bdae67dcb019.

5 years agoRevert "dir ~NTCREATEX_SHARE_ACCESS_DELETE"
Stefan Metzmacher [Thu, 1 Nov 2012 15:20:45 +0000 (16:20 +0100)]
Revert "dir ~NTCREATEX_SHARE_ACCESS_DELETE"

This reverts commit bed7b5171fad319e3b58f70d1a510dce68c1bdd8.

5 years agoTODO test pidl/ServerNDR: ignore functions marked as "todo"
Stefan Metzmacher [Sun, 4 Nov 2012 16:22:31 +0000 (17:22 +0100)]
TODO test pidl/ServerNDR: ignore functions marked as "todo"

5 years agoTODO smb2_tcon: add some share flags/capabilities options (Default:off)
Stefan Metzmacher [Tue, 31 Jul 2012 06:55:20 +0000 (08:55 +0200)]
TODO smb2_tcon: add some share flags/capabilities options (Default:off)

5 years agos3:smb2_lock: pass in_lock_sequence to smbd_smb2_lock_send()
Stefan Metzmacher [Wed, 24 Oct 2012 12:53:05 +0000 (14:53 +0200)]
s3:smb2_lock: pass in_lock_sequence to smbd_smb2_lock_send()

Take the value from the client if the dialect is SMB2_10 or higher,
otherwise default to 0.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smbXsrv_open: initialize smbXsrv_open_global->lock_sequence_array with 0xFF
Stefan Metzmacher [Wed, 24 Oct 2012 13:17:56 +0000 (15:17 +0200)]
s3:smbXsrv_open: initialize smbXsrv_open_global->lock_sequence_array with 0xFF

This does not match the current documentation, but is very likely the
right thing to do.

If we would match the documentation and initialize with 0x00,
we would return STATUS_SUCCESS without doing any locks.
If the client also follows the documentation and starts
with a lock_sequence of 0 for the first operation.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
5 years agoRevert "oplock..."
Stefan Metzmacher [Sun, 4 Nov 2012 15:58:16 +0000 (16:58 +0100)]
Revert "oplock..."

This reverts commit 143a2d1b6ee978c1fdf21a30804e7fedef0c1bd5.

5 years agooplock...
Stefan Metzmacher [Thu, 4 Oct 2012 21:17:48 +0000 (23:17 +0200)]
oplock...

5 years agosmbd-adm
Stefan Metzmacher [Tue, 20 Sep 2011 22:04:00 +0000 (00:04 +0200)]
smbd-adm

5 years agosmbd-adm
Stefan Metzmacher [Tue, 20 Sep 2011 21:03:19 +0000 (23:03 +0200)]
smbd-adm

5 years agoHACK: add smbd-adm.txt
Stefan Metzmacher [Tue, 5 Jul 2011 14:25:39 +0000 (16:25 +0200)]
HACK: add smbd-adm.txt

5 years agoRevert "TODO: all ncs..."
Stefan Metzmacher [Mon, 17 Sep 2012 16:04:23 +0000 (18:04 +0200)]
Revert "TODO: all ncs..."

This reverts commit 2c2a8c860f91e8fa5cccb9eb561f17aa3e9f9ea1.

5 years agoTODO: all ncs...
Stefan Metzmacher [Mon, 10 Sep 2012 12:24:39 +0000 (14:24 +0200)]
TODO: all ncs...

5 years agoRevert "s4 fix it?"
Stefan Metzmacher [Thu, 9 Aug 2012 11:17:07 +0000 (13:17 +0200)]
Revert "s4 fix it?"

This reverts commit ecbc6e081d37b4936f750b9b958f13c9b5ae3325.

5 years agoRevert "HACK pass s4 create_action..."
Michael Adam [Thu, 9 Aug 2012 10:21:36 +0000 (12:21 +0200)]
Revert "HACK pass s4 create_action..."

This reverts commit 8b4880e53acedc2d3b6734c43154ed5be216e1f2.

5 years agoHACK pass s4 create_action...
Michael Adam [Thu, 9 Aug 2012 10:18:14 +0000 (12:18 +0200)]
HACK pass s4 create_action...

5 years agos4 fix it?
Michael Adam [Wed, 8 Aug 2012 15:32:01 +0000 (17:32 +0200)]
s4 fix it?

5 years agoRevert "09b - TODO: allow durable with delete_on_close in vfswrap_default_durable_dis...
Stefan Metzmacher [Fri, 7 Sep 2012 13:29:03 +0000 (15:29 +0200)]
Revert "09b - TODO: allow durable with delete_on_close in vfswrap_default_durable_disconnect"

This reverts commit a13f5015e750eb59336018d854c42306dab85cd6.

5 years agoRevert "TODO smbXsrv_open_global idl: add persistent"
Stefan Metzmacher [Fri, 7 Sep 2012 13:28:38 +0000 (15:28 +0200)]
Revert "TODO smbXsrv_open_global idl: add persistent"

This reverts commit 85bf07a0444108c8d0f83ca53a3798b12f0109da.

5 years agoRevert "TODO smb2_tcon: add some share flags/capabilities options (Default:off)"
Stefan Metzmacher [Fri, 7 Sep 2012 13:28:19 +0000 (15:28 +0200)]
Revert "TODO smb2_tcon: add some share flags/capabilities options (Default:off)"

This reverts commit 9fb1b5025fe779f8664a44cb6490d1db6e2cdbcf.

5 years agoRevert "BROKEN: TODO smbXsrv_open infra: add "file_name/path_name/share_name = <TODO...
Stefan Metzmacher [Mon, 13 Aug 2018 14:25:27 +0000 (16:25 +0200)]
Revert "BROKEN: TODO smbXsrv_open infra: add "file_name/path_name/share_name = <TODO>" and DEBUG"

This reverts commit b0e1f4b2cb160211fffc1800f8309b40d8d9dcb2.

5 years agoRevert "HACK debug replay/channel_sequence"
Stefan Metzmacher [Sat, 22 Sep 2012 19:52:13 +0000 (21:52 +0200)]
Revert "HACK debug replay/channel_sequence"

This reverts commit 46ce191a9bf9321251ea601a9b3ba7b48c5d5ccb.

5 years agoRevert "HACK disconnect after 2 writes"
Stefan Metzmacher [Thu, 26 Jul 2012 06:23:33 +0000 (08:23 +0200)]
Revert "HACK disconnect after 2 writes"

This reverts commit eaa7023f865be73483a99ff203d1dbfb3e180ef9.

5 years agoHACK disconnect after 2 writes
Stefan Metzmacher [Thu, 26 Jul 2012 06:23:10 +0000 (08:23 +0200)]
HACK disconnect after 2 writes

5 years agoHACK debug replay/channel_sequence
Stefan Metzmacher [Thu, 26 Jul 2012 06:22:01 +0000 (08:22 +0200)]
HACK debug replay/channel_sequence

5 years agoBROKEN: TODO smbXsrv_open infra: add "file_name/path_name/share_name = <TODO>" and...
Stefan Metzmacher [Thu, 28 Jun 2012 14:06:23 +0000 (16:06 +0200)]
BROKEN: TODO smbXsrv_open infra: add "file_name/path_name/share_name = <TODO>" and DEBUG

was 55159a5499d4341d601b38d1e03bff7280053343

5 years agoTODO smb2_tcon: add some share flags/capabilities options (Default:off)
Stefan Metzmacher [Tue, 31 Jul 2012 06:55:20 +0000 (08:55 +0200)]
TODO smb2_tcon: add some share flags/capabilities options (Default:off)

5 years agoTODO smbXsrv_open_global idl: add persistent
Stefan Metzmacher [Sat, 30 Jun 2012 10:31:28 +0000 (12:31 +0200)]
TODO smbXsrv_open_global idl: add persistent

MAYBE squash with "smbXsrv_open_global idl: add more SMB 2.10/3.00 stuff TODO: more"

5 years ago09b - TODO: allow durable with delete_on_close in vfswrap_default_durable_disconnect
Michael Adam [Tue, 7 Aug 2012 13:59:12 +0000 (15:59 +0200)]
09b - TODO: allow durable with delete_on_close in vfswrap_default_durable_disconnect

5 years agoRevert "TODO later? smbXsrv_open_close_all"
Stefan Metzmacher [Mon, 18 Jun 2012 11:32:29 +0000 (13:32 +0200)]
Revert "TODO later? smbXsrv_open_close_all"

This reverts commit be146b939400dda6d2ec5b77d9f6224ce6363927.

5 years agoTODO later? smbXsrv_open_close_all
Stefan Metzmacher [Mon, 18 Jun 2012 11:27:19 +0000 (13:27 +0200)]
TODO later? smbXsrv_open_close_all

5 years agoTODO: add server-id-disconnected.txt
Michael Adam [Mon, 6 Aug 2012 14:17:07 +0000 (16:17 +0200)]
TODO: add server-id-disconnected.txt

5 years agoTODO.durable
Michael Adam [Fri, 29 Jun 2012 14:17:19 +0000 (16:17 +0200)]
TODO.durable

5 years agoadd questions.txt
Michael Adam [Thu, 7 Jun 2012 14:32:10 +0000 (16:32 +0200)]
add questions.txt

5 years agodurable.txt
Stefan Metzmacher [Thu, 31 May 2012 07:45:16 +0000 (09:45 +0200)]
durable.txt

5 years agoconnection_struct.txt
Stefan Metzmacher [Fri, 25 May 2012 09:48:27 +0000 (11:48 +0200)]
connection_struct.txt

5 years agocmd.txt
Stefan Metzmacher [Sat, 16 Jun 2012 10:28:46 +0000 (12:28 +0200)]
cmd.txt

5 years agodo_out.sh
Stefan Metzmacher [Wed, 6 Jun 2012 10:02:38 +0000 (12:02 +0200)]
do_out.sh

5 years agoRevert "TODO make sure the gid doesn't belong to a user s3:passdb: return ID_TYPE_BOT...
Stefan Metzmacher [Mon, 3 Dec 2012 07:28:26 +0000 (08:28 +0100)]
Revert "TODO make sure the gid doesn't belong to a user s3:passdb: return ID_TYPE_BOTH for builtin and wellknown sids from pdb_default_sid_to_id()"

This reverts commit affad381e7baff28550f5097711235e3ca041596.

5 years agoRevert "TODO(richtig so? - oder auch user?) s3:passdb: set ID_TYPE_BOTH for groups...
Stefan Metzmacher [Mon, 3 Dec 2012 07:28:20 +0000 (08:28 +0100)]
Revert "TODO(richtig so? - oder auch user?) s3:passdb: set ID_TYPE_BOTH for groups from own sam in pdb_defaul_sid_to_id()"

This reverts commit e2becf56263e1d6b168be6a38ea436425e4a48e8.

5 years agoTODO(richtig so? - oder auch user?) s3:passdb: set ID_TYPE_BOTH for groups from own...
Michael Adam [Mon, 3 Dec 2012 00:50:24 +0000 (01:50 +0100)]
TODO(richtig so? - oder auch user?) s3:passdb: set ID_TYPE_BOTH for groups from own sam in pdb_defaul_sid_to_id()

This way, one can set groups as file owners.

Signed-off-by: Michael Adam <obnox@samba.org>
5 years agoTODO make sure the gid doesn't belong to a user s3:passdb: return ID_TYPE_BOTH for...
Michael Adam [Mon, 3 Dec 2012 00:48:15 +0000 (01:48 +0100)]
TODO make sure the gid doesn't belong to a user s3:passdb: return ID_TYPE_BOTH for builtin and wellknown sids from pdb_default_sid_to_id()

This allows e.g. for BUILTIN\\administrators to be taken as file owner (user).

Signed-off-by: Michael Adam <obnox@samba.org>
5 years agos3:registry: Fix possible memory leak in _reg_perfcount_multi_sz_from_tdb()
Andreas Schneider [Thu, 9 Aug 2018 14:15:10 +0000 (16:15 +0200)]
s3:registry: Fix possible memory leak in _reg_perfcount_multi_sz_from_tdb()

Found by covscan.

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

Pair-Programmed-With: Justin Stephenson <jstephen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug 11 04:43:15 CEST 2018 on sn-devel-144

5 years agos3:libads: Fix memory leaks in ads_krb5_chg_password()
Andreas Schneider [Thu, 9 Aug 2018 14:02:16 +0000 (16:02 +0200)]
s3:libads: Fix memory leaks in ads_krb5_chg_password()

Found by covscan.

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

Pair-Programmed-With: Justin Stephenson <jstephen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:client: Avoid a possible fd leak in do_get()
Andreas Schneider [Thu, 9 Aug 2018 13:58:32 +0000 (15:58 +0200)]
s3:client: Avoid a possible fd leak in do_get()

Found by covscan.

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

Pair-Programmed-With: Justin Stephenson <jstephen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4:lib: Fix a possible fd leak in gp_get_file()
Andreas Schneider [Thu, 9 Aug 2018 14:42:43 +0000 (16:42 +0200)]
s4:lib: Fix a possible fd leak in gp_get_file()

Found by covscan.

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

Pair-Programmed-With: Justin Stephenson <jstephen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:utils: Do not leak memory in new_user()
Andreas Schneider [Thu, 9 Aug 2018 14:30:03 +0000 (16:30 +0200)]
s3:utils: Do not leak memory in new_user()

Found by covscan.

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

Pair-Programmed-With: Justin Stephenson <jstephen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:utils: Do not overflow the destination buffer in net_idmap_restore()
Andreas Schneider [Thu, 9 Aug 2018 14:19:48 +0000 (16:19 +0200)]
s3:utils: Do not overflow the destination buffer in net_idmap_restore()

Found by covsan.

error[invalidScanfFormatWidth]: Width 128 given in format string (no. 2)
is larger than destination buffer 'sid_string[128]', use %127s to
prevent overflowing it.

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

Pair-Programmed-With: Justin Stephenson <jstephen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:passdb: Don't leak memory on error in fetch_ldap_pw()
Andreas Schneider [Thu, 9 Aug 2018 14:05:41 +0000 (16:05 +0200)]
s3:passdb: Don't leak memory on error in fetch_ldap_pw()

Found by covscan.

A candidate to use tallac ...

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

Pair-Programmed-With: Justin Stephenson <jstephen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowbinfo: Free memory when we leave wbinfo_dsgetdcname()
Andreas Schneider [Thu, 9 Aug 2018 13:53:45 +0000 (15:53 +0200)]
wbinfo: Free memory when we leave wbinfo_dsgetdcname()

Found by covscan.

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

Pair-Programmed-With: Justin Stephenson <jstephen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: tests: smbclient. Regression test to ensure we get NT_STATUS_DIRECTORY_NOT_EMPTY...
Jeremy Allison [Thu, 9 Aug 2018 17:02:26 +0000 (10:02 -0700)]
s3: tests: smbclient. Regression test to ensure we get NT_STATUS_DIRECTORY_NOT_EMPTY on rmdir.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 10 21:08:14 CEST 2018 on sn-devel-144

5 years agos4/torture: Add new test for DELETE_ON_CLOSE on non-empty directories
Anoop C S [Thu, 9 Aug 2018 14:32:05 +0000 (20:02 +0530)]
s4/torture: Add new test for DELETE_ON_CLOSE on non-empty directories

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

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos3/libsmb: Explicitly set delete_on_close token for rmdir
Anoop C S [Thu, 9 Aug 2018 06:58:41 +0000 (12:28 +0530)]
s3/libsmb: Explicitly set delete_on_close token for rmdir

The current implementation of `rmdir` hopes to get the directory deleted
on closing last open handle when FILE_DELETE_ON_CLOSE is set on it. But
for non-empty directories Windows doesn't error out during an open call.
Following that we internally refuse to set initial delete_on_close while
opening a non-empty directory. This prevents us from trying to delete
the directory when last open handle is closed.

Instead of relying on FILE_DELETE_ON_CLOSE during an open we explicitly
set delete_on_close token on directory handle once it is available. This
ensures that NT_STATUS_DIRECTORY_NOT_EMPTY is returned for `rmdir` on
non-empty directories while closing open directory handle.

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

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agosamba-tool drs showrepl tests: improve debugging for mystery error
Douglas Bagnall [Fri, 10 Aug 2018 04:11:58 +0000 (16:11 +1200)]
samba-tool drs showrepl tests: improve debugging for mystery error

Under some circumstances the samba-tool command is failing with no
stdout output at all, leaving few clues in the logs.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Aug 10 09:27:03 CEST 2018 on sn-devel-144

5 years agoprovision: Add support for BIND 9.12.x
Amitay Isaacs [Wed, 8 Aug 2018 09:44:38 +0000 (19:44 +1000)]
provision: Add support for BIND 9.12.x

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 10 05:36:19 CEST 2018 on sn-devel-144

5 years agodlz-bind: Add support for BIND 9.12.x
Amitay Isaacs [Wed, 8 Aug 2018 09:43:03 +0000 (19:43 +1000)]
dlz-bind: Add support for BIND 9.12.x

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3/smbd: Ensure quota code is only called when quota support detected
Noel Power [Tue, 7 Aug 2018 10:06:34 +0000 (11:06 +0100)]
s3/smbd: Ensure quota code is only called when quota support detected

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 10 02:43:33 CEST 2018 on sn-devel-144

5 years agolib: Add support to parse MS Catalog files
Andreas Schneider [Tue, 20 Dec 2016 07:52:14 +0000 (08:52 +0100)]
lib: Add support to parse MS Catalog files

Signed-off-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Aug  9 19:57:02 CEST 2018 on sn-devel-144

5 years agoctdb: add expiry test for ctdb_mutex_ceph_rados_helper
David Disseldorp [Fri, 20 Jul 2018 15:20:08 +0000 (17:20 +0200)]
ctdb: add expiry test for ctdb_mutex_ceph_rados_helper

Kill the ctdb_mutex_ceph_rados_helper with SIGKILL and then confirm
that the lock is automatically released following expiry.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Aug  9 16:26:36 CEST 2018 on sn-devel-144

5 years agoctdb_mutex_ceph_rados_helper: fix deadlock via lock renewals
David Disseldorp [Thu, 19 Jul 2018 09:55:23 +0000 (11:55 +0200)]
ctdb_mutex_ceph_rados_helper: fix deadlock via lock renewals

RADOS locks without expiry persist indefinitely. This results in CTDB
deadlock during failover if the recovery master dies unexpectedly, as
subsequently elected recovery master nodes can't obtain the recovery
lock.
Avoid deadlock by using a lock expiration time (10s by default), and
renewing it periodically.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb_mutex_ceph_rados_helper: rename timer_ev to ppid_timer_ev
David Disseldorp [Tue, 17 Jul 2018 21:36:36 +0000 (23:36 +0200)]
ctdb_mutex_ceph_rados_helper: rename timer_ev to ppid_timer_ev

In preparation for adding a lock refresh timer.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb_mutex_ceph_rados_helper: use talloc destructor for cleanup
David Disseldorp [Thu, 19 Jul 2018 16:46:27 +0000 (18:46 +0200)]
ctdb_mutex_ceph_rados_helper: use talloc destructor for cleanup

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb_mutex_ceph_rados_helper: Set SIGINT signal handler
Samuel Cabrero [Fri, 15 Jun 2018 16:15:53 +0000 (18:15 +0200)]
ctdb_mutex_ceph_rados_helper: Set SIGINT signal handler

Set a handler for SIGINT to release the lock.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb/build: link ctdb_mutex_ceph_rados_helper against ceph-common
David Disseldorp [Mon, 9 Jul 2018 12:53:00 +0000 (14:53 +0200)]
ctdb/build: link ctdb_mutex_ceph_rados_helper against ceph-common

ceph-common linkage is needed with new versions of Ceph.
Also respect the --libcephfs_dir=<path> parameter when provided.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoShorten description in vfs_linux_xfs_sgid manual
Justin Stephenson [Mon, 6 Aug 2018 15:24:18 +0000 (11:24 -0400)]
Shorten description in vfs_linux_xfs_sgid manual

this fixes a lexgrog parse error, the NAME subheader description
of the vfs_linux_xfs_sgid(8) manual was too long, this will shorten
the description and allow it to be correctly detected by mandb.

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

Signed-off-by: Justin Stephenson <jstephen@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): Thu Aug  9 04:06:17 CEST 2018 on sn-devel-144

5 years agos3/locking: Corrections and improvements to inline comments
Anoop C S [Fri, 3 Aug 2018 06:21:25 +0000 (11:51 +0530)]
s3/locking: Corrections and improvements to inline comments

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
5 years agolibsmb: Fix CID 1438243 Unchecked return value
Volker Lendecke [Wed, 8 Aug 2018 08:14:26 +0000 (10:14 +0200)]
libsmb: Fix CID 1438243 Unchecked return value

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 Aug  8 23:10:22 CEST 2018 on sn-devel-144

5 years agolibsmb: Fix CID 1438244 Unsigned compared against 0
Volker Lendecke [Wed, 8 Aug 2018 08:08:38 +0000 (10:08 +0200)]
libsmb: Fix CID 1438244 Unsigned compared against 0

ndr_size_dom_sid returns a size_t, so that can't be <0. Also, the only
case that ndr_size_dom_sid returns 0 is a NULL sid
pointer. ndr_size_dom_sid can reasonably be assumed to not overflow, the
number of sub-auths is a uint8. That times 4 plus 8 always fits into a
size_t.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Fix CID 1438245 Dereference before null check
Volker Lendecke [Tue, 7 Aug 2018 20:50:52 +0000 (22:50 +0200)]
smbd: Fix CID 1438245 Dereference before null check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Fix CID 1438246 Unchecked return value
Volker Lendecke [Tue, 7 Aug 2018 20:49:16 +0000 (22:49 +0200)]
smbd: Fix CID 1438246 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Align integer types
Volker Lendecke [Tue, 7 Aug 2018 20:48:58 +0000 (22:48 +0200)]
smbd: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:waf: Install eventlogadm to /usr/sbin
Andreas Schneider [Mon, 6 Aug 2018 15:32:17 +0000 (17:32 +0200)]
s3:waf: Install eventlogadm to /usr/sbin

The eventlogadm binary needs write access to the registry which, by
default, is only possible as root.

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

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): Tue Aug  7 01:49:34 CEST 2018 on sn-devel-144

5 years agoctdb: remove queue destructor as it isn't needed anymore
Swen Schillig [Mon, 12 Mar 2018 10:00:55 +0000 (11:00 +0100)]
ctdb: remove queue destructor as it isn't needed anymore

After

commit e097b7f8ff1a9992de1d11474dac4969e30cd679
Author: David Disseldorp <ddiss@suse.de>
Date:   Sun Jul 31 03:14:54 2011 +0200

    io: Make queue_io_read() safe for reentry

the destructor has no purpose anymore, therfore, remove it.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Aug  6 11:37:32 CEST 2018 on sn-devel-144

5 years agoMinor, really small, documentation fix.
Richard Sharpe [Fri, 2 Feb 2018 03:31:46 +0000 (19:31 -0800)]
Minor, really small, documentation fix.

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoselftest: offline backup restore target
Aaron Haslett [Mon, 23 Jul 2018 03:20:03 +0000 (15:20 +1200)]
selftest: offline backup restore target

This is a selftest target built from a restored offline backup.
Other backup routines are modified to remove the assumption that every backup
requires server and credentials arguments, since offline backup doesn't
want them.  Also, prepare_dc_testenv now returns the generated ctx so we can
run or re-run routines that require it later.

Signed-off-by: Aaron Haslett <aaron.haslett@catalyst.net.nz>
Reviewed-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): Mon Aug  6 08:45:19 CEST 2018 on sn-devel-144

5 years agonetcmd: domain backup offline command - offline test with ldapcmp
Aaron Haslett [Mon, 30 Apr 2018 23:10:31 +0000 (11:10 +1200)]
netcmd: domain backup offline command - offline test with ldapcmp

This test checks that when you do an offline backup and restore or untar it,
the restored database is the same as the original.  Test is repeated for
'mdb' and 'tdb' database backends.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agotests: New offline backup tests with tweaks to old online classes
Tim Beale [Thu, 12 Jul 2018 02:34:56 +0000 (14:34 +1200)]
tests: New offline backup tests with tweaks to old online classes

Offline backups have a slightly different syntax, as they don't take the
server or user-creds parameters. In the untar case, the offline backup
will actually have the secrets present, so making asserting on this
more flexible.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agonetcmd: domain backup offline command
Aaron Haslett [Tue, 26 Jun 2018 01:47:42 +0000 (13:47 +1200)]
netcmd: domain backup offline command

Unlike the existing 'domain backup online' command, this command allows an
admin to back up a local samba installation using the filesystem and the
tdbbackup tool instead of using remote protocols.  It replaces samba_backup
as that tool does not handle sam.ldb and secrets.ldb correctly.  Those two
databases need to have transactions started on them before their downstream
ldb and tdb files are backed up.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agonetcmd: Improve domain backup targetdir checks
Tim Beale [Thu, 12 Jul 2018 04:13:27 +0000 (16:13 +1200)]
netcmd: Improve domain backup targetdir checks

+ Added check that specified targetdir is actually a directory (if it
exists)
+ Deleted a redundant 'Creating targetdir' check that would never be hit
+ Move code into a separate function so we can reuse it for offline
backups (which take a different set of parameters, but still have a
targetdir)

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agotdb: test for readonly locks mode on tdbbackup command
Aaron Haslett [Mon, 30 Jul 2018 22:07:53 +0000 (10:07 +1200)]
tdb: test for readonly locks mode on tdbbackup command

Simple bash test for readonly locks on tdbbackup:
1. Running tdbbackup on a database with and without readonly locks enabled.
2. Dump both backups and original.
3. Check all three dumps match.

A binary sample_tdb.tdb file is included for the test because the existing
sample tdbs in lib/tdb/test are either corrupt or empty.

Signed-off-by: Aaron Haslett <aaron.haslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agotdb: adding readonly locks mode to tdbbackup tool
Aaron Haslett [Mon, 30 Apr 2018 23:10:43 +0000 (11:10 +1200)]
tdb: adding readonly locks mode to tdbbackup tool

The netcmd 'domain backup offline' command will use the tdbbackup tool but
require readonly locking of tdb databases, otherwise all database access would
be blocked during a backup.  This patch adds the option.  A backup script
should use this tool with the readonly locks option after taking a transaction
lock on the target database.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agodns scavenging: Add extra tests for custom filter
Gary Lockyer [Thu, 2 Aug 2018 02:52:16 +0000 (14:52 +1200)]
dns scavenging: Add extra tests for custom filter

Add extra tests for the custom ldb filter used by the dns scavenging
code.

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 Aug  6 05:36:43 CEST 2018 on sn-devel-144

5 years agoAdd net lookup options
Justin Stephenson [Thu, 2 Aug 2018 14:17:52 +0000 (10:17 -0400)]
Add net lookup options

Add missing net lookup options to net man page

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
5 years agosystemd: Only start smb when network interfaces are up
Oleksandr Natalenko [Fri, 3 Aug 2018 12:34:47 +0000 (14:34 +0200)]
systemd: Only start smb when network interfaces are up

For smb, if the smb.conf contains explicit bindings to the network
interfaces, the service must wait till network interfaces are up,
otherwise the service won't be operational.

The 0e571054a61e commit and the BZ 13184 have fixed this for nmb and
samba, so do exactly the same here, for smb.

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

Signed-off-by: Oleksandr Natalenko <oleksandr@redhat.com>
Reviewed-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 Aug  3 17:28:52 CEST 2018 on sn-devel-144

5 years agoctdb-eventd: Fix CID 1438155
Amitay Isaacs [Tue, 31 Jul 2018 07:44:25 +0000 (17:44 +1000)]
ctdb-eventd: Fix CID 1438155

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Aug  3 11:14:01 CEST 2018 on sn-devel-144

5 years agoctdb: Fix a cut&paste error
Volker Lendecke [Tue, 31 Jul 2018 19:53:39 +0000 (21:53 +0200)]
ctdb: Fix a cut&paste error

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agos3/utils: fix regression where specifying -Unetbios/root works
Noel Power [Thu, 28 Jun 2018 15:04:24 +0000 (16:04 +0100)]
s3/utils: fix regression where specifying -Unetbios/root works

Usually you need to be root on a linux server to modify quotas. Even
with a linux server joined to a windows AD you could always log in as
local root with smbcquotas. However in recent builds this has changed.
This patch fixes this

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Jul 31 19:45:59 CEST 2018 on sn-devel-144

5 years agos3/smbd: allow set quota for non root user (when built with --enable-selftest)
Noel Power [Wed, 22 Mar 2017 20:06:13 +0000 (20:06 +0000)]
s3/smbd: allow set quota for non root user (when built with --enable-selftest)

Currently it appears you need to be root to set quotas, for test purposes
this requirement needs to be relaxed.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/script/tests: Add simple (smb1 & smb2) get/set/list tests for smbcquotas
Noel Power [Tue, 21 Mar 2017 08:29:59 +0000 (08:29 +0000)]
s3/script/tests: Add simple (smb1 & smb2) get/set/list tests for smbcquotas

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/script/test: modify existing smbcquota test to use SMB2 in addition to SMB1.
Noel Power [Wed, 8 Mar 2017 14:27:27 +0000 (14:27 +0000)]
s3/script/test: modify existing smbcquota test to use SMB2 in addition to SMB1.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/smbd: smb2 server implementation for query get/set info.
Noel Power [Fri, 26 May 2017 15:02:33 +0000 (16:02 +0100)]
s3/smbd: smb2 server implementation for query get/set info.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/smbd: adjust smb1 server to use idl structs and generated ndr push/pull funcs
Noel Power [Fri, 26 May 2017 15:01:53 +0000 (16:01 +0100)]
s3/smbd: adjust smb1 server to use idl structs and generated ndr push/pull funcs

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/libsmb: adjust smb2 code for new idl structs & generated ndr push/pull funcs.
Noel Power [Fri, 26 May 2017 14:50:18 +0000 (15:50 +0100)]
s3/libsmb: adjust smb2 code for new idl structs & generated ndr push/pull funcs.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/libsmb: adjust smb1 cli code to use idl structs and ndr push/pull funcs.
Noel Power [Fri, 26 May 2017 14:01:17 +0000 (15:01 +0100)]
s3/libsmb: adjust smb1 cli code to use idl structs and ndr push/pull funcs.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibrpc/idl Add some query [getset]info quota related structures
Noel Power [Thu, 2 Mar 2017 09:20:24 +0000 (09:20 +0000)]
librpc/idl Add some query [getset]info quota related structures

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/smbd: Don't stat when doing a quota operation (as it's a fake file)
Noel Power [Tue, 28 Feb 2017 11:36:47 +0000 (11:36 +0000)]
s3/smbd: Don't stat when doing a quota operation (as it's a fake file)

calling SMB_VFS_STAT on the quota fake file fails and caused
FS_INFO/FileFsControlInfo request to error out early, in turn stopped a
Win8.1 client from proceeding with quota queries.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/libsmb: Avoid potential smbpanic calling parse_user_quota_list.
Noel Power [Tue, 28 Feb 2017 15:04:16 +0000 (15:04 +0000)]
s3/libsmb: Avoid potential smbpanic calling parse_user_quota_list.

Calling parse_user_quota_list with a NULL buffer can cause a panic, while
this shouldn't happen, I managed to trigger this with an early implementation
of SMB2 quota support in smbd which didn't pass back NT_STATUS_NO_MORE_ENTRIES
when handling a SMB2_0_INFO_QUOTA GETINFO message.
OTHOH the Windows client handled the same situation gracefully.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/lib: Fix misleading typo in debug message
Noel Power [Wed, 22 Mar 2017 14:53:22 +0000 (14:53 +0000)]
s3/lib: Fix misleading typo in debug message

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmb2_query_directory: make 'return true' explicit in smb2_query_directory_next_entry()
Stefan Metzmacher [Tue, 31 Jul 2018 07:45:00 +0000 (09:45 +0200)]
smb2_query_directory: make 'return true' explicit in smb2_query_directory_next_entry()

'return req' should do the same as 'return true' for a bool function,
it's implicitly expanded as 'return (req!=NULL)?true:false.

There's no point in that as 'req' is always a valid pointer.

This was most likely just a copy and paste bug.

So we make this explicit now and avoid that Coverity reports this:

CID 1438158:  Null pointer dereferences  (REVERSE_INULL)
Null-checking "req" suggests that it may be null, but it has already
been dereferenced on all paths leading to the check.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jul 31 14:20:49 CEST 2018 on sn-devel-144