s3: VFS modules: Ignore EPERM errors on [f]chmod in crossrename module.

This is already done for [f]chown errors. Fix from CurlyMo <curlymoo1@gmail.com>

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
s4: torture: Add a new lock test to show that the Samba SMB1 multi-lock implementation is (currently) correct.

Needed as there was a proposal to re-architect
our multi-lock to dispense with lock order precedence,
which isn't how Windows does it (unfortunately,
as the new code would have been cleaner :-).
Tested against the Win2k12 SMB1 implementation.

This test is designed to show that
lock precedence on the server is based
on the order received, not on the ability
to grant. For example:

A blocked lock request containing 2 locks
will be satified before a subsequent blocked
lock request over one of the same regions,
even if that region is then unlocked. E.g.

(a) lock 100->109, 120->129 (granted)
(b) lock 100->109, 120-129 (blocks)
(c) lock 100->109          (blocks)
(d) unlock 100->109

lock (c) will not be granted as lock (b)
will take precedence.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul  8 10:16:59 CEST 2014 on sn-devel-104
ctdb-tests: Shutdown local daemons if the tests exit abnormally

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
ctdb-build: Check the return value of RUN_COMMAND

RUN_COMMAND does not raise exceptions if the command fails, but returns
non-zero status.  Ensure that make terminates with non-zero status if
RUN_COMMAND fails.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb-build: Replace os.system with samba_utils.RUN_COMMAND

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

CTDB does not use auto-generated files, there is no need to configure
to generate ctags.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb-build: fix wscript formatting as per PEP8

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb-tests: Do not run ip command if running against local daemons

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

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Jul  8 12:48:06 CEST 2014 on sn-devel-104
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>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date(master): Tue Jul  8 16:51:09 CEST 2014 on sn-devel-104
smbd: Make nbt_hdr a field of its own in smbd_smb2_send_oplock_break

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
smbd: Make tf a field of its own in smbd_smb2_send_oplock_break

This actually saves a few bytes in .text. Maybe due to the struct assignments?

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
smbd: Make hdr a field of its own in smbd_smb2_send_oplock_break

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
smbd: no "dyn" in smbd_smb2_send_oplock_break

We don't need the assignment to state->vector[1+SMBD_SMB2_DYN_IOV_OFS],
this is zero-initialized by talloc_zero

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
smbd: Rename smbd_smb2_send_oplock_break_state->buf to ->body

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
smbd: Factor out smbd_smb2_send_break

Most of this routine can be re-used for sending lease breaks

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jul  8 19:54:09 CEST 2014 on sn-devel-104
smbd: Avoid double-free in get_print_db_byname

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Jul  8 22:27:03 CEST 2014 on sn-devel-104
smbd: Use mutex instead of fcntl lock for echohandler coordination

This is based on a patch from Volker. When the system supports roboust
mutexes, they will be used for the coordiations between worker and
echohandler process. This avoids another aspect of the fcntl scalibility
issue when handling many client connections. When mutexes are not
available, the code falls back to the fcntl lock.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul  9 00:56:50 CEST 2014 on sn-devel-104