samba.git
7 years agolib: enable threaded immediates in source3
Volker Lendecke [Mon, 8 Aug 2016 10:51:56 +0000 (12:51 +0200)]
lib: enable threaded immediates in source3

Logically this belongs into the previous patch, but tevent deserves isolated
patches :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agotevent: Add threaded immediate activation
Volker Lendecke [Mon, 8 Aug 2016 09:26:37 +0000 (11:26 +0200)]
tevent: Add threaded immediate activation

This is infrastructure to improve our async r/w result handling and latency.
The pthreadpool signalling goes through a pipe. This has downsides: The main
event loop has to go through a read on the pipe before it can ship the result.
Also, it is not guaranteed by poll/epoll that the pthreadpool signal pipe is
handled with top priority. When an async pread/pwrite has finished, we should
immediately ship the result to the client, not waiting for anything else.

This patch enables tevent_immediate structs as job signalling. This means a
busy main tevent loop will handle the threaded job completion before any timed
or file descriptor events. Opposite to Jeremy's tevent_thread_proxy this is
done by a modification of the main event loop by looking at a linked list under
a central mutex.

Regarding performance: In a later commit I've created a test that does nothing
but fire one immediate over and over again. If you add a phread_mutex_lock and
unlock pair in the immediate handler, you lose roughly 25% of rounds per
second, so it is measurable. It is questionable that will be measurable in the
real world, but to counter concerns activation of immediates needs to go
through a new struct tevent_threaded_context. Only if such a
tevent_threaded_context exists for a tevent context, the main loop takes the
hit to look at the mutex'ed list of finished jobs.

This patch by design does not care about talloc hierarchies. The idea is that
the main thread owning the tevent context creates a chunk of memory and
prepares the tevent_immediate indication job completion. The main thread hands
the memory chunk together with the immediate as a job description over to a
helper thread. The helper thread does its job and upon completion calls
tevent_threaded_schedule_immediate with the already-prepared immediate. From
that point on memory ownership is again transferred to the main thread.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agotevent: Move the async wakeup pipe to common
Volker Lendecke [Fri, 29 Jul 2016 06:53:59 +0000 (08:53 +0200)]
tevent: Move the async wakeup pipe to common

Signalling the main event loop will also happen from threads soon, and
that will use the same mechanism. This also keeps the pipe open after the last
signal handler is removed. Threaded jobs will come and go very frequently, and
always setting up and tearing down the pipe for each job will be expensive.
Also, this is "just" two file descriptors, and with eventfd just one.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agotevent: Fix a typo
Volker Lendecke [Mon, 15 Aug 2016 08:33:09 +0000 (10:33 +0200)]
tevent: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolibreplace: Ask for eventfd(2)
Volker Lendecke [Fri, 12 Aug 2016 14:40:05 +0000 (16:40 +0200)]
libreplace: Ask for eventfd(2)

This will be used in tevent soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoctdb-tests: Reimplement daemons_stop() using ctdbd_wrapper
Martin Schwenke [Tue, 23 Aug 2016 01:49:54 +0000 (11:49 +1000)]
ctdb-tests: Reimplement daemons_stop() using ctdbd_wrapper

The current daemons_stop() implementation uses very loose matching to
decide which processes to kill if "ctdb shutdown" hasn't worked within
1 second.  This can cause ctdbd processes from other test runs to be
killed.

Instead, use ctdbd_wrapper, which uses the PID file as a last resort.
This has the advantage of never killing ctdbd processes from other
test runs.  However, this also has the obvious consequence that an
interrupted test run in one directory can not have its daemons cleaned
up from a new test run in a different directory.

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

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): Tue Aug 23 21:17:46 CEST 2016 on sn-devel-144

7 years agoctdb-tests: Remove function daemons_start_1()
Martin Schwenke [Tue, 23 Aug 2016 01:07:25 +0000 (11:07 +1000)]
ctdb-tests: Remove function daemons_start_1()

This function doesn't do anything significant, so just unroll the body
into the loop in daemons_start().

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Move local daemon configuration creation into setup_ctdb()
Martin Schwenke [Tue, 23 Aug 2016 00:59:25 +0000 (10:59 +1000)]
ctdb-tests: Move local daemon configuration creation into setup_ctdb()

These files don't need to be re-generated on every restart.  They can
be generated once when CTDB is first started.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Drop attempts to pass arguments to ctdbd on (re)start
Martin Schwenke [Tue, 23 Aug 2016 00:23:56 +0000 (10:23 +1000)]
ctdb-tests: Drop attempts to pass arguments to ctdbd on (re)start

This is not used.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Drop function _ctdb_hack_options()
Martin Schwenke [Tue, 23 Aug 2016 00:20:51 +0000 (10:20 +1000)]
ctdb-tests: Drop function _ctdb_hack_options()

It does something special if the --start-as-stopped option is given
and is not used in any tests.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoWHATSNEW: clear the sections for 4.6
Stefan Metzmacher [Sun, 21 Aug 2016 12:37:29 +0000 (14:37 +0200)]
WHATSNEW: clear the sections for 4.6

The 4.5.x WHATSNEW.txt is maintained in v4-5-test.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 23 16:02:09 CEST 2016 on sn-devel-144

7 years agomessaging_dgm: Fix signed/unsigned hickups
Volker Lendecke [Sun, 21 Aug 2016 15:46:16 +0000 (17:46 +0200)]
messaging_dgm: Fix signed/unsigned hickups

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): Tue Aug 23 10:46:17 CEST 2016 on sn-devel-144

7 years agos4-torture: Enable tests for printer driver info level 8
Andreas Schneider [Thu, 18 Aug 2016 08:30:21 +0000 (10:30 +0200)]
s4-torture: Enable tests for printer driver info level 8

Pair-Programmed-With: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 23 05:00:13 CEST 2016 on sn-devel-144

7 years agos3-spoolss: Support for adding printer drivers with info level 8
Andreas Schneider [Thu, 18 Aug 2016 08:26:10 +0000 (10:26 +0200)]
s3-spoolss: Support for adding printer drivers with info level 8

We already supported getting driver info level 8 but not adding it. This
allows adding printer drivers with level. So several fields where emtpy.

Microsoft released a security update for Windows print spooler
components which requires support for driver info level 8 now. This is
needed to find out if a driver is PACKAGE_AWARE or not.

Pair-Programmed-With: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for spoolss_GetPrinterDriverPackagePath().
Günther Deschner [Fri, 19 Aug 2016 22:01:52 +0000 (00:01 +0200)]
s4-torture: add test for spoolss_GetPrinterDriverPackagePath().

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolibrpc: fix IDL for spoolss_GetPrinterDriverPackagePath()
Günther Deschner [Fri, 19 Aug 2016 22:00:50 +0000 (00:00 +0200)]
librpc: fix IDL for spoolss_GetPrinterDriverPackagePath()

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for spoolss_CorePrinterDriver().
Günther Deschner [Fri, 19 Aug 2016 21:27:19 +0000 (23:27 +0200)]
s4-torture: add test for spoolss_CorePrinterDriver().

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolibrpc: fix spoolss_GetCorePrinterDrivers IDL.
Günther Deschner [Fri, 19 Aug 2016 21:26:34 +0000 (23:26 +0200)]
librpc: fix spoolss_GetCorePrinterDrivers IDL.

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agospoolss: add various well known core printer driver file GUIDs to IDL.
Günther Deschner [Mon, 22 Aug 2016 12:41:05 +0000 (14:41 +0200)]
spoolss: add various well known core printer driver file GUIDs to IDL.

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agohresult: create enough space for the hresult_errstr message.
Günther Deschner [Mon, 22 Aug 2016 12:21:25 +0000 (14:21 +0200)]
hresult: create enough space for the hresult_errstr message.

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-scripting: let gen_hresult.py tolerate empty lines.
Günther Deschner [Fri, 19 Aug 2016 22:32:39 +0000 (00:32 +0200)]
s4-scripting: let gen_hresult.py tolerate empty lines.

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3: libsmb: Add the capability to find a @GMT- path in an SMB2 create and transform...
Jeremy Allison [Sat, 20 Aug 2016 00:00:25 +0000 (17:00 -0700)]
s3: libsmb: Add the capability to find a @GMT- path in an SMB2 create and transform to a timewarp token.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug 22 22:59:22 CEST 2016 on sn-devel-144

7 years agos3: libsmb: Plumb new SMB2 shadow copy call into cli_shadow_copy_data().
Jeremy Allison [Tue, 16 Aug 2016 22:27:55 +0000 (15:27 -0700)]
s3: libsmb: Plumb new SMB2 shadow copy call into cli_shadow_copy_data().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Add cli_smb2_shadow_copy_data() function that gets shadow copy info over...
Jeremy Allison [Tue, 16 Aug 2016 22:26:53 +0000 (15:26 -0700)]
s3: libsmb: Add cli_smb2_shadow_copy_data() function that gets shadow copy info over SMB2.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Add return args to clistr_is_previous_version_path().
Jeremy Allison [Fri, 19 Aug 2016 00:15:01 +0000 (17:15 -0700)]
s3: libsmb: Add return args to clistr_is_previous_version_path().

Not yet used - we will use these to construct the SMB2 TWrp blob.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Correctly align create contexts in a create call.
Jeremy Allison [Fri, 19 Aug 2016 23:58:39 +0000 (16:58 -0700)]
s3: libsmb: Correctly align create contexts in a create call.

SMB2 shadow copy requests are the first time we've used
create contexts in anger in this codepath. This took me
longer than I'd like to admit to find :-).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: smbclient. Ensure we don't crash by freeing uninitialized *snapshots.
Jeremy Allison [Fri, 19 Aug 2016 23:57:27 +0000 (16:57 -0700)]
s3: smbclient. Ensure we don't crash by freeing uninitialized *snapshots.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agoctdb-daemon: When releasing an IP, update PNN in callback
Martin Schwenke [Fri, 19 Aug 2016 06:38:50 +0000 (16:38 +1000)]
ctdb-daemon: When releasing an IP, update PNN in callback

When an error occurs so an IP address is not released then the PNN in
the VNN is currently incorrectly updated.

Instead, update the PNN in the callback when the release is
successful.  Also, explicitly update the PNN on redundant releases.

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

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): Sun Aug 21 22:45:33 CEST 2016 on sn-devel-144

7 years agoctdb-daemon: Rename takeover_callback_state -> release_ip_callback_state
Martin Schwenke [Fri, 19 Aug 2016 06:30:46 +0000 (16:30 +1000)]
ctdb-daemon: Rename takeover_callback_state -> release_ip_callback_state

Many years ago takeover_callback_state was used for both IP takeover
and release.  Now it is only used when releasing an IP so rename it to
improve clarity.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agolib: Implement poll_timeout
Volker Lendecke [Tue, 20 Oct 2015 09:39:09 +0000 (11:39 +0200)]
lib: Implement poll_timeout

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): Sat Aug 20 13:38:37 CEST 2016 on sn-devel-144

7 years agolib: Remove "num_contexts" from poll_funcs_state
Volker Lendecke [Tue, 20 Oct 2015 09:15:38 +0000 (11:15 +0200)]
lib: Remove "num_contexts" from poll_funcs_state

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolib: Remove "num_watches" from poll_funcs_state
Volker Lendecke [Tue, 20 Oct 2015 08:43:06 +0000 (10:43 +0200)]
lib: Remove "num_watches" from poll_funcs_state

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolib: Change poll_funcs to take direct timevals
Volker Lendecke [Tue, 20 Oct 2015 09:40:38 +0000 (11:40 +0200)]
lib: Change poll_funcs to take direct timevals

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolib: Fix poll_func_timeout prototypes
Volker Lendecke [Mon, 19 Oct 2015 19:23:13 +0000 (21:23 +0200)]
lib: Fix poll_func_timeout prototypes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolib: Cleanup includes in messages_dgm
Volker Lendecke [Thu, 18 Aug 2016 20:00:06 +0000 (22:00 +0200)]
lib: Cleanup includes in messages_dgm

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug 20 09:41:33 CEST 2016 on sn-devel-144

7 years agotevent: Fix a typo
Volker Lendecke [Fri, 19 Aug 2016 14:18:56 +0000 (16:18 +0200)]
tevent: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3: smbclient: In order to get shadow copy data over SMB1 we must call cli_shadow_cop...
Jeremy Allison [Thu, 18 Aug 2016 21:36:50 +0000 (14:36 -0700)]
s3: smbclient: In order to get shadow copy data over SMB1 we must call cli_shadow_copy_data() twice.

Once with 'get_names = false' to get the size, then again with 'get_names = true'
to get the data or a Windows server fails to return valid info. Samba doesn't have this bug.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Fri Aug 19 23:59:35 CEST 2016 on sn-devel-144

7 years agos3: libsmb: Do some hardening in the receive processing of cli_shadow_copy_data_recv().
Jeremy Allison [Thu, 18 Aug 2016 19:06:23 +0000 (12:06 -0700)]
s3: libsmb: Do some hardening in the receive processing of cli_shadow_copy_data_recv().

Protect against malicious servers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Correctly set max_setup_size in FSCTL_GET_SHADOW_COPY_DATA nttrans ioctl.
Jeremy Allison [Thu, 18 Aug 2016 21:33:01 +0000 (14:33 -0700)]
s3: libsmb: Correctly set max_setup_size in FSCTL_GET_SHADOW_COPY_DATA nttrans ioctl.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_list_trans_send().
Jeremy Allison [Thu, 18 Aug 2016 21:26:20 +0000 (14:26 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_list_trans_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Make a comment note that cli_set_ea() needs some internal changes before...
Jeremy Allison [Thu, 18 Aug 2016 21:20:11 +0000 (14:20 -0700)]
s3: libsmb: Make a comment note that cli_set_ea() needs some internal changes before cli_set_ea_path() can use previous path versions.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_ctemp_send().
Jeremy Allison [Thu, 18 Aug 2016 21:07:17 +0000 (14:07 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_ctemp_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_chkpath_send().
Jeremy Allison [Thu, 18 Aug 2016 21:05:33 +0000 (14:05 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_chkpath_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_setatr_send().
Jeremy Allison [Thu, 18 Aug 2016 21:04:05 +0000 (14:04 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_setatr_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_getatr_send().
Jeremy Allison [Thu, 18 Aug 2016 21:02:24 +0000 (14:02 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_getatr_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_openx_create().
Jeremy Allison [Thu, 18 Aug 2016 20:59:52 +0000 (13:59 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_openx_create().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_nttrans_create_se...
Jeremy Allison [Thu, 18 Aug 2016 20:40:23 +0000 (13:40 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_nttrans_create_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_ntcreate1_send().
Jeremy Allison [Thu, 18 Aug 2016 20:37:22 +0000 (13:37 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_ntcreate1_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_rmdir_send()
Jeremy Allison [Thu, 18 Aug 2016 20:34:44 +0000 (13:34 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_rmdir_send()

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_mkdir...
Jeremy Allison [Thu, 18 Aug 2016 20:33:30 +0000 (13:33 -0700)]
s3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_mkdir_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_unlin...
Jeremy Allison [Thu, 18 Aug 2016 20:32:03 +0000 (13:32 -0700)]
s3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_unlink_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_ntren...
Jeremy Allison [Thu, 18 Aug 2016 20:29:01 +0000 (13:29 -0700)]
s3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_ntrename_internal_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_renam...
Jeremy Allison [Thu, 18 Aug 2016 20:26:59 +0000 (13:26 -0700)]
s3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_rename_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_qpathinfo_send()
Jeremy Allison [Thu, 18 Aug 2016 20:17:49 +0000 (13:17 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_qpathinfo_send()

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_setpathinfo_send().
Jeremy Allison [Thu, 18 Aug 2016 20:12:22 +0000 (13:12 -0700)]
s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_setpathinfo_send().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Add clistr_is_previous_version_path()
Jeremy Allison [Thu, 18 Aug 2016 20:06:54 +0000 (13:06 -0700)]
s3: libsmb: Add clistr_is_previous_version_path()

Looks for @GMT- token in pathname.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Add uint16_t addtional_flags2 to cli_smb_req_create().
Jeremy Allison [Thu, 18 Aug 2016 20:45:35 +0000 (13:45 -0700)]
s3: libsmb: Add uint16_t addtional_flags2 to cli_smb_req_create().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Add uint16_t addtional_flags2 to cli_trans_send().
Jeremy Allison [Thu, 18 Aug 2016 19:45:32 +0000 (12:45 -0700)]
s3: libsmb: Add uint16_t addtional_flags2 to cli_trans_send().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Add uint16_t additional_flags2 arg to cli_smb_send().
Jeremy Allison [Thu, 18 Aug 2016 19:20:25 +0000 (12:20 -0700)]
s3: libsmb: Add uint16_t additional_flags2 arg to cli_smb_send().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: SMB1: Add missing FLAGS2 definitions from MS-SMB.
Jeremy Allison [Wed, 17 Aug 2016 21:33:00 +0000 (14:33 -0700)]
s3: SMB1: Add missing FLAGS2 definitions from MS-SMB.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agonetcmd/domain: improve error message grammar
Douglas Bagnall [Wed, 11 May 2016 23:38:09 +0000 (11:38 +1200)]
netcmd/domain: improve error message grammar

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 19 17:30:39 CEST 2016 on sn-devel-144

7 years agovlv tests: remove uninteresting debug message
Douglas Bagnall [Wed, 3 Aug 2016 04:04:30 +0000 (16:04 +1200)]
vlv tests: remove uninteresting debug message

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoRemove hopelessly out of date Roadmap
Douglas Bagnall [Mon, 15 Aug 2016 23:48:02 +0000 (11:48 +1200)]
Remove hopelessly out of date Roadmap

Nobody has noticed, so it shouldn't be missed.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agowinbindd: Introduce helper function for winbindd_cache.tdb directory
Christof Schmitt [Thu, 18 Aug 2016 21:01:50 +0000 (14:01 -0700)]
winbindd: Introduce helper function for winbindd_cache.tdb directory

Also add a comment why the file is placed in the state directory.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Aug 19 13:30:23 CEST 2016 on sn-devel-144

7 years agodocs: Clarify description for cache, lock and state directory settings
Christof Schmitt [Thu, 18 Aug 2016 20:46:52 +0000 (13:46 -0700)]
docs: Clarify description for cache, lock and state directory settings

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopvfs_open win10 fix, need return SMB2_CREATE_TAG_QFID
ouyang.xu [Mon, 11 Jul 2016 10:12:52 +0000 (18:12 +0800)]
pvfs_open win10 fix, need return SMB2_CREATE_TAG_QFID

Signed-off-by: kkhaike <kkhaike@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Fri Aug 19 09:35:15 CEST 2016 on sn-devel-144

7 years agos3-libnet: Add missing format element
Amitay Isaacs [Thu, 18 Aug 2016 15:26:38 +0000 (01:26 +1000)]
s3-libnet: Add missing format element

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Aug 18 23:49:42 CEST 2016 on sn-devel-144

7 years agos3-lib: Pass missing argument for format string
Amitay Isaacs [Sun, 7 Aug 2016 08:17:19 +0000 (18:17 +1000)]
s3-lib: Pass missing argument for format string

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 years agosmbd: allow reading files based on FILE_EXECUTE access right
Uri Simchoni [Thu, 4 Aug 2016 11:59:23 +0000 (14:59 +0300)]
smbd: allow reading files based on FILE_EXECUTE access right

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Aug 18 18:58:22 CEST 2016 on sn-devel-144

7 years agoctdb-ipalloc: Fix cumulative takeover timeout
Martin Schwenke [Thu, 18 Aug 2016 02:57:33 +0000 (12:57 +1000)]
ctdb-ipalloc: Fix cumulative takeover timeout

Commit c40fc62642ff5ac49b75e9af49c299e33dbc9073 runs the IP allocation
algorithm after calculating the timeout offset.  If the algorithm
takes a long time then there may be no attempt to release or take over
IPs.

Instead, reset the timeout just before the RELEASE_IP stage if an
early jump to IPREALLOCATED was not taken.

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

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): Thu Aug 18 12:36:37 CEST 2016 on sn-devel-144

7 years agos3: vfs: snapper: Fix snapper_gmt_strip_snapshot() function to strip @GMT token ident...
Jeremy Allison [Wed, 17 Aug 2016 17:57:10 +0000 (10:57 -0700)]
s3: vfs: snapper: Fix snapper_gmt_strip_snapshot() function to strip @GMT token identically to shadow_copy2.c:shadow_copy2_strip_snapshot()

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Aug 18 06:43:02 CEST 2016 on sn-devel-144

7 years agos3: vfs: snapper: Add and use len_before_gmt, calculated as (p-name).
Jeremy Allison [Wed, 17 Aug 2016 17:53:08 +0000 (10:53 -0700)]
s3: vfs: snapper: Add and use len_before_gmt, calculated as (p-name).

Make the code closer to the same functionality in shadow_copy2.c:shadow_copy2_strip_snapshot().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agos3: vfs: shadow_copy2: Replace all uses of (p-name) with len_before_gmt.
Jeremy Allison [Wed, 17 Aug 2016 17:49:50 +0000 (10:49 -0700)]
s3: vfs: shadow_copy2: Replace all uses of (p-name) with len_before_gmt.

p and name don't change, and we've already calculated this length.
Part of the effort to make the code inside vfs_snapper.c that does
the same thing more similar (we can't make these functions identical
due to the 'snapdir' use case).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agoctdb-tests: Validate that TAKE_IP works with IP already on an interface
Martin Schwenke [Mon, 1 Aug 2016 06:00:55 +0000 (16:00 +1000)]
ctdb-tests: Validate that TAKE_IP works with IP already on an interface

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): Thu Aug 18 02:50:16 CEST 2016 on sn-devel-144

7 years agoctdb-tests: Validate that unexpected IP on interface is properly released
Martin Schwenke [Tue, 2 Aug 2016 11:02:08 +0000 (21:02 +1000)]
ctdb-tests: Validate that unexpected IP on interface is properly released

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-recoverd: Don't directly release rogue IP addresses
Martin Schwenke [Tue, 2 Aug 2016 02:18:15 +0000 (12:18 +1000)]
ctdb-recoverd: Don't directly release rogue IP addresses

This is inconsistent with the rest of the local IP verification.  It
should notice problems but not try to fix them directly.  Like other
cases, it should use an IP takeover run to try to fix the problem.  In
this case the address might have just been added and an out-of-band
RELEASE_IP might cause conflicts (i.e. "another change is in flight")
with a scheduled IP takeover run.

This effectively reverts commit
694c1b269edc95df446b2e171919be0c266383c4.  Not sure why this was
needed after c7e648c2d11f9785f2493a3dd67567a635633489.  More recently
commit 6471541d6d2bc9f2af0ff92b280abbd1d933cf88 moves responsibility
for determining interface/netmask to 10.interface so this should
continue to work just fine.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Fix takeover of incorrectly assigned public IP address
Martin Schwenke [Wed, 3 Aug 2016 01:05:06 +0000 (11:05 +1000)]
ctdb-daemon: Fix takeover of incorrectly assigned public IP address

Cause an "updateip" instead of just logging a message.

This may reset existing connections.  However, CTDB doesn't think the
address should already be hosted on the node so there should be no
connections.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Avoid referencing NULL pointer due to unknown old interface
Martin Schwenke [Fri, 29 Jul 2016 09:48:37 +0000 (19:48 +1000)]
ctdb-daemon: Avoid referencing NULL pointer due to unknown old interface

This doesn't currently happen but it will in a subsequent commit.
That commit and this one could be squashed but then the functional
change gets lost in amongst this one.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoRevert "When adding an ip at runtime, it might not yet have an iface assigned to...
Martin Schwenke [Fri, 29 Jul 2016 09:41:01 +0000 (19:41 +1000)]
Revert "When adding an ip at runtime, it might not yet have an iface assigned to it, so ensure that the next takover_ip call will fall through to accept the ip and add it."

This reverts commit 4136f2714578a9bc0e5632a21d287a50f9ec137a.

If the IP address is on an interface then it won't help to pretend
that it isn't.  This will simply cause a takeip event, which will fail
because the address can't be added.  Note that the IP address isn't
necessarily new - something unexpected may have happened.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-scripts: Add early exit for redundant updateip
Martin Schwenke [Fri, 29 Jul 2016 09:29:23 +0000 (19:29 +1000)]
ctdb-scripts: Add early exit for redundant updateip

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Drop special case handling for new IP already on interface
Martin Schwenke [Wed, 17 Aug 2016 04:43:05 +0000 (14:43 +1000)]
ctdb-daemon: Drop special case handling for new IP already on interface

The address may already be assigned to another node, so this is wrong.
It also leaves the interface unknown.

This is better left to code that handles rogue IP addresses.  A
takeover run should correctly takeover the address if it is assigned
to this node or release it if it is assigned to another node.  Coming
soon...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Use release_ip_post() when releasing all IP addresses
Martin Schwenke [Thu, 11 Aug 2016 04:07:44 +0000 (14:07 +1000)]
ctdb-daemon: Use release_ip_post() when releasing all IP addresses

This has the advantage of using common code.  Also, if there was
previously a failed attempt to release the IP address as part of a
delete, then this will finish processing the delete.

Extra care needs to be taken when a VNN is actually deleted.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Factor out new function release_ip_post()
Martin Schwenke [Thu, 11 Aug 2016 03:57:43 +0000 (13:57 +1000)]
ctdb-daemon: Factor out new function release_ip_post()

This contains the cleanup that needs to be done after an IP address is
released from an interface.

state->vnn is set to the return value from release_ip_post(), which is
either the original VNN, or NULL if it was deleted.  This allows
correct handling of the in-flight flag in the destructor for state.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Do not copy address for RELEASE_IP message
Martin Schwenke [Thu, 11 Aug 2016 03:41:12 +0000 (13:41 +1000)]
ctdb-daemon: Do not copy address for RELEASE_IP message

If there's an allocation failure then the implicit early return in
CTDB_NO_MEMORY_VOID() means that no reply is sent to the control.
ctdb_daemon_send_message() makes a copy of the data, so don't copy it
here and remove an unnecessary chance of failure.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Do not update the VNN state on RELEASE_IP failure
Martin Schwenke [Sat, 30 Jul 2016 01:12:19 +0000 (11:12 +1000)]
ctdb-daemon: Do not update the VNN state on RELEASE_IP failure

If RELEASE_IP fails then updating the VNN makes it inconsistent with
reality.  Instead, log the failure and move on to the next IP
address.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Try to release IP address even if interface is unknown
Martin Schwenke [Sun, 7 Aug 2016 21:09:38 +0000 (07:09 +1000)]
ctdb-daemon: Try to release IP address even if interface is unknown

The "releaseip" event in 10.interface will determine the interface and
do the right thing.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-common: Save errno before closing file to keep debug accurate
Martin Schwenke [Mon, 15 Aug 2016 05:22:54 +0000 (15:22 +1000)]
ctdb-common: Save errno before closing file to keep debug accurate

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

In the AIX case, also add the close of the file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tools: Consistently use db_name
Martin Schwenke [Sat, 13 Aug 2016 00:29:24 +0000 (10:29 +1000)]
ctdb-tools: Consistently use db_name

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

CID 1364703: Resource leak (RESOURCE_LEAK)

However, this would already be fixed by the fix for CID 1125618, so
this is probably just a minor bug fix.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tools: Fix CID 1125618 String not null terminated (STRING_NULL)
Martin Schwenke [Sat, 13 Aug 2016 00:29:15 +0000 (10:29 +1000)]
ctdb-tools: Fix CID 1125618 String not null terminated (STRING_NULL)

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-logging: Fix CID 1272823 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:45:35 +0000 (17:45 +1000)]
ctdb-logging: Fix CID 1272823 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Fix CID 1362723 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:35:22 +0000 (17:35 +1000)]
ctdb-daemon: Fix CID 1362723 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tcp: Fix CID 1362724 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:31:52 +0000 (17:31 +1000)]
ctdb-tcp: Fix CID 1362724 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-client: Print error message before next syscall to avoid losing errno
Martin Schwenke [Mon, 15 Aug 2016 04:50:09 +0000 (14:50 +1000)]
ctdb-client: Print error message before next syscall to avoid losing errno

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-client: Fix CID 1362725 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:18:55 +0000 (17:18 +1000)]
ctdb-client: Fix CID 1362725 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Fix CID 1362726 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:16:34 +0000 (17:16 +1000)]
ctdb-daemon: Fix CID 1362726 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tcp: Set file descriptor to -1 after close.
Martin Schwenke [Sun, 14 Aug 2016 23:43:46 +0000 (09:43 +1000)]
ctdb-tcp: Set file descriptor to -1 after close.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tcp: Fix CID 1362727 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:12:21 +0000 (17:12 +1000)]
ctdb-tcp: Fix CID 1362727 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-common: Fix CID 1362728 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:04:45 +0000 (17:04 +1000)]
ctdb-common: Fix CID 1362728 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-common: Fix CID 1362729 Unchecked return value from library
Martin Schwenke [Thu, 11 Aug 2016 01:15:58 +0000 (11:15 +1000)]
ctdb-common: Fix CID 1362729 Unchecked return value from library

Drop setting socket non-blocking and close-on-exec.  The socket is
closed soon after.  Only a single packet is sent, making it almost
impossible for it to block.  Also, note that sockets aren't setup this
way for IPv6.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Update porting test to be more flexible about line numbers
Martin Schwenke [Wed, 10 Aug 2016 07:02:22 +0000 (17:02 +1000)]
ctdb-tests: Update porting test to be more flexible about line numbers

This way the test doesn't need to be changed every time the code is
moved around.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>