ambi/samba-autobuild/.git
8 years agoctdb-daemon: Add controls for transactions on a single database
Amitay Isaacs [Wed, 9 Sep 2015 05:38:36 +0000 (15:38 +1000)]
ctdb-daemon: Add controls for transactions on a single database

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename ctdb_control_wipe_database to ctdb_control_transdb
Amitay Isaacs [Wed, 9 Sep 2015 05:02:49 +0000 (15:02 +1000)]
ctdb-daemon: Rename ctdb_control_wipe_database to ctdb_control_transdb

The same structure is required in new controls for database transactions.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: simplify code with TALLOC_FREE
Amitay Isaacs [Thu, 28 Aug 2014 06:59:52 +0000 (16:59 +1000)]
ctdb-freeze: simplify code with TALLOC_FREE

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: Improve log message to indicate subsequent freeze operation
Amitay Isaacs [Thu, 28 Aug 2014 06:58:56 +0000 (16:58 +1000)]
ctdb-freeze: Improve log message to indicate subsequent freeze operation

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Use database specific mark/unmark routines
Amitay Isaacs [Mon, 14 Sep 2015 04:53:45 +0000 (14:53 +1000)]
ctdb-daemon: Use database specific mark/unmark routines

Instead of marking all the databases with priority, mark only the database
which is currently being processed.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Use database specific freeze check routine
Amitay Isaacs [Tue, 15 Sep 2015 04:01:49 +0000 (14:01 +1000)]
ctdb-daemon: Use database specific freeze check routine

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-locking: Add mark/unmark functions for a single database
Amitay Isaacs [Thu, 10 Sep 2015 03:24:43 +0000 (13:24 +1000)]
ctdb-locking: Add mark/unmark functions for a single database

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: Use single database freeze/thaw code for existing controls
Amitay Isaacs [Thu, 28 Aug 2014 05:28:34 +0000 (15:28 +1000)]
ctdb-freeze: Use single database freeze/thaw code for existing controls

This changes the locking behaviour when the databases are frozen.
Instead of a single lock helper locking all databases with a priority,
a lock helper is launched for every database.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: Move destructor closer to where it is used
Amitay Isaacs [Thu, 28 Aug 2014 05:30:39 +0000 (15:30 +1000)]
ctdb-freeze: Move destructor closer to where it is used

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Add controls to freeze/thaw a single database
Amitay Isaacs [Tue, 5 Aug 2014 04:16:29 +0000 (14:16 +1000)]
ctdb-daemon: Add controls to freeze/thaw a single database

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Avoid the use of ctdb->freeze_handle variable
Amitay Isaacs [Tue, 15 Sep 2015 02:22:17 +0000 (12:22 +1000)]
ctdb-daemon: Avoid the use of ctdb->freeze_handle variable

These variables are used for state information related to freezing
databases.  Instead use the API functions to check if the databases
are frozen.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Avoid the use of ctdb->freeze_mode variable
Amitay Isaacs [Thu, 21 Aug 2014 02:32:02 +0000 (12:32 +1000)]
ctdb-daemon: Avoid the use of ctdb->freeze_mode variable

Use ctdb->freeze_mode only in ctdb_freeze.c and use the functions to
check if databases are frozen everywhere else.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: Refactor code to check if databases are frozen
Amitay Isaacs [Thu, 21 Aug 2014 02:26:58 +0000 (12:26 +1000)]
ctdb-freeze: Refactor code to check if databases are frozen

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-call: Convert pending calls list to per database list
Amitay Isaacs [Tue, 5 Aug 2014 04:42:00 +0000 (14:42 +1000)]
ctdb-call: Convert pending calls list to per database list

The pending calls are migration requests received from clients (over unix
domain socket) which are under processing.  After a recovery is finished,
any requests which are under processing will be dropped since they do
not belong to the current generation.  All the pending call requests
are resent with new generation to restart record migrations.

This is in preparation for parallel database recovery.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: Use ctdb_db_iterator to commit transaction on databases
Amitay Isaacs [Tue, 5 Aug 2014 07:13:22 +0000 (17:13 +1000)]
ctdb-freeze: Use ctdb_db_iterator to commit transaction on databases

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: Use ctdb_db_iterator to start transaction on databases
Amitay Isaacs [Tue, 5 Aug 2014 07:02:28 +0000 (17:02 +1000)]
ctdb-freeze: Use ctdb_db_iterator to start transaction on databases

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: Use ctdb_db_iterator to cancel transaction on databases
Amitay Isaacs [Tue, 5 Aug 2014 07:02:07 +0000 (17:02 +1000)]
ctdb-freeze: Use ctdb_db_iterator to cancel transaction on databases

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: Use ctdb_db_prio_iterator to cancel transaction on databases
Amitay Isaacs [Tue, 5 Aug 2014 06:23:21 +0000 (16:23 +1000)]
ctdb-freeze: Use ctdb_db_prio_iterator to cancel transaction on databases

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-locking: Add ctdb_db_iterator to iterate through all databases
Amitay Isaacs [Tue, 5 Aug 2014 06:49:06 +0000 (16:49 +1000)]
ctdb-locking: Add ctdb_db_iterator to iterate through all databases

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-locking: Expose ctdb_db_prio_iterator function
Amitay Isaacs [Tue, 5 Aug 2014 06:45:34 +0000 (16:45 +1000)]
ctdb-locking: Expose ctdb_db_prio_iterator function

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-locking: Rename ctdb_db_iterator to ctdb_db_prio_iterator
Amitay Isaacs [Tue, 5 Aug 2014 06:43:11 +0000 (16:43 +1000)]
ctdb-locking: Rename ctdb_db_iterator to ctdb_db_prio_iterator

This iterator only iterates through databases of specified priority.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-locking: Remove unused priority argument from db_handler_t
Amitay Isaacs [Tue, 5 Aug 2014 06:37:43 +0000 (16:37 +1000)]
ctdb-locking: Remove unused priority argument from db_handler_t

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: Remove commented test code
Amitay Isaacs [Tue, 5 Aug 2014 06:23:47 +0000 (16:23 +1000)]
ctdb-freeze: Remove commented test code

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-freeze: Do an early exit if freeze is pending
Amitay Isaacs [Tue, 5 Aug 2014 05:35:57 +0000 (15:35 +1000)]
ctdb-freeze: Do an early exit if freeze is pending

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agos3:smbd: pass expected_seq_low to smbd_initialize_smb2
Ralph Boehme [Wed, 7 Oct 2015 05:55:44 +0000 (06:55 +0100)]
s3:smbd: pass expected_seq_low to smbd_initialize_smb2

This is in preparation of multi-channel connection passing. This commit
should have been part of 1bb46da.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Oct  7 11:29:11 CEST 2015 on sn-devel-104

8 years agoChange the libreadline word-break character set to only space, TAB and NL so that...
Richard Sharpe [Fri, 18 Sep 2015 23:19:54 +0000 (16:19 -0700)]
Change the libreadline word-break character set to only space, TAB and NL so that we can attempt to do tab completion across backslashes.

This turned out to be all that was needed to enable cd to handle multiple
directory levels.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct  7 04:16:24 CEST 2015 on sn-devel-104

8 years agos3:smb3: rename smbd_smb2_first_negprot and pass expected seq_low
Ralph Boehme [Sun, 27 Sep 2015 00:01:47 +0000 (02:01 +0200)]
s3:smb3: rename smbd_smb2_first_negprot and pass expected seq_low

This is in preperation of connection passing where we have to set
seq_low to the mid from the negprot we've handed over.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Oct  7 00:54:34 CEST 2015 on sn-devel-104

8 years agos3:smbd: add expected_seq_low arg to smbd_initialize_smb2
Ralph Boehme [Sat, 26 Sep 2015 23:58:46 +0000 (01:58 +0200)]
s3:smbd: add expected_seq_low arg to smbd_initialize_smb2

This is in preparation of connection passing for multichannel where we
have to set seq_low to the mid of the passed negprot.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agos4: fix linking smbtorture on Solaris.
Tom Schulz [Mon, 5 Oct 2015 20:19:49 +0000 (22:19 +0200)]
s4: fix linking smbtorture on Solaris.

Don't test getgrouplist if we do not have it.

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

Signed-off-by: Tom Schulz <schulz@adi.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Oct  6 19:15:22 CEST 2015 on sn-devel-104

8 years agovfs_fruit: return value of ad_pack in vfs_fruit.c
Ralph Boehme [Sun, 27 Sep 2015 10:11:31 +0000 (12:11 +0200)]
vfs_fruit: return value of ad_pack in vfs_fruit.c

ad_pack() in vfs_fruit.c returns false on failure and 0 on success -
i.e. return value is interpreted as success even when it fails.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Tue Oct  6 16:14:42 CEST 2015 on sn-devel-104

8 years agolib: Fix CID 1128553 Unchecked return value from library
Volker Lendecke [Tue, 6 Oct 2015 07:57:59 +0000 (09:57 +0200)]
lib: Fix CID 1128553 Unchecked return value from library

At the same time, avoid chmod in favor of fchmod

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Oct  6 13:12:48 CEST 2015 on sn-devel-104

8 years agolib: Fix CID 1325733 Uninitialized scalar variable
Volker Lendecke [Tue, 6 Oct 2015 07:54:19 +0000 (09:54 +0200)]
lib: Fix CID 1325733 Uninitialized scalar variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos3:ctdbd_conn: make sure we destroy tevent_fd before closing the socket
Stefan Metzmacher [Mon, 5 Oct 2015 13:57:42 +0000 (15:57 +0200)]
s3:ctdbd_conn: make sure we destroy tevent_fd before closing the socket

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
8 years agolib: Pass sockname and timeout to ctdbd_probe()
Volker Lendecke [Fri, 25 Sep 2015 23:52:58 +0000 (16:52 -0700)]
lib: Pass sockname and timeout to ctdbd_probe()

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): Sat Oct  3 03:04:39 CEST 2015 on sn-devel-104

8 years agolib: Pass sockname and timeout to ctdbd_messaging_connection
Volker Lendecke [Fri, 25 Sep 2015 23:49:33 +0000 (16:49 -0700)]
lib: Pass sockname and timeout to ctdbd_messaging_connection

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Move lp_ctdbd_socket() to cluster_support.c
Volker Lendecke [Thu, 1 Oct 2015 10:28:21 +0000 (12:28 +0200)]
lib: Move lp_ctdbd_socket() to cluster_support.c

There we have a #ifdef CTDB_SOCKET anyway

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Pass parameters to ctdbd_init_connection()
Volker Lendecke [Fri, 25 Sep 2015 23:09:23 +0000 (16:09 -0700)]
lib: Pass parameters to ctdbd_init_connection()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Store sockname in ctdbd_connection
Volker Lendecke [Fri, 25 Sep 2015 22:49:16 +0000 (15:49 -0700)]
lib: Store sockname in ctdbd_connection

We'll need it in ctdbd_traverse()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Remove temporary ctdb_connection in ctdb_control
Volker Lendecke [Fri, 25 Sep 2015 21:39:41 +0000 (14:39 -0700)]
lib: Remove temporary ctdb_connection in ctdb_control

I can just assume this is a bad hack for a condition that should have been
fixed in a different way. Today we pretty much expect a messaging_context to be
properly initialized everywhere, and this includes a ctdb connection.

If something later fails due to this commit, we need to do a
messaging_init before the offending call

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Store ctdb_timeout in ctdb_connection
Volker Lendecke [Fri, 25 Sep 2015 21:36:35 +0000 (14:36 -0700)]
lib: Store ctdb_timeout in ctdb_connection

This lifts the call to lp_ctdb_timeout() up

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Lift lp_ctdbd_socket() call up one level
Volker Lendecke [Fri, 25 Sep 2015 21:32:09 +0000 (14:32 -0700)]
lib: Lift lp_ctdbd_socket() call up one level

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agokerberos: make sure we only use prompter type when available.
Günther Deschner [Fri, 2 Oct 2015 02:23:59 +0000 (04:23 +0200)]
kerberos: make sure we only use prompter type when available.

We also verified that we cannot simply remove the prompter as several older
versions of Heimdal would crash.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Oct  2 07:29:43 CEST 2015 on sn-devel-104

8 years agowinbind: Fix 100% loop
Volker Lendecke [Fri, 28 Aug 2015 10:33:13 +0000 (12:33 +0200)]
winbind: Fix 100% loop

Thanks to "L.P.H. van Belle" <belle@bazuin.nl>
for help in reproducing the issue.

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

From the bug report:

"With e551cdb37d3e re-applied the problem is gone with
and without kerberos. Moreover, if correctly configured,
sshd requests you to change your password at logon time,
which then succeeds.

The problem why I had this reverted was because I had not
gone through the pain to correctly configure all the PAM
services (in particular the "account" section), leading
to sshd letting the user in when the password had to be
changed."

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit e551cdb37d3e8cfb155bc33f9b162761c8d60889)

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct  2 00:16:29 CEST 2015 on sn-devel-104

8 years agos3: smbd: Fix NULL pointer bug introduced by previous 'raw' stream fix (bug #11522).
Jeremy Allison [Thu, 1 Oct 2015 00:12:11 +0000 (17:12 -0700)]
s3: smbd: Fix NULL pointer bug introduced by previous 'raw' stream fix (bug #11522).

Ensure dirpath can never be NULL.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Oct  1 08:58:36 CEST 2015 on sn-devel-104

8 years agos3: smbd: fix a crash in unix_convert()
Ralph Boehme [Fri, 25 Sep 2015 19:06:57 +0000 (21:06 +0200)]
s3: smbd: fix a crash in unix_convert()

Some error code paths may result in dirpath being NULL.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: We can do ACCRIGHTS style fdpassing
Volker Lendecke [Sat, 26 Sep 2015 22:36:23 +0000 (00:36 +0200)]
lib: We can do ACCRIGHTS style fdpassing

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Oct  1 05:55:42 CEST 2015 on sn-devel-104

8 years agolib: Support fd passing using the 4.3BSD way
Volker Lendecke [Sat, 26 Sep 2015 22:54:42 +0000 (00:54 +0200)]
lib: Support fd passing using the 4.3BSD way

This is required on Solaris

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolib: Move some routines around in msghdr.c
Volker Lendecke [Sat, 26 Sep 2015 22:46:33 +0000 (00:46 +0200)]
lib: Move some routines around in msghdr.c

This way we only need one #ifdef for ACCRIGHTS

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolib: We only need the fd-passing check once
Volker Lendecke [Sat, 26 Sep 2015 22:35:45 +0000 (00:35 +0200)]
lib: We only need the fd-passing check once

unix_dgram_send will tell us as well

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolib: Fix the build on Solaris
Volker Lendecke [Sat, 26 Sep 2015 22:58:00 +0000 (00:58 +0200)]
lib: Fix the build on Solaris

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolibreplace: Fix the build on Solaris
Volker Lendecke [Sat, 26 Sep 2015 22:57:50 +0000 (00:57 +0200)]
libreplace: Fix the build on Solaris

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolib: Fix server_id_db_set_exclusive
Volker Lendecke [Tue, 29 Sep 2015 18:24:10 +0000 (20:24 +0200)]
lib: Fix server_id_db_set_exclusive

For server_id_db_set_exclusive we need to store the unique id along
with the vnn:pid combo. I had tested all this just with some
smbtorture and net command tests, all of which have a unique id of
zero. When trying to exclusively register "notify-daemon" when smbd
is running, this fails because serverid_exists only tests with zero
unique id. notifyd does have a non-zero unique id, so server_id_exists
will think the existing notifyd is another non-samba process that
happened to claim notifyd's pid.

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): Thu Oct  1 02:53:58 CEST 2015 on sn-devel-104

8 years agolib: Add "pid/unique" format for server_id_from_string
Volker Lendecke [Tue, 29 Sep 2015 18:16:56 +0000 (20:16 +0200)]
lib: Add "pid/unique" format for server_id_from_string

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Fix server_id_from_string
Volker Lendecke [Tue, 29 Sep 2015 18:08:48 +0000 (20:08 +0200)]
lib: Fix server_id_from_string

sscanf overwrites vars as numbers come in. So the first sscanf will
overwrite "vnn", although it can't scan the whole thing. This leads
to the string "1234" return .vnn=1234, pid=1234. Bad.

While there, save the temp variables. The SCNu32/64 thingies look
ugly, but it's actually c99.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Add server_id_str_buf_unique
Volker Lendecke [Tue, 29 Sep 2015 02:03:52 +0000 (04:03 +0200)]
lib: Add server_id_str_buf_unique

A representation including the unique id

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Remove ctdb_serverids_exist
Volker Lendecke [Tue, 29 Sep 2015 23:27:00 +0000 (01:27 +0200)]
lib: Remove ctdb_serverids_exist

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Remove serverids_exist
Volker Lendecke [Tue, 29 Sep 2015 23:14:33 +0000 (01:14 +0200)]
lib: Remove serverids_exist

The only reason for this complex monster was an overload of ctdbd.
When opening files, we unconditionally checked all share modes for
validity. This meant thousands of serverid_exists calls per second
for popular directories. This has long gone, now we only check for
validity if a conflict happens.

The only remaining caller is net serverid wipedbs, an administrative
command. If that loads ctdbd, so be it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Use messaging_dgm_get_unique in serverid_exists
Volker Lendecke [Tue, 29 Sep 2015 23:11:08 +0000 (01:11 +0200)]
lib: Use messaging_dgm_get_unique in serverid_exists

This is a relevant change: I was experimenting with
server_id_db_set_exclusive() in "net" and got failures all over the
place. The main reason was that "net" by default does not do a
serverid_register. With messaging_dgm we have the process' unique
id available via the lockfile contents. Using open/read/close is a
bit slower than local tdb access, but this version is safe for all
processes which have done messaging_init()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Use serverid_exists in server_id_db_check_exclusive
Volker Lendecke [Tue, 29 Sep 2015 23:01:46 +0000 (01:01 +0200)]
lib: Use serverid_exists in server_id_db_check_exclusive

If there's another process around there will typically be at most
one process. So there is no real need to run the plural version of
serverid_exists.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agomessages_dgm: Add messaging_dgm_get_unique
Volker Lendecke [Tue, 29 Sep 2015 22:31:17 +0000 (00:31 +0200)]
messages_dgm: Add messaging_dgm_get_unique

To be able to read, we need to open the lockfile O_RDWR instead of O_WRONLY

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agonet: Add "serverid exists"
Volker Lendecke [Tue, 29 Sep 2015 21:39:46 +0000 (23:39 +0200)]
net: Add "serverid exists"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agonet: Fix some tiny memleaks
Volker Lendecke [Tue, 29 Sep 2015 18:42:58 +0000 (20:42 +0200)]
net: Fix some tiny memleaks

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos3:lib:interface: break an overly long line
Michael Adam [Mon, 21 Sep 2015 23:27:48 +0000 (01:27 +0200)]
s3:lib:interface: break an overly long line

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos4-scripting: fix minor indent issue for hresult generation.
Günther Deschner [Wed, 30 Sep 2015 06:27:04 +0000 (08:27 +0200)]
s4-scripting: fix minor indent issue for hresult generation.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos4-scripting: fix wrong indent that caused gen_ntstatus.py to fail.
Günther Deschner [Wed, 30 Sep 2015 06:14:06 +0000 (08:14 +0200)]
s4-scripting: fix wrong indent that caused gen_ntstatus.py to fail.

Verified it now works again with:

./source4/scripting/bin/gen_ntstatus.py libcli/util/ntstatus.h MS-ERREF-2.3.1.NTSTATUS libcli/util/nterr.c

MS-ERREF-2.3.1.NTSTATUS as the copied content from
https://msdn.microsoft.com/en-us/library/cc704588.aspx.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoldb: Fix CID 1034781 Unsigned compared against 0
Volker Lendecke [Tue, 18 Aug 2015 20:25:25 +0000 (22:25 +0200)]
ldb: Fix CID 1034781 Unsigned compared against 0

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agomessages_dgm: Fix an incorrect cast
Volker Lendecke [Tue, 29 Sep 2015 22:30:49 +0000 (00:30 +0200)]
messages_dgm: Fix an incorrect cast

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 30 17:36:32 CEST 2015 on sn-devel-104

8 years agomessages_dgm: No includes.h necessary
Volker Lendecke [Tue, 29 Sep 2015 22:30:28 +0000 (00:30 +0200)]
messages_dgm: No includes.h necessary

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos4-torture: trying to make clusapi resource online/offline testing a bit more robust
Günther Deschner [Mon, 21 Sep 2015 17:17:59 +0000 (19:17 +0200)]
s4-torture: trying to make clusapi resource online/offline testing a bit more robust

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Sep 29 15:00:47 CEST 2015 on sn-devel-104

8 years agos3-rpcclient: protect against empty witness async notify messages.
Günther Deschner [Mon, 14 Sep 2015 15:12:58 +0000 (17:12 +0200)]
s3-rpcclient: protect against empty witness async notify messages.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolibrpc: properly quote uuids so that wireshark dissectors can be built from them.
Günther Deschner [Mon, 28 Sep 2015 17:08:58 +0000 (19:08 +0200)]
librpc: properly quote uuids so that wireshark dissectors can be built from them.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoclusapi: remove security.idl dependency from IDL.
Günther Deschner [Sun, 27 Sep 2015 22:47:17 +0000 (00:47 +0200)]
clusapi: remove security.idl dependency from IDL.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agobuild:wafsamba: Set the default installation prefix for Waf 1.8
Thomas Nagy [Mon, 28 Sep 2015 19:47:16 +0000 (21:47 +0200)]
build:wafsamba: Set the default installation prefix for Waf 1.8

These changes enable the default installation prefix settings to
take effect in both Waf 1.5 and 1.8 with no additional code changes.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agosamba-tool: add command to dump dosinfo xattr from a file
Ralph Boehme [Fri, 25 Sep 2015 23:16:50 +0000 (01:16 +0200)]
samba-tool: add command to dump dosinfo xattr from a file

Add a new command "getdosinfo" to samba-tool to dump dosinfo xattr from
a file.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep 29 06:00:49 CEST 2015 on sn-devel-104

8 years agoctdb-build: Use socket_wrapper only with selftest
Mathieu Parent [Thu, 24 Sep 2015 02:39:17 +0000 (04:39 +0200)]
ctdb-build: Use socket_wrapper only with selftest

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Sat Sep 26 16:52:28 CEST 2015 on sn-devel-104

8 years agos4: torture: Fix directory test against a server that actually uses index returns.
Jeremy Allison [Thu, 24 Sep 2015 18:28:50 +0000 (11:28 -0700)]
s4: torture: Fix directory test against a server that actually uses index returns.

Who knew ? Finally found one that does this :-).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep 25 08:21:49 CEST 2015 on sn-devel-104

8 years agonet: fix a crash with net ads keytab create
Uri Simchoni [Wed, 23 Sep 2015 11:45:47 +0000 (14:45 +0300)]
net: fix a crash with net ads keytab create

Fix a crash that happens when executing "net ads keytab create"
and the machine account in AD does not have setvice principal names
attached to it.

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

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agowitness: fix length calculation in witness_IPaddrInfoList IDL.
Günther Deschner [Thu, 24 Sep 2015 04:40:39 +0000 (06:40 +0200)]
witness: fix length calculation in witness_IPaddrInfoList IDL.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
Autobuild-User(master): José A. Rivera <jarrpa@samba.org>
Autobuild-Date(master): Thu Sep 24 22:33:28 CEST 2015 on sn-devel-104

8 years agowitness: fix IP address endianess in witness_IPaddrInfo IDL.
Günther Deschner [Thu, 24 Sep 2015 04:40:19 +0000 (06:40 +0200)]
witness: fix IP address endianess in witness_IPaddrInfo IDL.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
8 years agos4-torture: add test to verify WITNESS_NOTIFY_CLIENT_MOVE message marshalling.
Günther Deschner [Thu, 24 Sep 2015 00:47:35 +0000 (02:47 +0200)]
s4-torture: add test to verify WITNESS_NOTIFY_CLIENT_MOVE message marshalling.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
8 years agosmbd: Set process name for notifyd process
Christof Schmitt [Wed, 23 Sep 2015 18:21:21 +0000 (11:21 -0700)]
smbd: Set process name for notifyd process

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): Thu Sep 24 11:02:44 CEST 2015 on sn-devel-104

8 years agosmbd: Set process name for async echo handler
Christof Schmitt [Wed, 23 Sep 2015 18:15:44 +0000 (11:15 -0700)]
smbd: Set process name for async echo handler

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agos3: Move call to prctl_set_comment to reinit_after_fork
Christof Schmitt [Wed, 23 Sep 2015 18:14:05 +0000 (11:14 -0700)]
s3: Move call to prctl_set_comment to reinit_after_fork

This save a few lines of code.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agolib: Fix prctl detection for prctl_set_comment
Christof Schmitt [Wed, 23 Sep 2015 19:28:30 +0000 (12:28 -0700)]
lib: Fix prctl detection for prctl_set_comment

Include config.h to make HAVE_PRCTL available for the precompile check.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agos4: torture: Test mkdir race condition.
Jeremy Allison [Wed, 23 Sep 2015 01:01:22 +0000 (18:01 -0700)]
s4: torture: Test mkdir race condition.

Found by Max of LoadDynamix <adx.forum@gmail.com>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 24 06:13:22 CEST 2015 on sn-devel-104

8 years agos3: smbd: Fix mkdir race condition.
Jeremy Allison [Wed, 23 Sep 2015 01:02:53 +0000 (18:02 -0700)]
s3: smbd: Fix mkdir race condition.

Found by Max of LoadDynamix <adx.forum@gmail.com>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agodocs: Fix references to async smb echo handler in smb.conf manpage
Christof Schmitt [Wed, 23 Sep 2015 17:41:06 +0000 (10:41 -0700)]
docs: Fix references to async smb echo handler in smb.conf manpage

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agos4:torture: add a test for 0 byte sized streams
Ralph Boehme [Tue, 22 Sep 2015 01:15:14 +0000 (03:15 +0200)]
s4:torture: add a test for 0 byte sized streams

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 22 23:46:00 CEST 2015 on sn-devel-104

8 years agos4: torture: Fix double-free on error.
Herb Lewis [Tue, 22 Sep 2015 18:39:54 +0000 (11:39 -0700)]
s4: torture: Fix double-free on error.

Signed-off-by: Herb Lewis <hlewis@panasas.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agodbwrap: Remove talloc from dbwrap_watch_record_stored()
Volker Lendecke [Sun, 20 Sep 2015 16:25:20 +0000 (18:25 +0200)]
dbwrap: Remove talloc from dbwrap_watch_record_stored()

This happens on every store to locking.tdb for example, so we should
make it cheap.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Sep 22 07:50:58 CEST 2015 on sn-devel-104

8 years agodbwrap: Convert dbwrap_record_watchers_key to not use talloc
Volker Lendecke [Sun, 20 Sep 2015 15:32:24 +0000 (17:32 +0200)]
dbwrap: Convert dbwrap_record_watchers_key to not use talloc

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agodbwrap: Simplify dbwrap_record_watchers_key()
Volker Lendecke [Sun, 20 Sep 2015 15:06:22 +0000 (17:06 +0200)]
dbwrap: Simplify dbwrap_record_watchers_key()

It took a bit for me to figure out what the rec_key parameter to
dbwrap_record_watchers_key does. I think it's simpler to parse the watcher key
in dbwrap_record_watch_recv to retrieve the watched record key than to store it

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agodbwrap: Make dbwrap_db_id return size_t
Volker Lendecke [Sun, 20 Sep 2015 14:26:06 +0000 (16:26 +0200)]
dbwrap: Make dbwrap_db_id return size_t

This will make an on-stack db-id easier

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agodbwrap: Remove talloc_reference()
Volker Lendecke [Mon, 21 Sep 2015 10:32:47 +0000 (12:32 +0200)]
dbwrap: Remove talloc_reference()

We want to know (by crashing) when we free the database with records still
around. This would be a serious violation of our data structure hierarchies.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agodbwrap: Remove unused dbwrap_hash_size()
Volker Lendecke [Sun, 20 Sep 2015 18:25:53 +0000 (20:25 +0200)]
dbwrap: Remove unused dbwrap_hash_size()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agodbwrap: Remove loadparm_context from db_open_tdb
Volker Lendecke [Mon, 21 Sep 2015 10:28:20 +0000 (12:28 +0200)]
dbwrap: Remove loadparm_context from db_open_tdb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agobuild: improve stack protector check
Gustavo Zacarias [Fri, 11 Sep 2015 19:57:16 +0000 (16:57 -0300)]
build: improve stack protector check

Testing a toolchain for proper -fstack-protector must go beyond ensuring
the compiler and linker accept the option.
If the test C program does nothing with the stack then guards aren't
inserted and/or are optimized away giving the false impression that it
works when in fact the libc might not support it.

Update the check to a program that uses the stack, hence making a link
fail if proper support isn't available, for example in non-ssp enabled
uclibc toolchains like this:

test.c:(.text.startup+0x64): undefined reference to `__stack_chk_fail'

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Sep 21 23:29:13 CEST 2015 on sn-devel-104

8 years agos4:torture:smb2:rename: Fix typo in simple_nodelete testcase.
Anubhav Rakshit [Wed, 16 Sep 2015 15:34:12 +0000 (21:04 +0530)]
s4:torture:smb2:rename: Fix typo in simple_nodelete testcase.

Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Sep 21 04:51:11 CEST 2015 on sn-devel-104

8 years agolib/param: fix hiding of FLAG_SYNONYM values
Stefan Metzmacher [Fri, 18 Sep 2015 16:54:31 +0000 (18:54 +0200)]
lib/param: fix hiding of FLAG_SYNONYM values

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agobuild:wafsamba: Use the samba-provided CHECK_CFG method in configuration tests
Thomas Nagy [Sat, 12 Sep 2015 07:49:41 +0000 (09:49 +0200)]
build:wafsamba: Use the samba-provided CHECK_CFG method in configuration tests

This is for forward compatibility with waf 1.8. All other tests
use CHECK_CFG, but check_cfg was re-introduced for some reason.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>