obnox/samba/samba-obnox.git
7 years agoHACK smb2 session setup STATUS_PENDING after 10 secs
Stefan Metzmacher [Fri, 8 May 2015 07:17:29 +0000 (09:17 +0200)]
HACK smb2 session setup STATUS_PENDING after 10 secs

7 years agoRevert "TMP: torture:smb2.session: only run bind1 test"
Stefan Metzmacher [Fri, 8 May 2015 10:30:00 +0000 (12:30 +0200)]
Revert "TMP: torture:smb2.session: only run bind1 test"

This reverts commit 75db98a26be2b11f35c29459f7ce9d4701e4b051.

7 years agoRevert "HACK only test_session_reconnect1"
Stefan Metzmacher [Fri, 8 May 2015 10:30:00 +0000 (12:30 +0200)]
Revert "HACK only test_session_reconnect1"

This reverts commit 3dbd1092c912f9436e0376250b9c33407672aff9.

7 years agoHACK only test_session_reconnect1
Stefan Metzmacher [Fri, 8 May 2015 07:17:13 +0000 (09:17 +0200)]
HACK only test_session_reconnect1

7 years agoTMP: torture:smb2.session: only run bind1 test
Michael Adam [Tue, 5 May 2015 12:46:55 +0000 (14:46 +0200)]
TMP: torture:smb2.session: only run bind1 test

7 years agoRevert "TMP DEBUG smb2 server"
Stefan Metzmacher [Fri, 8 May 2015 10:29:59 +0000 (12:29 +0200)]
Revert "TMP DEBUG smb2 server"

This reverts commit 60ae322fb176cc32c888262f6eefa744e94445ae.

7 years agoTMP DEBUG smb2 server
Michael Adam [Tue, 5 May 2015 12:47:52 +0000 (14:47 +0200)]
TMP DEBUG smb2 server

was commit 4153765d4c741f6b5fe8285313422f169156af75

7 years agoRevert "TMP: DEBUG libcli/smb/smbXcli_base.c"
Stefan Metzmacher [Fri, 8 May 2015 10:29:59 +0000 (12:29 +0200)]
Revert "TMP: DEBUG libcli/smb/smbXcli_base.c"

This reverts commit 938a99a2e327db1bf3d8fb110449d3b55c8b8f93.

7 years agoTMP: DEBUG libcli/smb/smbXcli_base.c
Michael Adam [Tue, 5 May 2015 12:47:35 +0000 (14:47 +0200)]
TMP: DEBUG libcli/smb/smbXcli_base.c

7 years agoRevert "TODO make it possible to run smb2.session.bind1 test with -U% against IPC...
Michael Adam [Mon, 11 Jan 2016 17:30:00 +0000 (18:30 +0100)]
Revert "TODO make it possible to run smb2.session.bind1 test with -U% against IPC$ (windows)"

This reverts commit f5eaec43d48bb939723500536012951f1730717b.

7 years agoTODO make it possible to run smb2.session.bind1 test with -U% against IPC$ (windows)
Stefan Metzmacher [Wed, 9 Sep 2015 14:19:56 +0000 (16:19 +0200)]
TODO make it possible to run smb2.session.bind1 test with -U% against IPC$ (windows)

STATUS_INVALID_PARAMETER is returned

7 years ago--- 00-STEPS-multi-channel: STEP07b - session bind [DEBUG] ---
Michael Adam [Fri, 17 Apr 2015 08:25:12 +0000 (10:25 +0200)]
--- 00-STEPS-multi-channel: STEP07b - session bind [DEBUG] ---

7 years agoSTEP07 - TMP/DEBUG security >= user
Michael Adam [Wed, 29 Jul 2015 13:38:07 +0000 (15:38 +0200)]
STEP07 - TMP/DEBUG security >= user

7 years agoSTEP07 - TMP/DEBUG debug binding
Michael Adam [Wed, 2 Sep 2015 17:55:35 +0000 (19:55 +0200)]
STEP07 - TMP/DEBUG debug binding

7 years agoSTEP07 - DEBUG - smb2:session bind
Michael Adam [Fri, 8 May 2015 21:57:44 +0000 (23:57 +0200)]
STEP07 - DEBUG - smb2:session bind

7 years agoSTEP07 - TMP/DEBUG BIND
Michael Adam [Fri, 4 Sep 2015 15:31:47 +0000 (17:31 +0200)]
STEP07 - TMP/DEBUG BIND

7 years ago--- 00-STEPS-multi-channel: STEP02c - SMB connection passing [tests] ---
Michael Adam [Fri, 22 Jan 2016 17:49:24 +0000 (18:49 +0100)]
--- 00-STEPS-multi-channel: STEP02c - SMB connection passing [tests] ---

7 years agoRevert "msgtest fd-passing"
Stefan Metzmacher [Fri, 5 Sep 2014 23:39:26 +0000 (01:39 +0200)]
Revert "msgtest fd-passing"

This reverts commit b3acb9b155309f5459cd74c884a03e8b0a9b97f5.

7 years agomsgtest fd-passing
Stefan Metzmacher [Fri, 5 Sep 2014 23:14:22 +0000 (01:14 +0200)]
msgtest fd-passing

7 years ago-- 00-STEPS-multi-channel: STEP02b - SMB connection passing [DEBUG] ---
Michael Adam [Fri, 22 Jan 2016 17:46:42 +0000 (18:46 +0100)]
-- 00-STEPS-multi-channel: STEP02b - SMB connection passing [DEBUG] ---

7 years agoSTEP02: smbXsrv_client: debug filter_pass
Stefan Metzmacher [Tue, 24 Jun 2014 16:12:23 +0000 (18:12 +0200)]
STEP02: smbXsrv_client: debug filter_pass

7 years ago--- 00-STEPS-multi-channel: STEP02x - SMB connection passing - extra ---
Michael Adam [Tue, 26 Jan 2016 08:36:35 +0000 (09:36 +0100)]
--- 00-STEPS-multi-channel: STEP02x - SMB connection passing - extra ---

7 years agoSTEP02: TODO smbXsrv_client: add commented out stuff for future purposes..
Stefan Metzmacher [Tue, 26 Jan 2016 00:12:55 +0000 (01:12 +0100)]
STEP02: TODO smbXsrv_client: add commented out stuff for future purposes..

7 years agoSTEP02: smbXsrv_client: add commented out code related to local db_rec
Michael Adam [Tue, 26 Jan 2016 08:32:32 +0000 (09:32 +0100)]
STEP02: smbXsrv_client: add commented out code related to local db_rec

7 years agoSTEP02: smbXsrv_client: add commented out code in ..pass_filter"
Michael Adam [Tue, 26 Jan 2016 08:32:05 +0000 (09:32 +0100)]
STEP02: smbXsrv_client: add commented out code in ..pass_filter"

(prep for verifying client guid..)

7 years agoSTEP02: smbXsrv_client: add commented out store op in smbXsrv_client_create
Michael Adam [Tue, 26 Jan 2016 08:31:11 +0000 (09:31 +0100)]
STEP02: smbXsrv_client: add commented out store op in smbXsrv_client_create

7 years agoSTEP02: smbXsrv_client: add commented out table var to smbXsrv_client_connection_pass...
Michael Adam [Tue, 26 Jan 2016 08:30:32 +0000 (09:30 +0100)]
STEP02: smbXsrv_client: add commented out table var to smbXsrv_client_connection_pass_loop"

7 years ago--- 00-STEPS-multi-channel: STEP02a - SMB connection passing HACK ---
Michael Adam [Fri, 22 Jan 2016 17:45:58 +0000 (18:45 +0100)]
--- 00-STEPS-multi-channel: STEP02a - SMB connection passing HACK ---

7 years ago--- 00-STEPS-multi-channel: STEP07a enable multi channel ---
Michael Adam [Fri, 22 Jan 2016 15:51:24 +0000 (16:51 +0100)]
--- 00-STEPS-multi-channel: STEP07a enable multi channel ---

7 years ago--- 00-STEPS-multi-channel: START, STEPs 01,05,06,07,10,02: [UPSTREAM] ---
Michael Adam [Fri, 17 Apr 2015 08:11:10 +0000 (10:11 +0200)]
--- 00-STEPS-multi-channel: START, STEPs 01,05,06,07,10,02: [UPSTREAM] ---

7 years agoupdate TODO.multi-channel
Michael Adam [Sun, 17 Apr 2016 20:03:12 +0000 (22:03 +0200)]
update TODO.multi-channel

7 years agoselftest: samba3.smb2.replay.replay8 fails (incomplete test)
Michael Adam [Thu, 3 Mar 2016 23:22:01 +0000 (00:22 +0100)]
selftest: samba3.smb2.replay.replay8 fails (incomplete test)

7 years agoselftest: samba3.smb2.replay.replay3 succeeds now
Michael Adam [Thu, 3 Mar 2016 23:20:50 +0000 (00:20 +0100)]
selftest: samba3.smb2.replay.replay3 succeeds now

7 years agoselftest: samba3.smb2.replay.replay4 succeeds now (channel sequence)
Michael Adam [Mon, 29 Feb 2016 01:03:44 +0000 (02:03 +0100)]
selftest: samba3.smb2.replay.replay4 succeeds now (channel sequence)

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agoTODO selftest: enable multi channel in the nt4_dc env
Michael Adam [Thu, 3 Mar 2016 23:19:50 +0000 (00:19 +0100)]
TODO selftest: enable multi channel in the nt4_dc env

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agoTMP/DEBUG: debugging in smb2 dispatcher
Michael Adam [Mon, 29 Feb 2016 00:50:46 +0000 (01:50 +0100)]
TMP/DEBUG: debugging in smb2 dispatcher

7 years agoSQ: torture:smb2: replay8 needs multi-channel
Michael Adam [Mon, 29 Feb 2016 11:46:20 +0000 (12:46 +0100)]
SQ: torture:smb2: replay8 needs multi-channel

7 years agoLATER? HACK add smb2.replay.replay8 test
Stefan Metzmacher [Wed, 3 Sep 2014 18:48:34 +0000 (20:48 +0200)]
LATER? HACK add smb2.replay.replay8 test

7 years agoSQ: torture:smb2: replay7 needs multi-channel
Michael Adam [Mon, 29 Feb 2016 11:45:52 +0000 (12:45 +0100)]
SQ: torture:smb2: replay7 needs multi-channel

7 years agoLATER? s4:torture: Add smb2.replay.replay7 test to examine server behaviour when...
Anubhav Rakshit [Thu, 7 Aug 2014 07:22:50 +0000 (12:52 +0530)]
LATER? s4:torture: Add smb2.replay.replay7 test to examine server behaviour when Multiple Channels are utilized.

Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
LATER? sq replay7 doesn't work (on a single CPU server?)

LATER? bla replay7...

7 years agos4-torture: add CHECK_CREATE_OUT_WITHOUT_HANDLE macro for checking two smb2_creates...
Günther Deschner [Wed, 24 Feb 2016 18:26:51 +0000 (19:26 +0100)]
s4-torture: add CHECK_CREATE_OUT_WITHOUT_HANDLE macro for checking two smb2_creates w/o file handle.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
7 years agos3:smbXsrv.idl: add 8 byte channel_sequence number and request counters to IDL.
Günther Deschner [Wed, 27 Jan 2016 15:18:25 +0000 (16:18 +0100)]
s3:smbXsrv.idl: add 8 byte channel_sequence number and request counters to IDL.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
7 years agoselftest:knownfail: smb2.lock.*replay succeed now
Michael Adam [Mon, 22 Feb 2016 16:41:52 +0000 (17:41 +0100)]
selftest:knownfail: smb2.lock.*replay succeed now

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agos3-smbd: enable SMB2 lock sequence checking when SMB3 is enabled.
Günther Deschner [Mon, 25 Jan 2016 17:56:47 +0000 (18:56 +0100)]
s3-smbd: enable SMB2 lock sequence checking when SMB3 is enabled.

While windows enables it only for resilient and persistent handles a SMB server
SHOULD (according to MS-SMB2 section 3.3.5.14 ) activate processing of lock
sequence numbers for EITHER
- protocol dialect 2.1 and resilient handles OR
- protocol dialect 3.x.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
7 years agos4-torture: in smb2.lock.replay try testing lock sequence checking against SMB3 samba...
Günther Deschner [Mon, 25 Jan 2016 17:55:37 +0000 (18:55 +0100)]
s4-torture: in smb2.lock.replay try testing lock sequence checking against SMB3 samba servers.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
7 years agos4-torture: make smb2.lock.replay test work against Windows 2012 R2.
Günther Deschner [Mon, 25 Jan 2016 13:54:30 +0000 (14:54 +0100)]
s4-torture: make smb2.lock.replay test work against Windows 2012 R2.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
7 years agos4-torture: make test_session_reauth5 work against Windows 2012R2.
Günther Deschner [Fri, 22 Jan 2016 18:06:20 +0000 (19:06 +0100)]
s4-torture: make test_session_reauth5 work against Windows 2012R2.

The unlink of the file as anonymous is expected to fail.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
7 years agos3:smb2_lock: implement lock_sequence replay detection
Stefan Metzmacher [Wed, 24 Oct 2012 13:55:20 +0000 (15:55 +0200)]
s3:smb2_lock: implement lock_sequence replay detection

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
7 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>
Reviewed-by: Guenther Deschner <gd@samba.org>
7 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>
Reviewed-by: Guenther Deschner <gd@samba.org>
7 years agos3:smbXsrv.idl: add lock_sequence_array to smbXsrv_open_global0
Stefan Metzmacher [Wed, 24 Oct 2012 13:06:54 +0000 (15:06 +0200)]
s3:smbXsrv.idl: add lock_sequence_array to smbXsrv_open_global0

This is needed for lock replay detection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
7 years agoTODO.multi-channel: update plans for oplock breaks
Michael Adam [Mon, 29 Feb 2016 14:23:55 +0000 (15:23 +0100)]
TODO.multi-channel: update plans for oplock breaks

7 years agoUpdate TODO.multi-channel
Michael Adam [Fri, 26 Feb 2016 14:24:23 +0000 (15:24 +0100)]
Update TODO.multi-channel

7 years agoTODO.multi-channel
Michael Adam [Wed, 24 Sep 2014 07:17:06 +0000 (09:17 +0200)]
TODO.multi-channel

7 years agoSTEP02a - HACK (avoid swrap fdpass..) accept unix sockets... source3/lib/util_sock.c
Stefan Metzmacher [Tue, 24 Jun 2014 18:02:25 +0000 (20:02 +0200)]
STEP02a - HACK (avoid swrap fdpass..) accept unix sockets... source3/lib/util_sock.c

This lets selftest work without socket-wrapper supporting fd-passing...

7 years agoctdb-daemon: Log a message when vfork() takes long time
Amitay Isaacs [Thu, 15 Sep 2016 06:10:49 +0000 (16:10 +1000)]
ctdb-daemon: Log a message when vfork() takes long time

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): Mon Sep 19 12:18:15 CEST 2016 on sn-devel-144

7 years agoctdb-daemon: Log a message when fork() takes long time
Amitay Isaacs [Thu, 15 Sep 2016 06:10:49 +0000 (16:10 +1000)]
ctdb-daemon: Log a message when fork() takes long time

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Avoid extra condition in tevent trace callback
Amitay Isaacs [Fri, 27 Mar 2015 05:23:48 +0000 (16:23 +1100)]
ctdb-daemon: Avoid extra condition in tevent trace callback

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-recovery-helper: Add missing initialisation of ban_credits
Amitay Isaacs [Mon, 19 Sep 2016 04:59:06 +0000 (14:59 +1000)]
ctdb-recovery-helper: Add missing initialisation of ban_credits

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agolib: poll_funcs : poll_funcs_context_slot_find can select the wrong slot to replace.
Jeremy Allison [Sat, 17 Sep 2016 06:37:20 +0000 (23:37 -0700)]
lib: poll_funcs : poll_funcs_context_slot_find can select the wrong slot to replace.

Look for an exact match first, before a free slot.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Sep 19 07:12:00 CEST 2016 on sn-devel-144

7 years agos4/messaging: let the imessaging ctx destructor free msg_dgm_ref
Ralph Boehme [Thu, 15 Sep 2016 12:19:51 +0000 (14:19 +0200)]
s4/messaging: let the imessaging ctx destructor free msg_dgm_ref

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolib/poll_funcs: free contexts in poll_funcs_state_destructor()
Ralph Boehme [Fri, 16 Sep 2016 15:55:56 +0000 (17:55 +0200)]
lib/poll_funcs: free contexts in poll_funcs_state_destructor()

This ensures the destructors get called in the proper order.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolib/poll_funcs: free timers in poll_funcs_state_destructor()
Ralph Boehme [Thu, 15 Sep 2016 12:19:27 +0000 (14:19 +0200)]
lib/poll_funcs: free timers in poll_funcs_state_destructor()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3/smbd: remove a misleading error message
Ralph Boehme [Fri, 16 Sep 2016 10:48:39 +0000 (12:48 +0200)]
s3/smbd: remove a misleading error message

It can happen that we get 0 cleanup events, so remove this error
message.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Sep 16 16:43:16 CEST 2016 on sn-devel-144

7 years agotevent_tutorial: Fix tevent_thread referencing
Volker Lendecke [Sun, 11 Sep 2016 07:28:35 +0000 (09:28 +0200)]
tevent_tutorial: Fix tevent_thread referencing

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep 16 05:16:02 CEST 2016 on sn-devel-144

7 years agotevent_tutorial: Fix typos
Volker Lendecke [Sun, 11 Sep 2016 07:28:35 +0000 (09:28 +0200)]
tevent_tutorial: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3/smbd: set FILE_ATTRIBUTE_DIRECTORY as necessary
Ralph Boehme [Wed, 14 Sep 2016 10:52:48 +0000 (12:52 +0200)]
s3/smbd: set FILE_ATTRIBUTE_DIRECTORY as necessary

Some VFS modules like GPFS will always return success from
SMB_VFS_GET_DOS_ATTRIBUTES() but only set a subset of the attributes. It
neither sets FILE_ATTRIBUTE_NORMAL nor FILE_ATTRIBUTE_DIRECTORY.

We already handle the case that the VFS stack returns with result==0 and
then add the FILE_ATTRIBUTE_NORMAL, regardless of the type of the
filesystem object. If we want to handle result==0 situation in the
SMB_VFS_GET_DOS_ATTRIBUTES() caller, then do it right by either setting
FILE_ATTRIBUTE_NORMAL or FILE_ATTRIBUTE_DIRECTORY.

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

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): Fri Sep 16 00:34:43 CEST 2016 on sn-devel-144

7 years agonfs4acl: Fix owner mapping with ID_TYPE_BOTH
Christof Schmitt [Mon, 12 Sep 2016 23:22:16 +0000 (16:22 -0700)]
nfs4acl: Fix owner mapping with ID_TYPE_BOTH

This fixes a corner case when using NFS4 ACLs with ID_TYPE_BOTH.  Before
this patch, the owner entry in the ACL would be mapped to a gid entry in
the NFSv4 ACL, and not the expected special owner entry. This is caused
by the id mapping returning a valid gid and the nfs4 mapping assumed
that this was actually a group.

Fix this by asking for the uid first, and explicitly checking if the
mapped uid matches the owner. That creates a uid entry in the NFSv4 ACL
that can be changed later in smbacl4_substitute_{simple,special} to the
expected special owner entry.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-spoolss: fix winreg_printer_ver_to_qword
Günther Deschner [Mon, 12 Sep 2016 15:55:37 +0000 (17:55 +0200)]
s3-spoolss: fix winreg_printer_ver_to_qword

We were reporting the OS minor number as the driver version number in all
GetDriver/EnumDriver calls.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agosmbd: Reset O_NONBLOCK on open files
Volker Lendecke [Mon, 29 Aug 2016 07:58:45 +0000 (09:58 +0200)]
smbd: Reset O_NONBLOCK on open files

See the comment inline :-)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12268
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Simo <simo@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 15 20:21:41 CEST 2016 on sn-devel-144

7 years agos4:samba_spnupdate: do not attempt to parse log level, use parsed value
Christian Ambach [Tue, 13 Sep 2016 08:49:47 +0000 (10:49 +0200)]
s4:samba_spnupdate: do not attempt to parse log level, use parsed value

The log level parameter can contain debug class specific entries.
Do not attempt to parse this as int, but use the values that the
debugging system already parsed

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Sep 14 23:15:18 CEST 2016 on sn-devel-144

7 years agopython/join: do not attempt to parse log level, use parsed value
Christian Ambach [Tue, 13 Sep 2016 08:49:47 +0000 (10:49 +0200)]
python/join: do not attempt to parse log level, use parsed value

The log level parameter can contain debug class specific entries.
Do not attempt to parse this as int, but use the values that the
debugging system already parsed

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agopython/drs_utils: do not attempt to parse log level, use parsed value
Christian Ambach [Tue, 13 Sep 2016 08:49:47 +0000 (10:49 +0200)]
python/drs_utils: do not attempt to parse log level, use parsed value

The log level parameter can contain debug class specific entries.
Do not attempt to parse this as int, but use the values that the
debugging system already parsed

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotests/param add a test for LoadParm.log_level
Christian Ambach [Tue, 13 Sep 2016 09:22:38 +0000 (11:22 +0200)]
tests/param add a test for LoadParm.log_level

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos4:param add log_level function to retrieve log level in Python code
Christian Ambach [Tue, 13 Sep 2016 08:48:03 +0000 (10:48 +0200)]
s4:param add log_level function to retrieve log level in Python code

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agounix_msg: Fix unix_dgram_send_queue_init
Volker Lendecke [Wed, 14 Sep 2016 05:16:26 +0000 (07:16 +0200)]
unix_msg: Fix unix_dgram_send_queue_init

We should not free a DLIST element

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 14 19:30:28 CEST 2016 on sn-devel-144

7 years agounix_msg: Fix CID 1372875 Double close
Volker Lendecke [Wed, 14 Sep 2016 05:13:38 +0000 (07:13 +0200)]
unix_msg: Fix CID 1372875 Double close

The two error callers of unix_dgram_sendq_schedule_free already run down the
sendq in the error case.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
7 years agoctdb-tests: Add new public IP takeover no-op test
Martin Schwenke [Tue, 13 Sep 2016 03:48:19 +0000 (13:48 +1000)]
ctdb-tests: Add new public IP takeover no-op test

Test with DisableIPFailover=1 and with no public IP addresses
configured.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Sep 14 12:30:30 CEST 2016 on sn-devel-144

7 years agoctdb-tests: Factor out new local daemons functions ps_ctdbd
Martin Schwenke [Tue, 13 Sep 2016 03:44:04 +0000 (13:44 +1000)]
ctdb-tests: Factor out new local daemons functions ps_ctdbd

Useful for being able to ensure that tests are doing what is expected.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: ipalloc_set_public_ips() can't fail
Martin Schwenke [Mon, 12 Sep 2016 06:04:18 +0000 (16:04 +1000)]
ctdb-ipalloc: ipalloc_set_public_ips() can't fail

So make it a void function.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: Move merged IP list creation to ipalloc()
Martin Schwenke [Mon, 12 Sep 2016 05:59:09 +0000 (15:59 +1000)]
ctdb-ipalloc: Move merged IP list creation to ipalloc()

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: Drop known_ips argument from merged IP list creation
Martin Schwenke [Mon, 12 Sep 2016 05:57:23 +0000 (15:57 +1000)]
ctdb-ipalloc: Drop known_ips argument from merged IP list creation

This is available in the IP allocation state.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: Optimise check to see if IPs can be hosted
Martin Schwenke [Mon, 12 Sep 2016 05:51:58 +0000 (15:51 +1000)]
ctdb-ipalloc: Optimise check to see if IPs can be hosted

Add an early return if there are no known IP addresses.

Also add an extra comment for clarification.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: Whether IPs can be hosted need not depend on merged IP list
Martin Schwenke [Mon, 12 Sep 2016 05:49:03 +0000 (15:49 +1000)]
ctdb-ipalloc: Whether IPs can be hosted need not depend on merged IP list

Merged IP list won't be available here...

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: Store known public IPs in IP allocation state
Martin Schwenke [Mon, 12 Sep 2016 05:41:06 +0000 (15:41 +1000)]
ctdb-ipalloc: Store known public IPs in IP allocation state

This was dropped because it wasn't used, but it will be needed again.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-packaging: Fix systemd network dependency
Martin Schwenke [Thu, 8 Sep 2016 02:28:00 +0000 (12:28 +1000)]
ctdb-packaging: Fix systemd network dependency

https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ says:

  network.target has very little meaning during start-up. [...]
  Whether any network interfaces are already configured when it is
  reached is undefined. [...]

  network-online.target is a target that actively waits until the
  ne[t]work is "up",

CTDB expects to be able to bind a socket to a node address and expects
interfaces for public IP addresses to exist.  CTDB also doesn't expect
time to jump, so also wait until time is synchronised.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Steve French <sfrench@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Tested-by: Steve French <sfrench@samba.org>
7 years agoctdb-daemon: Remove NUM_DB_PRIORITIES
Amitay Isaacs [Tue, 13 Sep 2016 03:08:58 +0000 (13:08 +1000)]
ctdb-daemon: Remove NUM_DB_PRIORITIES

It's not used anymore.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-recoverd: Drop code to freeze databases from set_recovery_mode()
Amitay Isaacs [Tue, 13 Sep 2016 05:45:54 +0000 (15:45 +1000)]
ctdb-recoverd: Drop code to freeze databases from set_recovery_mode()

This function is called only once from force_election() and does not
require freezing of databases.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agos3-ctdb: Use correct db_id size in marshalling record buffer
Amitay Isaacs [Tue, 28 Jun 2016 04:35:43 +0000 (14:35 +1000)]
s3-ctdb: Use correct db_id size in marshalling record buffer

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-common: Use correct db_id size in marshalling record buffer
Amitay Isaacs [Tue, 28 Jun 2016 04:35:11 +0000 (14:35 +1000)]
ctdb-common: Use correct db_id size in marshalling record buffer

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-protocol: Fix marshalling for GET_DB_SEQNUM control request
Amitay Isaacs [Tue, 13 Sep 2016 06:05:14 +0000 (16:05 +1000)]
ctdb-protocol: Fix marshalling for GET_DB_SEQNUM control request

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

Even though database id is 32-bit, it's sent on wire as 64-bits.
The database id is the first 32-bits on the wire.  This needs fixing
eventually, but for now keep the same wire format.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agos3:libsmb fix a typo
Christian Ambach [Tue, 13 Sep 2016 12:59:25 +0000 (14:59 +0200)]
s3:libsmb fix a typo

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 14 02:06:18 CEST 2016 on sn-devel-144

7 years agos4-kdc: Do not leak memory on error in kpasswd_make_error_reply()
Andreas Schneider [Tue, 13 Sep 2016 08:25:07 +0000 (10:25 +0200)]
s4-kdc: Do not leak memory on error in kpasswd_make_error_reply()

CID 1372874

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 Sep 13 22:13:31 CEST 2016 on sn-devel-144

7 years agounix_msg: add a test for dgram socket caching
Ralph Boehme [Fri, 19 Aug 2016 10:02:12 +0000 (12:02 +0200)]
unix_msg: add a test for dgram socket caching

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

7 years agounix_msg: always create a send queue for a peer
Ralph Boehme [Fri, 19 Aug 2016 07:22:54 +0000 (09:22 +0200)]
unix_msg: always create a send queue for a peer

Previously, we only created a send queue for a peer if the initial send
to the non-blocking non-connected socket reported EWOULDBOCK (because
the channel was full).

With this change, we now always create a send queue and use a connected,
non-blocking datagram socket from the beginning.

Initially, the socket of the send queue is set to non-blocking mode and
we attempt a direct send via sendmsg(). If that returns EWOULDBOCK, we
set the send queue to blocking mode and let the threadpool handle the
IO.

When a send queue becomes empty, we set the send queue socket back to
non-blocking.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agounix_msg: introduce send queue caching
Ralph Boehme [Fri, 19 Aug 2016 14:25:11 +0000 (16:25 +0200)]
unix_msg: introduce send queue caching

This introduces caching of unix datagram send queues. Right now send
queues are only created for peers if the channel to the peer is full and
a send reported EWOULDBLOCK.

At this stage, performance will actually be slightly worse, because now
if there's a cached queue for a peer without queued messages, we don't
attempt direct send anymore until the send queue is removed from the
cache.

The next commit will modify unix_msg to always create a send queue with
the datagram socket in connected mode and again attempt an non-blocking
send on the connected socket first. Then only if that returns
EWOULDBLOCK, the send has to go through the threadpool.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agounix_msg: add flag to prepare_socket_nonblock()
Ralph Boehme [Mon, 22 Aug 2016 12:02:43 +0000 (14:02 +0200)]
unix_msg: add flag to prepare_socket_nonblock()

This allows prepare_socket_nonblock() to be called to set a socket to
non-blocking (as before) as well as blocking. This will be used in a
subsequent commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agomessaging: Call messaging_dgm_send under become_root only if necessary
Ralph Boehme [Thu, 1 Sep 2016 12:08:55 +0000 (14:08 +0200)]
messaging: Call messaging_dgm_send under become_root only if necessary

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agounix_msg: Return errno from find_send_queue
Ralph Boehme [Thu, 1 Sep 2016 12:04:30 +0000 (14:04 +0200)]
unix_msg: Return errno from find_send_queue

Signed-off-by: : Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agounix_msg: modify find_send_queue() to take a struct sockaddr_un
Ralph Boehme [Fri, 19 Aug 2016 14:14:52 +0000 (16:14 +0200)]
unix_msg: modify find_send_queue() to take a struct sockaddr_un

In one of the next commits unix_dgram_send_queue_init() will be moved
into find_send_queue and that takes a struct sockaddr_un.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>