kamenim/samba.git
9 years agovfs:recycle: Inherit NT ACLs master
Samuel Cabrero [Fri, 13 Jun 2014 09:04:02 +0000 (11:04 +0200)]
vfs:recycle: Inherit NT ACLs

This patch allows for directories created by vfs_recycle
module to inherit NT ACLs from their parent

At the moment, no NT ACLs are set for directories
which results in ACLs recostructed from file system
permission - and that may be not the expected result.

Change-Id: I0a7dc1959f068ddb55bfc9b03c9503a9aa27f625
Signed-off-by: Samuel Cabrero <scabrero@zentyal.com>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agos4-auth-krb: Fix talloc access after free in smb_krb5_update_keytab
Samuel Cabrero [Thu, 12 Jun 2014 08:39:02 +0000 (10:39 +0200)]
s4-auth-krb: Fix talloc access after free in smb_krb5_update_keytab

Change-Id: Iaa168d520f124e0c43c7edd649318f0b8ee25020
Signed-off-by: Samuel Cabrero <scabrero@zentyal.com>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agos4:kcc: Fix name for LdbError in except
Kamen Mazdrashki [Mon, 28 Apr 2014 08:50:04 +0000 (10:50 +0200)]
s4:kcc: Fix name for LdbError in except

Change-Id: Ie5acba82ed333c2be69603470a83baea384111ac
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agos4:kcc: fix the name for msg element transportType when loading connection
Kamen Mazdrashki [Mon, 28 Apr 2014 08:49:15 +0000 (10:49 +0200)]
s4:kcc: fix the name for msg element transportType when loading connection

Change-Id: I6600a36eec9e859fe9cae2ca30622d0932dd1728
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agos3: Fix fsctl_validate_neg_info to pass MS compliance suite.
Ira Cooper [Sat, 21 Jun 2014 04:41:19 +0000 (21:41 -0700)]
s3: Fix fsctl_validate_neg_info to pass MS compliance suite.

It turns out that all the client and server need to agree on is what
protocol should have been negotiated.  If they disagree, they should
disconnect.  The contents of the list of protocols used during
negotiate and during FSCTL_VALIDATE_NEGOTIATE_INFO do not need to match.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jun 23 14:28:25 CEST 2014 on sn-devel-104

9 years agos3: Refactor smbd_smb2_request_process_negprot
Ira Cooper [Sat, 21 Jun 2014 04:29:26 +0000 (21:29 -0700)]
s3: Refactor smbd_smb2_request_process_negprot

Breakout smb2_protocol_dialect_match to support future work in
fsctl_validate_neg_info.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotorture3: Reproducer for bug 10593
Volker Lendecke [Thu, 19 Jun 2014 14:37:40 +0000 (14:37 +0000)]
torture3: Reproducer for bug 10593

We panic if we get an oplock break response for a cancelled create request

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): Sat Jun 21 23:05:47 CEST 2014 on sn-devel-104

9 years agosmbd: Fix bug 10593
Volker Lendecke [Fri, 20 Jun 2014 14:15:54 +0000 (14:15 +0000)]
smbd: Fix bug 10593

Bug 10593 is a panic that happens if we get an oplock break reply via
dbwrap_watch for which we can't find the SMB request anymore. This
error condition can legally happen when a client cancels the create
request before the oplock break response comes in. This patch drops the
dbwrap_watch_send request waiting for the oplock break when the request
is cancelled. Yet another talloc hierarchy problem, but if done right,
talloc hierarchies can make rundown of state easy :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: First watch, then defer
Volker Lendecke [Fri, 20 Jun 2014 14:15:19 +0000 (14:15 +0000)]
smbd: First watch, then defer

We exit if any of these if-statement fails, so a simple swap should not
make a difference.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Store "struct deferred_open_record" instead of anonymous data on pml
Volker Lendecke [Fri, 20 Jun 2014 14:12:14 +0000 (14:12 +0000)]
smbd: Store "struct deferred_open_record" instead of anonymous data on pml

The main point is to get a talloc parent that will go away when the
request is cancelled

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Make cli_ntcreate cancellable
Volker Lendecke [Fri, 20 Jun 2014 10:38:36 +0000 (10:38 +0000)]
libsmb: Make cli_ntcreate cancellable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Make cli_ntcreate1 cancellable
Volker Lendecke [Fri, 20 Jun 2014 10:38:10 +0000 (10:38 +0000)]
libsmb: Make cli_ntcreate1 cancellable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Make cli_smb2_create_fnum cancellable
Volker Lendecke [Fri, 20 Jun 2014 10:37:46 +0000 (10:37 +0000)]
libsmb: Make cli_smb2_create_fnum cancellable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Make smb2cli_create cancellable
Volker Lendecke [Fri, 20 Jun 2014 10:37:14 +0000 (10:37 +0000)]
libsmb: Make smb2cli_create cancellable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Enable oplocks for smb2 cli_ntcreate
Volker Lendecke [Fri, 20 Jun 2014 09:55:04 +0000 (09:55 +0000)]
libsmb: Enable oplocks for smb2 cli_ntcreate

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Align cli_ntcreate with other sync wrappers
Volker Lendecke [Fri, 20 Jun 2014 08:53:49 +0000 (08:53 +0000)]
libsmb: Align cli_ntcreate with other sync wrappers

... saves 5 lines :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: remove smb2 switch from cli_ntcreate
Volker Lendecke [Fri, 20 Jun 2014 08:52:45 +0000 (08:52 +0000)]
libsmb: remove smb2 switch from cli_ntcreate

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Replace async cli_ntcreate by cli_create
Volker Lendecke [Fri, 20 Jun 2014 08:50:17 +0000 (08:50 +0000)]
libsmb: Replace async cli_ntcreate by cli_create

Done by rename cli_ntcreate_send/recv to cli_ntcreate1_send/recv and
cli_create_send/recv to cli_ntcreate_send/recv

Possibly cli_create might be the better name, but I am sooo used to
cli_ntcreate() that I don't really want to rename this ;-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Add cli_create_send/recv
Volker Lendecke [Fri, 20 Jun 2014 08:41:59 +0000 (08:41 +0000)]
libsmb: Add cli_create_send/recv

Async wrapper around smb1 and smb2 create

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Make cli_smb2_create_fnum async
Volker Lendecke [Fri, 20 Jun 2014 08:23:47 +0000 (08:23 +0000)]
libsmb: Make cli_smb2_create_fnum async

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotorture: add FSRVP share snapshot ACL test
David Disseldorp [Fri, 20 Jun 2014 17:14:15 +0000 (19:14 +0200)]
torture: add FSRVP share snapshot ACL test

The new test_fsrvp_share_sd test sets a unique ACL on the base share,
and then confirms that snapshot shares carry the same ACL.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat Jun 21 15:10:12 CEST 2014 on sn-devel-104

9 years agotorture: add FSRVP message sequence timeout test
David Disseldorp [Fri, 20 Jun 2014 17:14:14 +0000 (19:14 +0200)]
torture: add FSRVP message sequence timeout test

Sleep at various points in the FSRVP snapshot creation state machine,
and confirm that the state timeout is reflected in subsequent server
responses.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotorture: add timeout sleeps to fsrvp create helper
David Disseldorp [Fri, 20 Jun 2014 17:14:13 +0000 (19:14 +0200)]
torture: add timeout sleeps to fsrvp create helper

Attempt to trip message sequence timeouts at various points in the FSRVP
shadow-copy creation state machine.

The default timeout-injection sleep durations correspond to those
documented in MS-FSRVP (+500ms). They can also be manually set using the
"fss: sequence timeout" parameter.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotorture: validate FSCTL_SRV_ENUMERATE_SNAPSHOTS response
David Disseldorp [Fri, 20 Jun 2014 17:14:12 +0000 (19:14 +0200)]
torture: validate FSCTL_SRV_ENUMERATE_SNAPSHOTS response

Check the NumberOfSnapShotsReturned and SnapShotArraySize fields in the
FSCTL_SRV_ENUMERATE_SNAPSHOTS response match expected values.

This is a regression test for bso#10549.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agonss_wrapper: Fix some "discarding const" warnings
Volker Lendecke [Sat, 21 Jun 2014 08:48:56 +0000 (10:48 +0200)]
nss_wrapper: Fix some "discarding const" warnings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agonss_wrapper: Align indentation with the rest of Samba
Volker Lendecke [Sat, 21 Jun 2014 08:47:28 +0000 (10:47 +0200)]
nss_wrapper: Align indentation with the rest of Samba

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoautobuild: fix ctdb build of samba-ctdb target after switch to waf.
Michael Adam [Fri, 20 Jun 2014 19:31:26 +0000 (21:31 +0200)]
autobuild: fix ctdb build of samba-ctdb target after switch to waf.

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

9 years agoctdb: update configure.rpm with builtin and bundled library arguments
Michael Adam [Fri, 20 Jun 2014 16:13:34 +0000 (18:13 +0200)]
ctdb: update configure.rpm with builtin and bundled library arguments

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoldb:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:08:53 +0000 (18:08 +0200)]
ldb:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoreplace:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:08:18 +0000 (18:08 +0200)]
replace:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agontdb:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:05:44 +0000 (18:05 +0200)]
ntdb:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agotalloc:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:04:44 +0000 (18:04 +0200)]
talloc:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agotevent:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:04:13 +0000 (18:04 +0200)]
tevent:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agotdb:build: improve detection of srcdir.
Michael Adam [Fri, 20 Jun 2014 16:03:31 +0000 (18:03 +0200)]
tdb:build: improve detection of srcdir.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb:includes: add #ifdef guard for ZERO_STRUCT
Michael Adam [Fri, 20 Jun 2014 13:08:01 +0000 (15:08 +0200)]
ctdb:includes: add #ifdef guard for ZERO_STRUCT

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb:includes: add #ifdef guards for _PUBLIC_, _NORETURN_, and _PURE_
Michael Adam [Fri, 20 Jun 2014 13:07:35 +0000 (15:07 +0200)]
ctdb:includes: add #ifdef guards for _PUBLIC_, _NORETURN_, and _PURE_

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agobuild: rename argument of list_directory_files(): abspath->path
Michael Adam [Fri, 20 Jun 2014 09:52:11 +0000 (11:52 +0200)]
build: rename argument of list_directory_files(): abspath->path

It is never called with an absolute path.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb: Remove duplicate README.Coding
Andrew Bartlett [Wed, 28 May 2014 00:49:39 +0000 (12:49 +1200)]
ctdb: Remove duplicate README.Coding

Change-Id: I42e7c6938467a982bc799b00ddd4c5dff93ca3d1
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoautobuild: Remove unsupported --enable-socket-wrapper option from the "ctdb" target.
Amitay Isaacs [Tue, 17 Jun 2014 16:24:48 +0000 (09:24 -0700)]
autobuild: Remove unsupported --enable-socket-wrapper option from the "ctdb" target.

Socket wrapper now works with LD_PRELOAD.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoautobuild: Don't need autogen.sh anymore in the "ctdb" target.
Amitay Isaacs [Tue, 17 Jun 2014 16:00:58 +0000 (09:00 -0700)]
autobuild: Don't need autogen.sh anymore in the "ctdb" target.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoctdb-packaging: Remove unused files
Amitay Isaacs [Tue, 10 Jun 2014 06:30:57 +0000 (16:30 +1000)]
ctdb-packaging: Remove unused files

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoctdb-build: Add target to build RPMs
Amitay Isaacs [Tue, 10 Jun 2014 06:30:38 +0000 (16:30 +1000)]
ctdb-build: Add target to build RPMs

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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

9 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

9 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>
9 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

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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

9 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>
9 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>
9 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>
9 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

9 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>
9 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>
9 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>
9 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>
9 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

9 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>
9 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>
9 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>
9 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>
9 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>
9 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

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>