amitay/samba.git
10 years agoctdb-packaging: Modify spec file to use waf build instead of autoconf
Amitay Isaacs [Mon, 26 May 2014 03:21:44 +0000 (13:21 +1000)]
ctdb-packaging: Modify spec file to use waf build instead of autoconf

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-packaging: Fix date/days in changelog
Amitay Isaacs [Mon, 26 May 2014 04:03:26 +0000 (14:03 +1000)]
ctdb-packaging: Fix date/days in changelog

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-build: Add build files (configure/Makefile) to use waf
Amitay Isaacs [Thu, 15 May 2014 14:10:00 +0000 (00:10 +1000)]
ctdb-build: Add build files (configure/Makefile) to use waf

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-tests: Fix the tests for waf build
Amitay Isaacs [Sun, 25 May 2014 01:03:41 +0000 (11:03 +1000)]
ctdb-tests: Fix the tests for waf build

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-build: Add waf build for CTDB
Amitay Isaacs [Thu, 30 Jan 2014 07:45:06 +0000 (18:45 +1100)]
ctdb-build: Add waf build for CTDB

Note that in contrast to the original autoconf build,
the ctdb.spec file which is created from packaging/RPM/ctdb.spec,
is put into the top level directory, where it will be picked
up by rpmbuild -ta <tarball>".

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-build: Remove autoconf build files
Amitay Isaacs [Tue, 20 May 2014 08:49:32 +0000 (18:49 +1000)]
ctdb-build: Remove autoconf build files

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agowafsamba: allow samba_dist.dist() to be called from a different directory.
Amitay Isaacs [Sun, 25 May 2014 01:31:44 +0000 (11:31 +1000)]
wafsamba: allow samba_dist.dist() to be called from a different directory.

Up to now it assumed to be called from the top level srcdir.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-mkversion: Support external VERSION specification
Amitay Isaacs [Sun, 25 May 2014 02:00:59 +0000 (12:00 +1000)]
ctdb-mkversion: Support external VERSION specification

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-header: Protect against multiple includes
Amitay Isaacs [Thu, 15 May 2014 14:07:59 +0000 (00:07 +1000)]
ctdb-header: Protect against multiple includes

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-build: Remove duplicate socket_wrapper library
Amitay Isaacs [Thu, 15 May 2014 15:33:32 +0000 (01:33 +1000)]
ctdb-build: Remove duplicate socket_wrapper library

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-build: Remove duplicate tdb library
Amitay Isaacs [Thu, 15 May 2014 14:05:43 +0000 (00:05 +1000)]
ctdb-build: Remove duplicate tdb library

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-build: Remove duplicate tevent library
Amitay Isaacs [Thu, 15 May 2014 14:05:29 +0000 (00:05 +1000)]
ctdb-build: Remove duplicate tevent library

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-build: Remove duplicate talloc library
Amitay Isaacs [Thu, 15 May 2014 14:05:10 +0000 (00:05 +1000)]
ctdb-build: Remove duplicate talloc library

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-build: Remove duplicate replace library
Amitay Isaacs [Thu, 15 May 2014 14:04:35 +0000 (00:04 +1000)]
ctdb-build: Remove duplicate replace library

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-build: Remove duplicate popt library
Amitay Isaacs [Thu, 15 May 2014 14:04:16 +0000 (00:04 +1000)]
ctdb-build: Remove duplicate popt library

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-eventscripts: Ensure $GANRECDIR points to configured subdirectory
Martin Schwenke [Mon, 16 Jun 2014 00:59:20 +0000 (10:59 +1000)]
ctdb-eventscripts: Ensure $GANRECDIR points to configured subdirectory

Check that the $GANRECDIR symlink points to the location specified by
$CTDB_GANESHA_REC_SUBDIR and replace it if incorrect.  This handles
reconfiguration and filesystem changes.

While touching this code:

* Create the $GANRECDIR link as a separate step if it doesn't exist.
  This means there is only 1 place where the link is created.

* Change some variables names to the style used for local function
  variables.

* Remove some "ln failed" error messages.  ln failures will be logged
  anyway.

* Add -v to various mkdir/rm/ln commands so that these actions are
  logged when they actually do something.

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): Fri Jun 20 05:40:16 CEST 2014 on sn-devel-104

10 years agoctdb-daemon: Debugging for tickle updates
Martin Schwenke [Wed, 5 Mar 2014 05:21:45 +0000 (16:21 +1100)]
ctdb-daemon: Debugging for tickle updates

This was useful for debugging the race fixed by commit
4f79fa6c7c843502fcdaa2dead534ea3719b9f69.  It might be useful again.

Also fix a nearby comment typo.

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): Fri Jun 20 02:07:48 CEST 2014 on sn-devel-104

10 years agoctdb-tests: Try harder to avoid failures due to repeated recoveries
Martin Schwenke [Tue, 10 Jun 2014 05:16:44 +0000 (15:16 +1000)]
ctdb-tests: Try harder to avoid failures due to repeated recoveries

About a year ago a check was added to _cluster_is_healthy() to make
sure that node 0 isn't in recovery.  This was to avoid unexpected
recoveries causing tests to fail.  However, it was misguided because
each test initially calls cluster_is_healthy() and will now fail if an
unexpected recovery occurs.

Instead, have cluster_is_healthy() warn if the cluster is in recovery.

Also:

* Rename wait_until_healthy() to wait_until_ready() because it waits
  until both healthy and out of recovery.

* Change the post-recovery sleep in restart_ctdb() to 2 seconds and
  add a loop to wait (for 2 seconds at a time) if the cluster is back
  in recovery.  The logic here is that the re-recovery timeout has
  been set to 1 second, so sleeping for just 1 second might race
  against the next recovery.

* Use reverse logic in node_has_status() so that it works for "all".

* Tweak wait_until() so that it can handle timeouts with a
  recheck-interval specified.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agomessaging3: Make messaging_dgm_init return 0/errno
Volker Lendecke [Tue, 10 Jun 2014 15:21:10 +0000 (15:21 +0000)]
messaging3: Make messaging_dgm_init return 0/errno

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 18 21:17:57 CEST 2014 on sn-devel-104

10 years agomessaging3: Use "goto fail_nomem" where appropriate
Volker Lendecke [Tue, 10 Jun 2014 14:57:05 +0000 (14:57 +0000)]
messaging3: Use "goto fail_nomem" where appropriate

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agomessaging3: simplify messaging_dgm_lockfile_remove
Volker Lendecke [Fri, 30 May 2014 15:31:33 +0000 (15:31 +0000)]
messaging3: simplify messaging_dgm_lockfile_remove

full_path_tos() isn't really required here, this is not a hot code path

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agomessaging3: Make messaging_dgm_wipe return 0/errno
Volker Lendecke [Wed, 4 Jun 2014 14:47:05 +0000 (14:47 +0000)]
messaging3: Make messaging_dgm_wipe return 0/errno

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agomessaging3: Make messaging_dgm_cleanup return 0/errno
Volker Lendecke [Wed, 4 Jun 2014 14:42:46 +0000 (14:42 +0000)]
messaging3: Make messaging_dgm_cleanup return 0/errno

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agomessaging3: Make the _send function return 0/errno
Volker Lendecke [Wed, 4 Jun 2014 14:36:57 +0000 (14:36 +0000)]
messaging3: Make the _send function return 0/errno

This is to eventually make messaging_dgm usable in ctdb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agomessaging3: Remove two uses of talloc_tos()
Volker Lendecke [Mon, 2 Jun 2014 21:01:46 +0000 (23:01 +0200)]
messaging3: Remove two uses of talloc_tos()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agomessaging3: Remove use of full_path_tos()
Volker Lendecke [Mon, 2 Jun 2014 20:29:44 +0000 (22:29 +0200)]
messaging3: Remove use of full_path_tos()

This is not performance critical, and this removes source3 specific
code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agounix_msg: Lift sockaddr_un handling from unix_msg_send
Volker Lendecke [Sun, 1 Jun 2014 18:57:21 +0000 (20:57 +0200)]
unix_msg: Lift sockaddr_un handling from unix_msg_send

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agounix_msg: Lift sockaddr_un handling from unix_msg_init
Volker Lendecke [Sun, 1 Jun 2014 18:57:21 +0000 (20:57 +0200)]
unix_msg: Lift sockaddr_un handling from unix_msg_init

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agounix_msg: Lift sockaddr_un handling from unix_dgram_send
Volker Lendecke [Sun, 1 Jun 2014 18:57:21 +0000 (20:57 +0200)]
unix_msg: Lift sockaddr_un handling from unix_dgram_send

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agounix_msg: Lift sockaddr_un handling from unix_dgram_send_queue_init
Volker Lendecke [Sun, 1 Jun 2014 18:57:21 +0000 (20:57 +0200)]
unix_msg: Lift sockaddr_un handling from unix_dgram_send_queue_init

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agounix_msg: Lift sockaddr_un handling from unix_dgram_init
Volker Lendecke [Sun, 1 Jun 2014 18:57:21 +0000 (20:57 +0200)]
unix_msg: Lift sockaddr_un handling from unix_dgram_init

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agolib: Apply const to nt_time_to_unix_timespec
Volker Lendecke [Wed, 18 Jun 2014 10:55:10 +0000 (10:55 +0000)]
lib: Apply const to nt_time_to_unix_timespec

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): Wed Jun 18 16:35:26 CEST 2014 on sn-devel-104

10 years agosamba-tool domain: remove duplicate check if site is set
Björn Baumbach [Wed, 28 May 2014 15:56:48 +0000 (17:56 +0200)]
samba-tool domain: remove duplicate check if site is set

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
10 years agosamba-tool: add --site parameter to provision command
Björn Baumbach [Mon, 26 May 2014 14:17:50 +0000 (16:17 +0200)]
samba-tool: add --site parameter to provision command

This new parameter offers the option to specify a default initial site name.
Otherwise it will be "Default-First-Site-Name".

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
10 years agoprovision/sambadns: remove redundant site parameter
Björn Baumbach [Tue, 10 Jun 2014 13:35:47 +0000 (15:35 +0200)]
provision/sambadns: remove redundant site parameter

The sitename is already included in "names" parameter.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
10 years agos4: torture : Add test case to show that a bad impersonation level causes an error...
Jeremy Allison [Wed, 18 Jun 2014 00:02:07 +0000 (17:02 -0700)]
s4: torture : Add test case to show that a bad impersonation level causes an error on a regular file open.

An invalid impersonation level is only allowed for durable handle reopen.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 18 09:42:43 CEST 2014 on sn-devel-104

10 years agos3: torture test. We now pass "samba3.smb2.create.leading-slash" so remove from known...
Jeremy Allison [Tue, 17 Jun 2014 19:49:11 +0000 (12:49 -0700)]
s3: torture test. We now pass "samba3.smb2.create.leading-slash" so remove from knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agos3: smb2 - strictly obey file name restrictions w.r.t. the SMB2 protocol spec.
Jeremy Allison [Mon, 16 Jun 2014 21:28:11 +0000 (14:28 -0700)]
s3: smb2 - strictly obey file name restrictions w.r.t. the SMB2 protocol spec.

MS-SMB2: 3.3.5.9 - Receiving an SMB2 CREATE Request
If the file name length is greater than zero and the
first character is a path separator character, the
server MUST fail the request with
STATUS_INVALID_PARAMETER.

Found and fix confirmed by Microsoft test tool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agos3: smb2 - Check supplied impersonation level on SMB2_CREATE.
Jeremy Allison [Mon, 16 Jun 2014 21:13:02 +0000 (14:13 -0700)]
s3: smb2 - Check supplied impersonation level on SMB2_CREATE.

MS-SMB2: 2.2.13 SMB2 CREATE Request
ImpersonationLevel ... MUST contain one of the following values.
The server MUST validate this field, but otherwise ignore it.

NB. source4/torture/smb2/durable_open.c shows that
this check is only done on real opens, not on durable
handle reopens.

Found and fix confirmed by Microsoft test tool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agos3: smb2 - Negprot should return INVALID_PARAMETER if flags2 signed bit is set.
Jeremy Allison [Mon, 16 Jun 2014 21:05:18 +0000 (14:05 -0700)]
s3: smb2 - Negprot should return INVALID_PARAMETER if flags2 signed bit is set.

MS-SMB2: 3.3.5.2.4 Verifying the Signature.
If the SMB2 header of the SMB2 NEGOTIATE
request has the SMB2_FLAGS_SIGNED bit set in the
Flags field, the server MUST fail the request
with STATUS_INVALID_PARAMETER.

Found and fix confirmed by Microsoft test tool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agos3: auth: Fix winbindd_pam_auth_pac_send() to create a new info3 and merge in resourc...
Jeremy Allison [Tue, 17 Jun 2014 06:27:35 +0000 (23:27 -0700)]
s3: auth: Fix winbindd_pam_auth_pac_send() to create a new info3 and merge in resource groups from a trusted PAC.

Based on a patch from Richard Sharpe <realrichardsharpe@gmail.com>.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Simo Sorce <idra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 18 03:30:36 CEST 2014 on sn-devel-104

10 years agos3: auth: Change auth3_generate_session_info_pac() to use a copy of the info3 struct...
Jeremy Allison [Tue, 17 Jun 2014 06:15:21 +0000 (23:15 -0700)]
s3: auth: Change auth3_generate_session_info_pac() to use a copy of the info3 struct from the struct PAC_LOGON_INFO.

Call create_info3_from_pac_logon_info() to add in any resource SIDs
from the struct PAC_LOGON_INFO to the info3.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agos3: auth: Add create_info3_from_pac_logon_info() to create a new info3 and merge...
Jeremy Allison [Tue, 17 Jun 2014 06:11:58 +0000 (23:11 -0700)]
s3: auth: Add create_info3_from_pac_logon_info() to create a new info3 and merge resource group SIDs into it.

Originally written by Richard Sharpe Richard Sharpe <realrichardsharpe@gmail.com>.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agos3: auth: Change make_server_info_info3() to take a const struct netr_SamInfo3 pointe...
Jeremy Allison [Tue, 17 Jun 2014 05:54:45 +0000 (22:54 -0700)]
s3: auth: Change make_server_info_info3() to take a const struct netr_SamInfo3 pointer instead of a struct PAC_LOGON_INFO.

make_server_info_info3() only reads from the info3 pointer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agos3: auth: Add some const to the struct netr_SamInfo3 * arguments of copy_netr_SamInfo...
Jeremy Allison [Tue, 17 Jun 2014 05:49:29 +0000 (22:49 -0700)]
s3: auth: Add some const to the struct netr_SamInfo3 * arguments of copy_netr_SamInfo3() and make_server_info_info3()

Both functions only read from the struct netr_SamInfo3 * argument.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agolib: Use BVAL macro in interpret_long_date
Volker Lendecke [Mon, 16 Jun 2014 15:00:33 +0000 (15:00 +0000)]
lib: Use BVAL macro in interpret_long_date

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoautobuild: fix samba-ctdb samba build to pick up right tdb
Michael Adam [Wed, 11 Jun 2014 14:40:02 +0000 (16:40 +0200)]
autobuild: fix samba-ctdb samba build to pick up right tdb

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jun 17 11:58:00 CEST 2014 on sn-devel-104

10 years agoautobuild: add cflags and ldflags to find locally installed tdb
Michael Adam [Wed, 11 Jun 2014 11:57:26 +0000 (13:57 +0200)]
autobuild: add cflags and ldflags to find locally installed tdb

So that we can find our self-installed tdb lib and use new features.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: always run freelist_size again
Michael Adam [Sat, 15 Feb 2014 00:36:06 +0000 (01:36 +0100)]
ctdb:vacuum: always run freelist_size again

and not only if repack_limit != 0. This partially reverts
commit 48f2d1158820bfb063ba0a0bbfb6f496a8e7522.

With the new tdb code this defragments the
free list by merging adjacent records.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: add missing return to ctdb_vacuum_traverse_db() error path.
Michael Adam [Tue, 22 Apr 2014 20:09:35 +0000 (22:09 +0200)]
ctdb:vacuum: add missing return to ctdb_vacuum_traverse_db() error path.

This got lost in commit 19948702992c94553e1a611540ad398de9f9d8b9
("ctdb-vacuum: make ctdb_vacuum_traverse_db() void.")

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: remove now unused talloc ctx argument from ctdb_vacuum_db()
Michael Adam [Sat, 19 Apr 2014 01:36:49 +0000 (03:36 +0200)]
ctdb:vacuum: remove now unused talloc ctx argument from ctdb_vacuum_db()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: move init of vdata into init_vdata funcion
Michael Adam [Sat, 19 Apr 2014 01:34:05 +0000 (03:34 +0200)]
ctdb:vacuum: move init of vdata into init_vdata funcion

This is a small code cleanup.
vdata is only used in ctdb_vacuum_db() and not in
ctdb_vacuum_and_repack_db() where it is currently initialized.

This patch moves creation and all previously scattered
initialization of vacuum_data into ctdb_vacuum_init_vacuum_data
which is called from ctdb_vacuum_db.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: remove vacuum limit from vdata - not used
Michael Adam [Sat, 19 Apr 2014 01:08:20 +0000 (03:08 +0200)]
ctdb:vacuum: remove vacuum limit from vdata - not used

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: remove a superfluous comment.
Michael Adam [Sat, 19 Apr 2014 01:02:42 +0000 (03:02 +0200)]
ctdb:vacuum: remove a superfluous comment.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: untangle assignmend and check for return of tdb_repack()
Michael Adam [Sat, 19 Apr 2014 00:59:51 +0000 (02:59 +0200)]
ctdb:vacuum: untangle assignmend and check for return of tdb_repack()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: remove a superfluous and misleading comment
Michael Adam [Sat, 19 Apr 2014 00:57:25 +0000 (02:57 +0200)]
ctdb:vacuum: remove a superfluous and misleading comment

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: remove now unused ctdb_repack_tdb().
Michael Adam [Sat, 19 Apr 2014 00:57:00 +0000 (02:57 +0200)]
ctdb:vacuum: remove now unused ctdb_repack_tdb().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: use plain tdb_repack() instead of ctdb_repack_tdb()
Michael Adam [Sat, 19 Apr 2014 00:53:29 +0000 (02:53 +0200)]
ctdb:vacuum: use plain tdb_repack() instead of ctdb_repack_tdb()

Since we usually have 0 records left for repack-deletion,
repacking is essentially used for the purpose of defragmenting
the freelist, we can use the vanilla tdb_repack function.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: remove a comment in ctdb_vacuum_and_repack_db()
Michael Adam [Sat, 19 Apr 2014 00:47:21 +0000 (02:47 +0200)]
ctdb:vacuum: remove a comment in ctdb_vacuum_and_repack_db()

The repack operation now mainly defragments the freelist
and does not usually delete any records any more.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:vacuum: adapt debug message for repacking.
Michael Adam [Sat, 19 Apr 2014 00:51:39 +0000 (02:51 +0200)]
ctdb:vacuum: adapt debug message for repacking.

Now we usually have records to delete == 0 after the preceding
vacuum run. Anyways, deletion is not a major aspect any more
of the repack run and will vanish soon.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agomessaging3: Use server_id_str_buf
Volker Lendecke [Tue, 3 Jun 2014 13:11:05 +0000 (13:11 +0000)]
messaging3: Use server_id_str_buf

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 Jun 17 09:27:07 CEST 2014 on sn-devel-104

10 years agolib: Use server_id_str_buf in server_id_str
Volker Lendecke [Tue, 3 Jun 2014 13:04:56 +0000 (13:04 +0000)]
lib: Use server_id_str_buf in server_id_str

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agolib: Add server_id_str_buf
Volker Lendecke [Fri, 30 May 2014 15:24:34 +0000 (15:24 +0000)]
lib: Add server_id_str_buf

This is usable in a DEBUG statement without talloc_tos()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agobuild: fix the test and define for msg_accrights
Michael Adam [Fri, 13 Jun 2014 22:55:02 +0000 (00:55 +0200)]
build: fix the test and define for msg_accrights

It must be "msg_accrights" not "msg_acctrights" ...
                                       ^

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Jun 16 18:18:04 CEST 2014 on sn-devel-104

10 years agoctdb:build: fix building with external libtdb
Michael Adam [Wed, 11 Jun 2014 16:16:34 +0000 (18:16 +0200)]
ctdb:build: fix building with external libtdb

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
10 years agos4-winbind: Use winbindd in the AD DC for fl2003dc and plugin_s4_dc
Andrew Bartlett [Mon, 19 May 2014 22:15:31 +0000 (10:15 +1200)]
s4-winbind: Use winbindd in the AD DC for fl2003dc and plugin_s4_dc

(Including changes to knownfail to match the new winbindd in use in each environment)

Change-Id: I9e08086eba98e95e05a99afef28315e2857aae56
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jun 16 02:53:49 CEST 2014 on sn-devel-104

10 years agos3-winbindd: Honour pdb_is_responsible_for_everything_else()
Andrew Bartlett [Fri, 28 Mar 2014 02:37:19 +0000 (15:37 +1300)]
s3-winbindd: Honour pdb_is_responsible_for_everything_else()

This allows us to avoid running idmap_init_default_domain() which
gives an error in the default AD DC config.

Andrew Bartlett

Change-Id: I923bd941951f6a907e6fa1ad167e5218a01040ff
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
10 years agopassdb: Allow a passdb module to do idmap for everything
Andrew Bartlett [Fri, 28 Mar 2014 02:36:22 +0000 (15:36 +1300)]
passdb: Allow a passdb module to do idmap for everything

This patch seems odd, but the pdb_samba_dsdb module has exactly this
semantics.  That is, the pdb_samba_dsdb is responsible for all IDMAP
values, due to backing on to the idmap.ldb allocator.  This option is
added so we can continue to support the mappings written into that
database even when switching winbindd implementations - the source4/
winbind code would only ask the idmap_ldb code, no matter what the
SID.

Almost all of the behaviour for this is already in winbindd, but we
need this extra flag function so as to avoid (currently intentional)
errors at startup due to not having a per-domain allocation
configured in the smb.conf.

Andrew Bartlett

Change-Id: I6b0d7a1463fe28dfd36715af0285911ecc07585c
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
10 years agovfs:gpfs: fix a debug message
Michael Adam [Fri, 13 Jun 2014 10:05:05 +0000 (12:05 +0200)]
vfs:gpfs: fix a debug message

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun 13 19:54:23 CEST 2014 on sn-devel-104

10 years agovfs: update a bit-rotten comment
Michael Adam [Fri, 13 Jun 2014 09:46:25 +0000 (11:46 +0200)]
vfs: update a bit-rotten comment

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agovfs: remove unused function vfs_pread_data()
Michael Adam [Fri, 13 Jun 2014 09:39:41 +0000 (11:39 +0200)]
vfs: remove unused function vfs_pread_data()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agoman vfs_streams_xattr: new options "prefix" and "store_stream_type"
Ralph Boehme [Mon, 26 May 2014 14:12:17 +0000 (16:12 +0200)]
man vfs_streams_xattr: new options "prefix" and "store_stream_type"

Add documentation for the two new options "streams_xattr:prefix" and
"streams_xattr:store_stream_type".

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun 13 15:51:43 CEST 2014 on sn-devel-104

10 years agovfs_streams_xattr: add options "prefix" and "store_stream_type"
Ralph Boehme [Tue, 20 May 2014 13:17:01 +0000 (15:17 +0200)]
vfs_streams_xattr: add options "prefix" and "store_stream_type"

Add module options that can be used to configure the stream prefix the
module uses (option "prefix", a string) and whether the stream type
"$DATA" is appended to the xattr name on disk (option
"store_stream_type", a boolean).

The default "prefix" is "user.DosStream" and the default for
"store_stream_type" is true, this gives unchanged default behaviour
when not specifying this option.

OS X SMB clients will send xattrs as named streams over the wire, by
setting the options to the following values

  streams_xattr:prefix = user.
  streams_xattr:store_stream_type = no

OS X xattrs will be stored on disk on the server with their unmodified
names and as such provide interoperability with other protocols like
AFP.

In order to prevent access to our internal Samba xattrs, check the
xattr name with the function samba_private_attr_name() made public by
the previous commit.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoConvert samba_private_attr_name() to a public function
Ralph Boehme [Wed, 21 May 2014 09:52:27 +0000 (11:52 +0200)]
Convert samba_private_attr_name() to a public function

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agolocking: use correct conversion specifier for printing variables
Ralph Boehme [Sun, 1 Jun 2014 13:16:16 +0000 (15:16 +0200)]
locking: use correct conversion specifier for printing variables

Fix several occurences of using printf conversion to fload when
printing offset and count variables in locking debug messages and
smbstatus.

Conversion to float may lead to wrong results with very large values.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoleases: Fix uint32->hyper
Volker Lendecke [Thu, 12 Jun 2014 08:53:36 +0000 (08:53 +0000)]
leases: Fix uint32->hyper

Thanks to Noel Power <noel.power@suse.com> for finding this!

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
[ddiss@samba.org: changed Noel's address, as requested]
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Jun 12 16:01:10 CEST 2014 on sn-devel-104

10 years agoRemove .clang_complete.
Andreas Schneider [Thu, 5 Jun 2014 17:06:10 +0000 (19:06 +0200)]
Remove .clang_complete.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agowaf: fix the name of the WINBIND "nss" module on AIX
Björn Jacke [Thu, 12 Jun 2014 08:29:47 +0000 (10:29 +0200)]
waf: fix the name of the WINBIND "nss" module on AIX

on AIX this is actually not called NSS and PAM, this is combined im LAM (loadable
authentication module)

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jun 12 13:32:28 CEST 2014 on sn-devel-104

10 years agotorture: convert torture_comment() -> torture_result() so we can knownfail flapping...
Andrew Bartlett [Wed, 11 Jun 2014 08:51:30 +0000 (20:51 +1200)]
torture: convert torture_comment() -> torture_result() so we can knownfail flapping base.delaywrite tests

This only changes instances directly before a return false, ret =
false or goto fail statement.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jun 12 10:39:38 CEST 2014 on sn-devel-104

10 years agotorture: convert torture_comment() -> torture_result() so we can knownfail flapping...
Andrew Bartlett [Wed, 11 Jun 2014 08:51:20 +0000 (20:51 +1200)]
torture: convert torture_comment() -> torture_result() so we can knownfail flapping base.* tests

This only changes instances directly before a return false, ret =
false or goto fail statement.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-daemon: Reset scheduler policy for helper processes
Amitay Isaacs [Fri, 6 Jun 2014 06:49:13 +0000 (16:49 +1000)]
ctdb-daemon: Reset scheduler policy for helper processes

Do not run helper processes with real-time priority.

This regression was caused when locking and eventscript code switched
to use vfork() and helper instead of ctdb_fork().

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): Thu Jun 12 08:10:36 CEST 2014 on sn-devel-104

10 years agoctdb-daemon: Do not complain if node is inactive and db is not attached
Amitay Isaacs [Tue, 10 Jun 2014 02:17:32 +0000 (12:17 +1000)]
ctdb-daemon: Do not complain if node is inactive and db is not attached

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-build: Remove duplicate library dependency
Amitay Isaacs [Tue, 10 Jun 2014 01:56:39 +0000 (11:56 +1000)]
ctdb-build: Remove duplicate library dependency

LIB_FLAGS includes TDB_LIBS.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-daemon: Remove duplicate code from helper binaries
Amitay Isaacs [Fri, 6 Jun 2014 06:46:15 +0000 (16:46 +1000)]
ctdb-daemon: Remove duplicate code from helper binaries

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-logging: Move controls handling functions from common to server
Amitay Isaacs [Fri, 6 Jun 2014 05:43:22 +0000 (15:43 +1000)]
ctdb-logging: Move controls handling functions from common to server

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-logging: Split ringbuffer handling code from ctdb_collect_log
Amitay Isaacs [Tue, 10 Jun 2014 04:52:19 +0000 (14:52 +1000)]
ctdb-logging: Split ringbuffer handling code from ctdb_collect_log

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-common: Move mkdir_p_or_die to system utilities
Amitay Isaacs [Fri, 6 Jun 2014 05:25:08 +0000 (15:25 +1000)]
ctdb-common: Move mkdir_p_or_die to system utilities

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-daemon: Rename ctdb_mkdir_p_or_die to mkdir_p_or_die
Amitay Isaacs [Fri, 6 Jun 2014 05:24:20 +0000 (15:24 +1000)]
ctdb-daemon: Rename ctdb_mkdir_p_or_die to mkdir_p_or_die

This function does not require ctdb context.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-common: Move lockdown_memory to system utilities
Amitay Isaacs [Tue, 10 Jun 2014 07:04:34 +0000 (17:04 +1000)]
ctdb-common: Move lockdown_memory to system utilities

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-daemon: Rename ctdb_lockdown_memory to lockdown_memory
Amitay Isaacs [Tue, 10 Jun 2014 07:00:38 +0000 (17:00 +1000)]
ctdb-daemon: Rename ctdb_lockdown_memory to lockdown_memory

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-daemon: Instead of passing ctdb context, pass valgrinding boolean
Amitay Isaacs [Fri, 6 Jun 2014 05:08:22 +0000 (15:08 +1000)]
ctdb-daemon: Instead of passing ctdb context, pass valgrinding boolean

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-common: Keep debug level related functions with logging code
Amitay Isaacs [Fri, 6 Jun 2014 05:00:08 +0000 (15:00 +1000)]
ctdb-common: Keep debug level related functions with logging code

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-daemon: Rename block_signal to ignore_signal
Amitay Isaacs [Fri, 6 Jun 2014 04:58:17 +0000 (14:58 +1000)]
ctdb-daemon: Rename block_signal to ignore_signal

This function does not block signals, but ignores them.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-common: Remove unused functions
Amitay Isaacs [Fri, 6 Jun 2014 04:55:23 +0000 (14:55 +1000)]
ctdb-common: Remove unused functions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-daemon: No need to block SIGPIPE at startup
Amitay Isaacs [Fri, 6 Jun 2014 04:52:02 +0000 (14:52 +1000)]
ctdb-daemon: No need to block SIGPIPE at startup

Once CTDB is daemonized, it starts ignoring SIGPIPE anyway.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-common: Separate more system utilities that are independent of ctdb
Amitay Isaacs [Fri, 6 Jun 2014 03:52:15 +0000 (13:52 +1000)]
ctdb-common: Separate more system utilities that are independent of ctdb

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-common: Separate system utilties that are ctdb independent
Amitay Isaacs [Fri, 6 Jun 2014 02:55:56 +0000 (12:55 +1000)]
ctdb-common: Separate system utilties that are ctdb independent

Routines in system_common and system_<os> are supposed to be ctdb
functions with OS specific implementations.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-common: No dynamic memory allocation in mkdir_p()
Martin Schwenke [Wed, 11 Jun 2014 06:58:20 +0000 (16:58 +1000)]
ctdb-common: No dynamic memory allocation in mkdir_p()

Allocate an array of size PATH_MAX on the stack instead.  To stop
unnecessary recursion, try to create the desired directory before
creating ancestors and only create ancestors on ENOENT.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-common: Do not dynamically allocate memory when not necessary
Martin Schwenke [Wed, 11 Jun 2014 06:04:55 +0000 (16:04 +1000)]
ctdb-common: Do not dynamically allocate memory when not necessary

Copy these values onto the stack instead.  INET6_ADDRSTRLEN is 46, so
64 is plenty for an IP address and a port number.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-common: Drop ctdb prefix from utility functions independent of ctdb
Amitay Isaacs [Tue, 10 Jun 2014 06:48:03 +0000 (16:48 +1000)]
ctdb-common: Drop ctdb prefix from utility functions independent of ctdb

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