sfrench/samba-autobuild/.git
5 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

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

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

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

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

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

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

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

5 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

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

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 years agoctdb-common: Changing scheduler policy does not require ctdb context
Amitay Isaacs [Tue, 10 Jun 2014 06:44:59 +0000 (16:44 +1000)]
ctdb-common: Changing scheduler policy does not require ctdb context

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-common: Do not abort if restoring scheduling policy fails
Amitay Isaacs [Fri, 6 Jun 2014 02:27:29 +0000 (12:27 +1000)]
ctdb-common: Do not abort if restoring scheduling policy fails

This code is only executed in child processes, so aborting does not
really achieve much.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-common: No need to save previous scheduler priority
Amitay Isaacs [Fri, 6 Jun 2014 02:21:25 +0000 (12:21 +1000)]
ctdb-common: No need to save previous scheduler priority

When calling sched_setscheduler() with SCHED_OTHER, the only valid
priority is 0.  Nice value is "restored" anyway.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agolibsmb: Put the "smb2_lease" struct into idl
Volker Lendecke [Thu, 5 Jun 2014 10:57:36 +0000 (10:57 +0000)]
libsmb: Put the "smb2_lease" struct into idl

This will make it easier in the future to NDR_PRINT a lease and
a lease key

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 12 03:34:41 CEST 2014 on sn-devel-104

5 years agosmbd: tevent_req_nterror already returns bool :-)
Volker Lendecke [Wed, 11 Jun 2014 09:35:37 +0000 (09:35 +0000)]
smbd: tevent_req_nterror already returns bool :-)

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 11 21:13:06 CEST 2014 on sn-devel-104

5 years agosmbd: Use full_path_tos() where appropriate
Volker Lendecke [Wed, 11 Jun 2014 09:32:56 +0000 (09:32 +0000)]
smbd: Use full_path_tos() where appropriate

Recently I've got reports that SMB2_FIND is slower than trans2 findfirst,
so this tries to use recent performance-sensitive APIs right from the
start :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: smbd : SMB2 - fix SMB2_SEARCH when searching non wildcard string with a case...
Jeremy Allison [Tue, 10 Jun 2014 22:58:15 +0000 (15:58 -0700)]
s3: smbd : SMB2 - fix SMB2_SEARCH when searching non wildcard string with a case-canonicalized share.

We need to go through filename_convert() in order for the filename
canonicalization to be done on a non-wildcard search string (as is
done in the SMB1 findfirst code path).

Fixes Bug #10650 - "case sensitive = True" option doesn't work with "max protocol = SMB2" or higher in large directories.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Ira Cooper <ira@samba.org>
5 years agos3: smbd - SMB[2|3]. Ensure a \ or / can't be found anywhere in a search path, not...
Jeremy Allison [Tue, 10 Jun 2014 21:41:45 +0000 (14:41 -0700)]
s3: smbd - SMB[2|3]. Ensure a \ or / can't be found anywhere in a search path, not just at the start.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Ira Cooper <ira@samba.org>
5 years agos3-winbindd: Implement SamLogon IRPC call
Andrew Bartlett [Thu, 8 May 2014 04:49:13 +0000 (16:49 +1200)]
s3-winbindd: Implement SamLogon IRPC call

We do this by lifting parts of the winbindd_dual_pam_auth_crap() code
into a new helper function winbind_dual_SamLogon().  This allows us to
implement the semantics we need for IRPC, without the artifacts of the
winbindd pipe protocol.

Change-Id: Idb169217e6d68d387c99765d0af7ed394cb5b93a
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jun 11 12:43:58 CEST 2014 on sn-devel-104

5 years agos3-winbind: Transparently forward IRPC messages to the winbind_dual child
Andrew Bartlett [Thu, 8 May 2014 03:33:11 +0000 (15:33 +1200)]
s3-winbind: Transparently forward IRPC messages to the winbind_dual child

Change-Id: I8b336e2365e10ef9ea04d0957eb0829d3766b11e
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos3-winbind rename winbindd_update_rodc_dns to be for more generic irpc
Andrew Bartlett [Thu, 8 May 2014 02:46:06 +0000 (14:46 +1200)]
s3-winbind rename winbindd_update_rodc_dns to be for more generic irpc

Change-Id: I385ef8bd766848becc42e58694207dc94cd07a89
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agolibrpc/idl: Merge wbint.idl with winbind.idl so we can forward IRPC requests to inter...
Andrew Bartlett [Thu, 8 May 2014 00:17:32 +0000 (12:17 +1200)]
librpc/idl: Merge wbint.idl with winbind.idl so we can forward IRPC requests to internal winbind calls

Change-Id: Iba3913d5a1c7f851b93f37e9beb6dbb20fbf7e55
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos3-winbindd: Listen on IRPC and do forwarded DNS updates on an RODC
Andrew Bartlett [Tue, 6 May 2014 05:00:09 +0000 (17:00 +1200)]
s3-winbindd: Listen on IRPC and do forwarded DNS updates on an RODC

Change-Id: Ib87933c318f510d95f7008e122216d73803ede68
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos3-winbindd: Register winbindd with irpc
Andrew Bartlett [Tue, 6 May 2014 01:39:12 +0000 (13:39 +1200)]
s3-winbindd: Register winbindd with irpc

Change-Id: Ie3c7109fef6982d95e8cad06870334565352e329
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoauth: Provide a way to use the auth stack for winbindd authentication
Andrew Bartlett [Wed, 26 Mar 2014 23:58:05 +0000 (12:58 +1300)]
auth: Provide a way to use the auth stack for winbindd authentication

This adds in flags that allow winbindd to request authentication
without directly calling into the auth_sam module.

That in turn will allow winbindd to call auth_samba4 and so permit
winbindd operation in the AD DC.

Andrew Bartlett

Change-Id: I27d11075eb8e1a54f034ee2fdcb05360b4203567
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowinbindd: Call set_dc_type_and_flags on the internal domain
Andrew Bartlett [Fri, 16 May 2014 06:10:23 +0000 (18:10 +1200)]
winbindd: Call set_dc_type_and_flags on the internal domain

This allows the AD DC to be picked up correctly and gives the correct DNS name.

To ensure no confusion, we also always init it with the full DNS name.

It also means that, aside from the BUILTIN domain the initialized
flag is set only in one place, which will help when we add more details
to the domain structure in the future.

This in turn allows kerberos authentication against winbindd on the AD DC.

Andrew Bartlett

Change-Id: Idc829cfe5f2e867c87107b49275b17f294821dcd
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agodsdb: Do not refresh the schema using the wrong event context
Andrew Bartlett [Wed, 14 May 2014 08:12:03 +0000 (20:12 +1200)]
dsdb: Do not refresh the schema using the wrong event context

What we now do is have the refresh function and module be on a
seperate object to the schema, only referring to the data and
not excuting on the original ldb and event loop.

That is, we never use another ldb context when calling the
refresh function, by binding the refresh handler to the
ldb and not the schema.

Andrew Bartlett

Change-Id: I5c323dda743cf5858badd01147fda6227599bc16
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agodsdb: Do not store a struct ldb_dn in struct schema_data
Andrew Bartlett [Fri, 23 May 2014 04:06:17 +0000 (16:06 +1200)]
dsdb: Do not store a struct ldb_dn in struct schema_data

The issue is that the DN contains a pointer to the ldb it belongs to,
and if this is not kept around long enough, we might reference memory
after it is de-allocated.

Andrew Bartlett

Change-Id: I040a6c37a3164b3309f370e32e598dd56b1a1bbb
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agopassdb: Do not routinely clear the global memory returned by get_global_sam_sid()
Andrew Bartlett [Tue, 13 May 2014 05:47:03 +0000 (17:47 +1200)]
passdb: Do not routinely clear the global memory returned by get_global_sam_sid()

This avoids use-after-free errors and tdb database churn.

Andrew Bartlett

Change-Id: If7ab2e24556d9dffc7ad22c0489d665dd75a0cab
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
5 years agoctdb-eventscripts: New configuration variable CTDB_GANESHA_REC_SUBDIR
Martin Schwenke [Fri, 6 Jun 2014 05:25:28 +0000 (15:25 +1000)]
ctdb-eventscripts: New configuration variable CTDB_GANESHA_REC_SUBDIR

Backup and restore of the cluster filesystem can upset the operation
of 60.ganesha by changing the contents of this subdirectory.

Allow this subdirectory to be configured to a subdirectory that is
ignored by backup and restore processes.

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): Wed Jun 11 09:29:22 CEST 2014 on sn-devel-104

5 years agolibcli: Add a NULL check in dom_sid_string
Volker Lendecke [Tue, 3 Jun 2014 13:03:56 +0000 (13:03 +0000)]
libcli: Add a NULL check in dom_sid_string

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 10 21:46:15 CEST 2014 on sn-devel-104

5 years agoUse GUID_equal in a few places
Volker Lendecke [Thu, 5 Jun 2014 10:04:43 +0000 (10:04 +0000)]
Use GUID_equal in a few places

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibndr: Use GUID_compare in GUID_equal
Volker Lendecke [Thu, 5 Jun 2014 09:56:55 +0000 (09:56 +0000)]
libndr: Use GUID_compare in GUID_equal

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: libsmb: Change cli_disk_size() to use the trans2/SMB_FS_FULL_SIZE_INFORMATION...
Jeremy Allison [Wed, 4 Jun 2014 21:53:01 +0000 (14:53 -0700)]
s3: libsmb: Change cli_disk_size() to use the trans2/SMB_FS_FULL_SIZE_INFORMATION call in preference to the old SMB1 call.

Fallback to the old CORE protocol SMBdskattr if
trans2/SMB_FS_FULL_SIZE_INFORMATION is not supported.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun  7 05:41:44 CEST 2014 on sn-devel-104

5 years agos3: libsmb: Make cli_smb2_dskattr() a 64-bit interface.
Jeremy Allison [Wed, 4 Jun 2014 21:19:30 +0000 (14:19 -0700)]
s3: libsmb: Make cli_smb2_dskattr() a 64-bit interface.

Remove the fallback call from cli_dskattr() (now it's
not called from external client code).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
5 years agos3: libsmb : Move users of cli_dskattr to a 64-bit interface cli_disk_free().
Jeremy Allison [Wed, 4 Jun 2014 21:12:38 +0000 (14:12 -0700)]
s3: libsmb : Move users of cli_dskattr to a 64-bit interface cli_disk_free().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
5 years agolib: tevent: make TEVENT_SIG_INCREMENT atomic.
Jeremy Allison [Tue, 3 Jun 2014 17:44:19 +0000 (10:44 -0700)]
lib: tevent: make TEVENT_SIG_INCREMENT atomic.

On arm platforms incrementing a variable is not
an atomic operation, so may be interrupted by
signal processing (if a signal interrupts another
signal handler).

Use compiler built-ins to make this atomic.
__sync_fetch_and_add() works on gcc, llvm,
IBM xlC on AIX, and Intel icc (10.1 and
above).

atomic_add_32() works on Oracle Solaris.

Based on an inital patch from kamei@osstech.co.jp.

Bug #10640 - smbd is not responding - tevent_common_signal_handler() increments non-atomic variables

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
5 years agos3/s4: smbd, rpc, ldap, cldap, kdc services.
Jeremy Allison [Thu, 5 Jun 2014 19:32:30 +0000 (12:32 -0700)]
s3/s4: smbd, rpc, ldap, cldap, kdc services.

Allow us to start if we bind to *either* :: or 0.0.0.0.

Allows us to cope with systems configured as only IPv4
or only IPv6.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-By: Amitay Isaacs <amitay@gmail.com>
Reviewed-By: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun  7 01:01:44 CEST 2014 on sn-devel-104

5 years agoselftest: Add support for tmate.
Andreas Schneider [Thu, 5 Jun 2014 13:07:07 +0000 (15:07 +0200)]
selftest: Add support for tmate.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun  6 02:25:52 CEST 2014 on sn-devel-104

5 years agolib: Bump socket_wrapper version to 1.1.1.
Michael Adam [Thu, 5 Jun 2014 21:50:30 +0000 (23:50 +0200)]
lib: Bump socket_wrapper version to 1.1.1.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: Disable incomplete bind checks (and tests) for EADDRINUSE.
Andreas Schneider [Thu, 5 Jun 2014 21:38:59 +0000 (23:38 +0200)]
swrap: Disable incomplete bind checks (and tests) for EADDRINUSE.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolib: Bump socket_wrapper version to 1.1.0.
Andreas Schneider [Tue, 3 Jun 2014 13:15:34 +0000 (15:15 +0200)]
lib: Bump socket_wrapper version to 1.1.0.

5 years agoswrap: check whether an address:port is already in use in swrap_bind()
Michael Adam [Tue, 3 Jun 2014 13:14:44 +0000 (15:14 +0200)]
swrap: check whether an address:port is already in use in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: implement check_addr_port_in_use()
Michael Adam [Tue, 3 Jun 2014 13:13:59 +0000 (15:13 +0200)]
swrap: implement check_addr_port_in_use()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: fix AF_UNSPEC special case in swrap_bind()
Michael Adam [Tue, 3 Jun 2014 13:13:02 +0000 (15:13 +0200)]
swrap: fix AF_UNSPEC special case in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: extend input checks in swrap_bind()
Michael Adam [Tue, 3 Jun 2014 13:12:34 +0000 (15:12 +0200)]
swrap: extend input checks in swrap_bind()

Not only check family, but depending on family, also check the length.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: add check for rpc/rpc.h - needed on freebsd for bindresvport
Michael Adam [Tue, 3 Jun 2014 13:11:46 +0000 (15:11 +0200)]
swrap: add check for rpc/rpc.h - needed on freebsd for bindresvport

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: Add support for bindresvport().
Andreas Schneider [Tue, 3 Jun 2014 13:10:19 +0000 (15:10 +0200)]
swrap: Add support for bindresvport().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add missing family check in bind().
Andreas Schneider [Tue, 3 Jun 2014 13:08:57 +0000 (15:08 +0200)]
swrap: Add missing family check in bind().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Setup myname in swrap_socket() for getsockname().
Andreas Schneider [Tue, 3 Jun 2014 13:08:07 +0000 (15:08 +0200)]
swrap: Setup myname in swrap_socket() for getsockname().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Make sure cmbuf is not NULL.
Andreas Schneider [Tue, 3 Jun 2014 13:07:07 +0000 (15:07 +0200)]
swrap: Make sure cmbuf is not NULL.

CID 63532

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: We need to pass a pointer-pointer to not leak memory.
Andreas Schneider [Tue, 3 Jun 2014 13:06:33 +0000 (15:06 +0200)]
swrap: We need to pass a pointer-pointer to not leak memory.

CID 63533

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Support more socket options in getsockopt().
Andreas Schneider [Tue, 3 Jun 2014 13:05:56 +0000 (15:05 +0200)]
swrap: Support more socket options in getsockopt().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Call swrap_msghdr_filter_cmsghdr in swrap_sendmsg_before().
Andreas Schneider [Tue, 3 Jun 2014 13:05:12 +0000 (15:05 +0200)]
swrap: Call swrap_msghdr_filter_cmsghdr in swrap_sendmsg_before().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add swrap_msghdr_filter_cmsg_pktinfo().
Andreas Schneider [Tue, 3 Jun 2014 13:04:45 +0000 (15:04 +0200)]
swrap: Add swrap_msghdr_filter_cmsg_pktinfo().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add swrap_sendmsg_filter_cmsg_socket().
Andreas Schneider [Tue, 3 Jun 2014 13:04:18 +0000 (15:04 +0200)]
swrap: Add swrap_sendmsg_filter_cmsg_socket().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>