kai/samba-autobuild/.git
8 years agolib/param: add a fixed unified lpcfg_string_{free,set,set_upper}() infrastructure
Stefan Metzmacher [Sat, 28 Nov 2015 09:32:05 +0000 (10:32 +0100)]
lib/param: add a fixed unified lpcfg_string_{free,set,set_upper}() infrastructure

This reduces the memory footprint of empty string options.

smbd -d1 -i with 1400 shares in smb.conf under x64 valgrind massif before this
patch has 7,703,392 bytes peak memory consumption and after this patch
3,321,200 bytes.

This fixes a regression introduced by commit
2dd7c890792cf12049ec13b88aa4e9de23035f9d.

BUG:

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11625
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 30 17:41:28 CET 2015 on sn-devel-104

8 years agodocs: change pdbedit --set-nt-hash to be consistent
Garming Sam [Mon, 30 Nov 2015 01:39:38 +0000 (14:39 +1300)]
docs: change pdbedit --set-nt-hash to be consistent

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Mon Nov 30 06:54:11 CET 2015 on sn-devel-104

8 years agopassdb: Change ABI version to 0.24.2
Garming Sam [Mon, 30 Nov 2015 01:18:55 +0000 (14:18 +1300)]
passdb: Change ABI version to 0.24.2

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agopdb: add a blackbox test for setting password with hash
Garming Sam [Mon, 30 Nov 2015 01:24:06 +0000 (14:24 +1300)]
pdb: add a blackbox test for setting password with hash

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoAdd --set-nt-hash option to pdbedit to update user password from nt-hash hexstring.
Alberto Maria Fiaschi [Wed, 10 Jun 2015 13:26:58 +0000 (15:26 +0200)]
Add --set-nt-hash option to pdbedit to update user password from nt-hash hexstring.

Useful to take in sync password from other repository.
(Modify MASK_USER_GOOD to include new flag  BIT_PWSETNTHASH)

pdbedit -vw show also  password hashes .

Split pdb_set_plaintext_passwd  in two function:
pdb_set_plaintext_passwd and pdb_update_history.
pdb_update_history update password history and is call from
pdb_set_plaintext_passwd.

Signed-off-by: Alberto Maria Fiaschi <alberto.fiaschi@estar.toscana.it>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agos3:torture: add traverse testing to LOCAL-RBTREE
Stefan Metzmacher [Tue, 24 Nov 2015 23:13:17 +0000 (00:13 +0100)]
s3:torture: add traverse testing to LOCAL-RBTREE

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Nov 27 13:16:59 CET 2015 on sn-devel-104

8 years agodbwrap_rbt: fix modifying the db during traverse
Stefan Metzmacher [Wed, 25 Nov 2015 08:22:08 +0000 (09:22 +0100)]
dbwrap_rbt: fix modifying the db during traverse

We delete and add of records rebalace the tree, but our
traverse code doesn't handle that and skips records
randomly.

We maintain records in a linked list for now
in addition to the rbtree and use that list during
traverse.

This add a bit overhead, but at least it works reliable.
If someone finds a way to do reliable traverse with the
rebalanced tree, we can replace this commit.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agodbwrap_rbt: add nested traverse protection
Stefan Metzmacher [Wed, 25 Nov 2015 08:22:08 +0000 (09:22 +0100)]
dbwrap_rbt: add nested traverse protection

Multiple dbwrap_traverse_read() calls are possible.

store() and delete() on a fetch locked record
are rejected during dbwrap_traverse_read().

A dbwrap_traverse() within a dbwrap_traverse_read()
behaves like a dbwrap_traverse_read().

Nested dbwrap_traverse() calls are not possible.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agodbwrap_rbt: use talloc_zero_size() instead of a partial ZERO_STRUCT()
Stefan Metzmacher [Wed, 25 Nov 2015 09:17:34 +0000 (10:17 +0100)]
dbwrap_rbt: use talloc_zero_size() instead of a partial ZERO_STRUCT()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agodocs: Fix some typos in the idmap backend section.
Karolin Seeger [Thu, 26 Nov 2015 10:28:34 +0000 (11:28 +0100)]
docs: Fix some typos in the idmap backend section.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 26 14:47:17 CET 2015 on sn-devel-104

8 years agoctdb-protocol: Fix marshalling for struct ctdb_rec_data
Amitay Isaacs [Fri, 6 Nov 2015 06:07:35 +0000 (17:07 +1100)]
ctdb-protocol: Fix marshalling for struct ctdb_rec_data

If the header is specified, then the datalen should be incremented.

There are two ways of marshalling ctdb_rec_data:

1. ctdb_rec_data->header is NULL and ctdb_rec_data->data embeds both
   the header and the value. Used in recovery for push/pull of records.

2. ctdb_rec_data->header is not NULL and ctdb_rec_data->data embeds
   only the value.  Used everywhere else.

In both cases, the wire format includes the header and the value.
There is nothing in the wire format to inform the unmarshalling code
whether to extract the header separately or not.

In the current code the header is extracted depending on whether the
header argument to the extractor routine is NULL or not.  This is insane
and highly error-prone.

So in the new API, unmarshalling code never extracts the header.  If the
caller requires the header, then it can be extracted separately using
special function ctdb_ltdb_header_extract().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Nov 25 13:21:48 CET 2015 on sn-devel-104

8 years agoctdb-protocol: Add API to extract ctdb_ltdb_header from TDB_DATA
Amitay Isaacs [Tue, 10 Nov 2015 07:29:39 +0000 (18:29 +1100)]
ctdb-protocol: Add API to extract ctdb_ltdb_header from TDB_DATA

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoctdb-protocol: Fix marshalling of struct ctdb_public_ip_list
Amitay Isaacs [Fri, 6 Nov 2015 03:27:33 +0000 (14:27 +1100)]
ctdb-protocol: Fix marshalling of struct ctdb_public_ip_list

There can be 0 public addresses.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoctdb-protocol: Fix marshalling of struct ctdb_addr_info
Amitay Isaacs [Fri, 6 Nov 2015 02:06:26 +0000 (13:06 +1100)]
ctdb-protocol: Fix marshalling of struct ctdb_addr_info

ctdb_addr_info->iface can be NULL.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoctdb-protocol: Do not expect a reply for SHUTDOWN control
Amitay Isaacs [Thu, 5 Nov 2015 06:08:46 +0000 (17:08 +1100)]
ctdb-protocol: Do not expect a reply for SHUTDOWN control

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoctdb-protocol: Add marshalling for TDB_DATA
Amitay Isaacs [Mon, 9 Nov 2015 04:58:56 +0000 (15:58 +1100)]
ctdb-protocol: Add marshalling for TDB_DATA

This is required when ctdb client wants to send arbitrary data as part
of CTDB_REQ_MESSAGE.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoctdb-protocol: Add utility function ctdb_sock_addr_to_string
Amitay Isaacs [Mon, 2 Nov 2015 05:24:15 +0000 (16:24 +1100)]
ctdb-protocol: Add utility function ctdb_sock_addr_to_string

This is a duplicate function to ctdb_addr_to_str, but ctdb-util cannot
be linked with the code using new API mainly because it code in ctdb-util
requires struct ctdb_context.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoctdb-system: Use protocol/protocol.h instead of ctdb_private.h
Amitay Isaacs [Mon, 2 Nov 2015 05:03:29 +0000 (16:03 +1100)]
ctdb-system: Use protocol/protocol.h instead of ctdb_private.h

Since this code does not need any private structures defined in
ctdb_private.h, protocol/protocol.h should suffice.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoctdb-include: Make client header self contained
Amitay Isaacs [Mon, 2 Nov 2015 06:54:45 +0000 (17:54 +1100)]
ctdb-include: Make client header self contained

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoctdb-include: Make protocol headers self contained
Amitay Isaacs [Mon, 2 Nov 2015 05:01:13 +0000 (16:01 +1100)]
ctdb-include: Make protocol headers self contained

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos3: smbd: Tear down global_smbXsrv_client in the correct order.
Jeremy Allison [Tue, 24 Nov 2015 20:00:10 +0000 (12:00 -0800)]
s3: smbd: Tear down global_smbXsrv_client in the correct order.

The talloc heirarchy looks like this:

global_smbXsrv_client
    |                 |
    V                 V
    session_table    sconn
       |
       V
      session (destructor references global_smbXsrv_client->sconn)

So don't free global_smbXsrv_client->sconn before the
session destructor fires.

------------------------------------------------
6 <signal handler called>
7 0x00007f47ba82da1a in file_close_user (sconn=0x0, vuid=1584077283) at ../source3/smbd/files.c:250
8 0x00007f47ba922a74 in smbXsrv_session_logoff (session=0x7f47be8bbf80) at ../source3/smbd/smbXsrv_session.c:1404
9 0x00007f47ba921912 in smbXsrv_session_destructor (session=0x7f47be8bbf80) at ../source3/smbd/smbXsrv_session.c:1068
10 0x00007f47b784e2fc in _talloc_free_internal () from /usr/lib/libtalloc.so.2
11 0x00007f47b784f495 in _talloc_free_children_internal () from /usr/lib/libtalloc.so.2
12 0x00007f47b784e49f in _talloc_free_internal () from /usr/lib/libtalloc.so.2
13 0x00007f47b784f495 in _talloc_free_children_internal () from /usr/lib/libtalloc.so.2
14 0x00007f47b784e49f in _talloc_free_internal () from /usr/lib/libtalloc.so.2
15 0x00007f47b784f88e in _talloc_free () from /usr/lib/libtalloc.so.2
16 0x00007f47ba92b2f1 in exit_server_common (how=SERVER_EXIT_NORMAL, reason=0x0) at ../source3/smbd/server_exit.c:234
------------------------------------------------

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 25 03:40:46 CET 2015 on sn-devel-104

8 years agos3: docs: Fix "strict rename" doc to match code.
Jeremy Allison [Tue, 24 Nov 2015 16:45:50 +0000 (08:45 -0800)]
s3: docs: Fix "strict rename" doc to match code.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Nov 24 23:47:19 CET 2015 on sn-devel-104

8 years agos3: smbd: Change semantics of strict rename to search the file open db.
Jeremy Allison [Tue, 24 Nov 2015 16:43:14 +0000 (08:43 -0800)]
s3: smbd: Change semantics of strict rename to search the file open db.

Without strict rename just look in local process. POSIX renames are
already dealt with above.

Documentation change to follow.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agos3: smbd: have_file_open_below() fails to enumerate open files below an open director...
Jeremy Allison [Mon, 23 Nov 2015 22:00:56 +0000 (14:00 -0800)]
s3: smbd: have_file_open_below() fails to enumerate open files below an open directory handle.

There are three issues:

1). The memcmp checking that the open file path has the open
directory path as its parent compares using the wrong length
(it uses the full open file path which will never compare as
the same).

2). The files_below_forall() function doesn't fill in the
callback function or callback data when calling share_mode_forall(),
leading to a crash (which we never saw, as the previous issue (1)
meant the callback function would never be invoked).

3). When invoking the callback function from files_below_forall_fn()
we were passing in the wrong private_data pointer (needs to be
the one from the state, not the private_data passed into
files_below_forall_fn()).

Found when running the torture test smb2.rename.rename_dir_openfile
when fixing bug #11065.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Nov 24 19:36:20 CET 2015 on sn-devel-104

8 years agosmbd:dir: remove an extra empty line in files_below_forall()
Michael Adam [Tue, 24 Nov 2015 10:30:05 +0000 (11:30 +0100)]
smbd:dir: remove an extra empty line in files_below_forall()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Nov 24 15:59:47 CET 2015 on sn-devel-104

8 years agobuild:wafsamba: Ensure that check_group_ordering can be overridden
Thomas Nagy [Thu, 19 Nov 2015 00:55:43 +0000 (01:55 +0100)]
build:wafsamba: Ensure that check_group_ordering can be overridden

Group ordering verifications are performed by default in Waf 1.8,
so this method will be redundant. The purpose of this change is
to make it easier to disable check_group_ordering as it contains
code that is very specific to Waf 1.5.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov 24 08:03:29 CET 2015 on sn-devel-104

8 years agobuild:wafsamba: Ensure that target clones get a different name
Thomas Nagy [Thu, 19 Nov 2015 00:44:43 +0000 (01:44 +0100)]
build:wafsamba: Ensure that target clones get a different name

Changing the 'target' attribute results in a different file name,
which is visibly necessary. Yet the 'name' attribute should also
be modified even if invisible as it is used to query targets
(uselib for example). Failing to do so results in errors in Waf 1.8.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agobuild:wafsamba: Specify whether node objects or flat lists in ant_glob
Thomas Nagy [Thu, 19 Nov 2015 00:36:47 +0000 (01:36 +0100)]
build:wafsamba: Specify whether node objects or flat lists in ant_glob

The changes enable the ant_glob declaration to be compatible with
more recent versions of Waf.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agosamba-tool: replace use of os.popen
Uri Simchoni [Sun, 15 Nov 2015 11:34:03 +0000 (13:34 +0200)]
samba-tool: replace use of os.popen

The netcmd/domain.py module uses os.popen() on user-supplied
parameters. This opens up the way to code injection.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Mon Nov 23 22:19:34 CET 2015 on sn-devel-104

8 years agolibads: Fix picky const warning with krb5_set_password_using_ccache
Andreas Schneider [Tue, 6 Oct 2015 12:05:15 +0000 (14:05 +0200)]
libads: Fix picky const warning with krb5_set_password_using_ccache

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Nov 23 18:20:31 CET 2015 on sn-devel-104

8 years agogensec: Fix picky unused variable errors
Andreas Schneider [Tue, 6 Oct 2015 11:25:49 +0000 (13:25 +0200)]
gensec: Fix picky unused variable errors

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
8 years agoauth: Fix picky const warnings in gssapi_pac
Andreas Schneider [Tue, 6 Oct 2015 11:24:41 +0000 (13:24 +0200)]
auth: Fix picky const warnings in gssapi_pac

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
8 years agos4-auth: Fix picky unused variable warning
Andreas Schneider [Tue, 6 Oct 2015 11:03:41 +0000 (13:03 +0200)]
s4-auth: Fix picky unused variable warning

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
8 years agokrb5_wrap: Fix picky const compiler warnings
Andreas Schneider [Tue, 6 Oct 2015 11:03:19 +0000 (13:03 +0200)]
krb5_wrap: Fix picky const compiler warnings

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
8 years agoselftest: Fix Samba::bindir_path() with a valid directory.
Andreas Schneider [Mon, 12 May 2014 14:45:55 +0000 (16:45 +0200)]
selftest: Fix Samba::bindir_path() with a valid directory.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
8 years agodbwrap_tdb: Fix a typo
Volker Lendecke [Tue, 20 Oct 2015 12:00:54 +0000 (14:00 +0200)]
dbwrap_tdb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Nov 23 15:16:19 CET 2015 on sn-devel-104

8 years agoctdb-ipalloc: Drop unnecessary struct ctdb_ipflags
Martin Schwenke [Tue, 3 Nov 2015 05:41:55 +0000 (16:41 +1100)]
ctdb-ipalloc: Drop unnecessary struct ctdb_ipflags

This can be easily decomposed into 2 separate arrays.

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): Mon Nov 23 05:34:55 CET 2015 on sn-devel-104

8 years agoctdb-ipalloc: Move memory allocation into ipalloc_state_init()
Martin Schwenke [Tue, 3 Nov 2015 05:36:34 +0000 (16:36 +1100)]
ctdb-ipalloc: Move memory allocation into ipalloc_state_init()

This puts all of the memory allocation for ipalloc_state into its init
function.  This also simplifies the code because
set_ipflags_internal() can no longer fail because it no longer
allocates memory.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: Have set_ipflags_internal() set ipalloc_state->ipflags
Martin Schwenke [Tue, 3 Nov 2015 05:30:23 +0000 (16:30 +1100)]
ctdb-ipalloc: Have set_ipflags_internal() set ipalloc_state->ipflags

This is cleaner than returning ipflags and assigning them into
ipalloc_state afterwards.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: Fold IP flags into IP allocation state
Martin Schwenke [Mon, 2 Nov 2015 05:50:05 +0000 (16:50 +1100)]
ctdb-ipalloc: Fold IP flags into IP allocation state

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: Use number of nodes from IP allocation state
Martin Schwenke [Tue, 3 Nov 2015 04:29:30 +0000 (15:29 +1100)]
ctdb-ipalloc: Use number of nodes from IP allocation state

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: Allocate memory off IP allocation state
Martin Schwenke [Tue, 3 Nov 2015 04:26:34 +0000 (15:26 +1100)]
ctdb-ipalloc: Allocate memory off IP allocation state

Instead of local or passed temporary contexts.

This has the side effect of making ipalloc_state available inside the
modified functions, making future use of ipalloc_state simpler.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: Add error handling to IP allocation
Martin Schwenke [Fri, 30 Oct 2015 00:47:22 +0000 (11:47 +1100)]
ctdb-ipalloc: Add error handling to IP allocation

The only likely failure is out of memory, so just return boolean
value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: Drop CTDB context argument from set_ipflags_internal()
Martin Schwenke [Fri, 30 Oct 2015 19:48:23 +0000 (06:48 +1100)]
ctdb-ipalloc: Drop CTDB context argument from set_ipflags_internal()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agosamba-tool:provision: fix bug 11600
Rowland Penny [Mon, 16 Nov 2015 16:22:31 +0000 (16:22 +0000)]
samba-tool:provision: fix bug 11600

If you join a second DC after changing the name of
the 'Default Domain Policy' or 'Default Domain Controllers
Policy' the join will fail as the search is hardcoded to
these names, this fix changes the search to the objects name.

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

Signed-off-by: Rowland Penny <repenny241155@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat Nov 21 04:44:58 CET 2015 on sn-devel-104

8 years agoctdb-scripts: Drop creation of database directories
Martin Schwenke [Wed, 18 Nov 2015 21:35:17 +0000 (08:35 +1100)]
ctdb-scripts: Drop creation of database directories

These should be created elsewhere.  If not then something is wrong, so
don't hide the problem.

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 Nov 20 04:40:26 CET 2015 on sn-devel-104

8 years agoctdb-ipalloc: ctdb_takeover_run_core() takes ipalloc_state
Martin Schwenke [Thu, 29 Oct 2015 10:08:07 +0000 (21:08 +1100)]
ctdb-ipalloc: ctdb_takeover_run_core() takes ipalloc_state

As do the functions called below it.  They no longer need a CTDB
context.

create_merged_ip_list() now takes both a CTDB context and an
ipalloc_state.

Drop ipalloc_state from CTDB context.  So the substitution in the
code is:

  ctdb->ipalloc_state  ->  ipalloc_state

Tweak the test code to match.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: Tidy up create_merged_ip_list()
Martin Schwenke [Thu, 29 Oct 2015 09:46:54 +0000 (20:46 +1100)]
ctdb-ipalloc: Tidy up create_merged_ip_list()

Simplify with TALLOC_FREE() and fix some whitespace.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: Move IP list creation out to ctdb_takeover_run()
Martin Schwenke [Wed, 28 Oct 2015 10:17:47 +0000 (21:17 +1100)]
ctdb-ipalloc: Move IP list creation out to ctdb_takeover_run()

For various reasons create_merged_ip_list() needs a CTDB context.
This is difficult to resolve now for a few reasons, including:

* The ip_tree needs somewhere to live.

  It isn't very useful in its current form.  However, in the future
  real remote IP monitoring will probably be added back, so leave it
  around.

* It uses node flags from the ctdb_node structure.

  This could be changed by putting a node map into ipalloc_state
  and referencing that.

For now, it is easier to move it out to where there will be a CTDB
context available for the forseeable future.  ctdb_takeover_run() will
need one as long as the current client interface is used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: Add no_ip_failback to ipalloc_state
Martin Schwenke [Thu, 29 Oct 2015 08:53:25 +0000 (19:53 +1100)]
ctdb-ipalloc: Add no_ip_failback to ipalloc_state

The IP allocation algorithms need the value of this tunable, so copy
it to avoid needing the CTDB context.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: New enum ipalloc_algorithm in ipalloc_state
Martin Schwenke [Thu, 29 Oct 2015 08:41:10 +0000 (19:41 +1100)]
ctdb-ipalloc: New enum ipalloc_algorithm in ipalloc_state

Algorithm-related tunables from the CTDB context no longer need to be
accessed in the allocation logic.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: Move IP allocation state into its own struct
Martin Schwenke [Thu, 29 Oct 2015 05:49:44 +0000 (16:49 +1100)]
ctdb-ipalloc: Move IP allocation state into its own struct

Most of the IP allocation code does not need a CTDB context.  However,
temporarily hang this off the CTDB context and make only the changes
relating to known/available IP address.  This makes those logic
changes obvious without burying them in function type changes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-ipalloc: node_ip_coverage() doesn't need CTDB context
Martin Schwenke [Wed, 28 Oct 2015 11:59:18 +0000 (22:59 +1100)]
ctdb-ipalloc: node_ip_coverage() doesn't need CTDB context

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoselftest: add test for force user and well-known primary group
Uri Simchoni [Tue, 17 Nov 2015 21:14:36 +0000 (23:14 +0200)]
selftest: add test for force user and well-known primary group

Add a test for connecting to a share with a "force user" whos
primary unix gid maps to a well-known alias.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Nov 19 23:20:36 CET 2015 on sn-devel-104

8 years agoauth: consistent handling of well-known alias as primary gid
Uri Simchoni [Tue, 17 Nov 2015 21:05:10 +0000 (23:05 +0200)]
auth: consistent handling of well-known alias as primary gid

When a local user has its primary group id mapped to a well-known
alias or a builtin group, smbd accepts logins of such a user, but
fails tree-connects to shares with a "force user" set to this user
with an error of NT_STATUS_INVALID_SID.

This fix causes the connect to succeed and the NT token to resemble
the token that would have been created in a login.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoauth: remove a line that has no effect
Uri Simchoni [Tue, 17 Nov 2015 19:43:44 +0000 (21:43 +0200)]
auth: remove a line that has no effect

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agowinbind: Don't crash on invalid idmap configs
Volker Lendecke [Thu, 19 Nov 2015 16:00:49 +0000 (17:00 +0100)]
winbind: Don't crash on invalid idmap configs

We should not leave NULL in idmap_domains[]. This will lead to NULL
ptr deferences in idmap_find_domain().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11612
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 19 20:16:44 CET 2015 on sn-devel-104

8 years agobuild:wafsamba: remove check_orphaned_targets
Thomas Nagy [Sat, 14 Nov 2015 14:23:27 +0000 (15:23 +0100)]
build:wafsamba: remove check_orphaned_targets

The function check_orphaned_targets is not used and has
no specification, so it can be removed safely.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-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 Nov 19 13:10:53 CET 2015 on sn-devel-104

8 years agolib: Fix memalign_array overflow protection
Volker Lendecke [Wed, 18 Nov 2015 12:13:57 +0000 (13:13 +0100)]
lib: Fix memalign_array overflow protection

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 19 10:05:08 CET 2015 on sn-devel-104

8 years agoidl: Some CC can't find indented #defines
Volker Lendecke [Mon, 16 Nov 2015 15:23:10 +0000 (16:23 +0100)]
idl: Some CC can't find indented #defines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agoidl: Avoid // style comments
Volker Lendecke [Mon, 16 Nov 2015 15:11:48 +0000 (16:11 +0100)]
idl: Avoid // style comments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agolibreplace: Only check for malloc.h if needed
Volker Lendecke [Mon, 30 Jun 2014 13:46:21 +0000 (15:46 +0200)]
libreplace: Only check for malloc.h if needed

OpenBSD complains that malloc.h is deprecated on every gcc invocation.
That hides a lot of real warnings. malloc and friends nowadays are
typically defined in stdlib.h, only check there.

We need memalign. On OpenBSD this does not exist, so libreplace replaces
it. The wscript test in libreplace only checks whether memalign can
link. Unfortunately in glibc memalign comes from malloc.h.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agolibreplace: Put the malloc.h check on a line of its own
Volker Lendecke [Mon, 30 Jun 2014 13:15:37 +0000 (15:15 +0200)]
libreplace: Put the malloc.h check on a line of its own

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agolibreplace: Only check malloc.h once
Volker Lendecke [Mon, 30 Jun 2014 11:52:02 +0000 (13:52 +0200)]
libreplace: Only check malloc.h once

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agoSet LD_LIBRARY_PATH during tests.
Jelmer Vernooij [Wed, 18 Nov 2015 02:59:37 +0000 (02:59 +0000)]
Set LD_LIBRARY_PATH during tests.

Without this, tests fail ir libtevent is not installed on the system.

Signed-Off-By: Jelmer Vernooij <jelmer@jelmer.uk>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 18 21:40:26 CET 2015 on sn-devel-104

8 years agolib: tevent: Whitespace cleanup.
Jeremy Allison [Tue, 17 Nov 2015 17:13:41 +0000 (09:13 -0800)]
lib: tevent: Whitespace cleanup.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Nov 18 15:54:03 CET 2015 on sn-devel-104

8 years agolib: tevent: Fix bug in poll backend - poll_event_loop_poll()
Jeremy Allison [Tue, 17 Nov 2015 18:28:50 +0000 (10:28 -0800)]
lib: tevent: Fix bug in poll backend - poll_event_loop_poll()

If the (pfd->revents & POLLNVAL) case is triggered,
we do DLIST_REMOVE(ev->fd_events, fde); and then
use fde->next in the loop above.

Save off fde->next for loop interation before
this so we can't use a deleted ->next value.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agoctdb-scripts: Fix CTDB_DBDIR=tmpfs support
Martin Schwenke [Tue, 17 Nov 2015 03:57:44 +0000 (14:57 +1100)]
ctdb-scripts: Fix CTDB_DBDIR=tmpfs support

Various scripts (including debug_locks.sh, 00.ctdb, 05.system) need
CTDB_DBDIR to point to the right place... but it doesn't.

Move the rewriting of CTDB_DBDIR to loadconfig() so that it happens
for all scripts.  Have this code set internal variable
CTDB_DBDIR_TMPFS_OPTIONS so that ctdbd_wrapper can do the mount.

This loses the generality that was present in dbdir_tmpfs_start() but
it wasn't being used anyway.  If it is needed in the future then it
will be in the git history.

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 Nov 18 11:51:54 CET 2015 on sn-devel-104

8 years agoctdb: Remove unused ctdb_set_process_name
Christof Schmitt [Wed, 23 Sep 2015 23:11:51 +0000 (16:11 -0700)]
ctdb: Remove unused ctdb_set_process_name

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Nov 18 07:12:50 CET 2015 on sn-devel-104

8 years agoctdb: Use prctl_set_comment from lib/util
Christof Schmitt [Wed, 23 Sep 2015 23:10:59 +0000 (16:10 -0700)]
ctdb: Use prctl_set_comment from lib/util

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agolib/util: Move util_process from util to util-core
Christof Schmitt [Wed, 23 Sep 2015 23:02:27 +0000 (16:02 -0700)]
lib/util: Move util_process from util to util-core

Make the common prctl_set_comment function available to both ctdb
builds.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agolibcli/smb: Use helper function for finding session
Christof Schmitt [Wed, 21 Oct 2015 19:04:47 +0000 (12:04 -0700)]
libcli/smb: Use helper function for finding session

This removes some duplicated code.

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 Nov 18 04:04:17 CET 2015 on sn-devel-104

8 years agosmbd: Simplify check_access()
Volker Lendecke [Tue, 17 Nov 2015 14:19:31 +0000 (15:19 +0100)]
smbd: Simplify check_access()

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 Nov 17 22:58:10 CET 2015 on sn-devel-104

8 years agosmbd: Use check_access_fsp where appropriate
Volker Lendecke [Tue, 17 Nov 2015 14:13:41 +0000 (15:13 +0100)]
smbd: Use check_access_fsp where appropriate

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosmbd: Factor out check_access_fsp() from check_access()
Volker Lendecke [Tue, 17 Nov 2015 14:10:42 +0000 (15:10 +0100)]
smbd: Factor out check_access_fsp() from check_access()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosmbd: Refactor check_access()
Volker Lendecke [Tue, 17 Nov 2015 13:57:50 +0000 (14:57 +0100)]
smbd: Refactor check_access()

This is a micro-patch to make the next ones just obvious

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosmbd: Early return from dos_mode_debug_print
Volker Lendecke [Tue, 17 Nov 2015 12:49:30 +0000 (13:49 +0100)]
smbd: Early return from dos_mode_debug_print

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosmbd: Add hex value to dos_mode_debug_print
Volker Lendecke [Tue, 17 Nov 2015 12:44:30 +0000 (13:44 +0100)]
smbd: Add hex value to dos_mode_debug_print

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosmbd: Use dos_mode_debug_print in get_ea_dos_attribute
Volker Lendecke [Tue, 17 Nov 2015 12:43:10 +0000 (13:43 +0100)]
smbd: Use dos_mode_debug_print in get_ea_dos_attribute

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosmbd: Use dos_mode_debug_print in dos_mode_from_sbuf
Volker Lendecke [Tue, 17 Nov 2015 12:41:29 +0000 (13:41 +0100)]
smbd: Use dos_mode_debug_print in dos_mode_from_sbuf

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosmbd: Use dos_mode_debug_print in dos_mode_msdfs
Volker Lendecke [Tue, 17 Nov 2015 12:37:14 +0000 (13:37 +0100)]
smbd: Use dos_mode_debug_print in dos_mode_msdfs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosmbd: Streamline dos_mode_debug_print
Volker Lendecke [Tue, 17 Nov 2015 12:21:13 +0000 (13:21 +0100)]
smbd: Streamline dos_mode_debug_print

One line per flag is a bit overkill

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos4-backupkey: Don't use deprecated data structures
Andreas Schneider [Wed, 11 Nov 2015 10:49:12 +0000 (11:49 +0100)]
s4-backupkey: Don't use deprecated data structures

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Nov 17 19:52:33 CET 2015 on sn-devel-104

8 years agos4-torture: Rename issuer unique id in backupkey test
Andreas Schneider [Thu, 12 Nov 2015 10:35:39 +0000 (11:35 +0100)]
s4-torture: Rename issuer unique id in backupkey test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agos3-vfs_snapper: Fix a possible use without init warning
Andreas Schneider [Fri, 13 Nov 2015 13:14:10 +0000 (14:14 +0100)]
s3-vfs_snapper: Fix a possible use without init warning

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agos4-param: Make sure newname is not used uninitialized
Andreas Schneider [Fri, 13 Nov 2015 12:40:25 +0000 (13:40 +0100)]
s4-param: Make sure newname is not used uninitialized

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agosmbd: Move a message_send_all to the cleanupd
Volker Lendecke [Mon, 16 Nov 2015 07:11:20 +0000 (08:11 +0100)]
smbd: Move a message_send_all to the cleanupd

message_send_all traverses serverid.tdb, which can be expensive

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 16 17:55:36 CET 2015 on sn-devel-104

8 years agosmbd: Move cleanupd revalidate to a separate fn
Volker Lendecke [Mon, 16 Nov 2015 07:08:46 +0000 (08:08 +0100)]
smbd: Move cleanupd revalidate to a separate fn

Simple preparation for the next patch...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agosmbd: Move brl_validate to the cleanupd
Volker Lendecke [Sat, 7 Nov 2015 19:18:52 +0000 (20:18 +0100)]
smbd: Move brl_validate to the cleanupd

This walks brlock.tdb, which can be time-consuming.

This adds a new includes.h include. It's too much of a pain for me now to
make locking/proto.h clean to include on its own.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agosmbd: Move serverid_deregister() to the cleanupd
Volker Lendecke [Fri, 6 Nov 2015 16:01:02 +0000 (17:01 +0100)]
smbd: Move serverid_deregister() to the cleanupd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agosmbd: Move messaging_cleanup() to the cleanupd
Volker Lendecke [Fri, 6 Nov 2015 14:32:46 +0000 (15:32 +0100)]
smbd: Move messaging_cleanup() to the cleanupd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agosmbd: Move smbprofile_cleanup() to the cleanupd
Volker Lendecke [Fri, 6 Nov 2015 14:21:59 +0000 (15:21 +0100)]
smbd: Move smbprofile_cleanup() to the cleanupd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agosmbprofile: Add dst pid to smbprofile_cleanup
Volker Lendecke [Fri, 6 Nov 2015 13:55:35 +0000 (14:55 +0100)]
smbprofile: Add dst pid to smbprofile_cleanup

The consolidation will soon be done by a separate process. We need to
avoid the getpid() call in smbprofile_cleanup().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agosmbd: Implement a cleanup daemon
Volker Lendecke [Mon, 2 Nov 2015 11:47:13 +0000 (12:47 +0100)]
smbd: Implement a cleanup daemon

We do way too much stuff in the parent smbd in remove_child_pid(). In
particular accessing ctdbd is not a good idea when ctdbd is stuck in something.
We've had a case where smbd exited itself with "ctdb timeout" being set to 60
seconds. ctdb was just stuck doing recoveries, and the parent smbd was sitting
in serverid_exists trying to retrieve a record for a child that had exited. Not
good.

This daemon sits there as parent->cleanupd and receives MSG_SMB_NOTIFY_CLEANUP
messages that hold the serverid and exit status of a former child. The next
commits will step by step empty remove_child_pid in the parent and move the
tasks to the helper.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agobuild:wafsamba: Waf 1.8 compatible declaration of 'mandatory' configuration tests
Thomas Nagy [Wed, 11 Nov 2015 23:27:31 +0000 (00:27 +0100)]
build:wafsamba: Waf 1.8 compatible declaration of 'mandatory' configuration tests

The configuration tests raise exceptions by default in later Waf versions,
but the samba tests do not specify whether the errors should be raised or
not. This changes lifts the ambiguity.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov 16 14:50:39 CET 2015 on sn-devel-104

8 years agobuild:wafsamba: Install named.conf only once
Thomas Nagy [Sun, 8 Nov 2015 17:50:55 +0000 (18:50 +0100)]
build:wafsamba: Install named.conf only once

The wildcard *.conf already lists named.conf. Adding files
more than once will cause unnecessary rebuilds and raise
errors in later Waf versions.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agobuild:wafsamba: Replace Options.is_install by bld.is_install
Thomas Nagy [Fri, 6 Nov 2015 23:57:36 +0000 (00:57 +0100)]
build:wafsamba: Replace Options.is_install by bld.is_install

Options.is_install is a deprecated module variable that is more
verbose than bld.is_install and complicates the Waf 1.8 upgrade.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoctdb-recoverd: Factor out recovery master validation
Martin Schwenke [Tue, 27 Oct 2015 05:43:07 +0000 (16:43 +1100)]
ctdb-recoverd: Factor out recovery master validation

Starting to untangle cluster management, database recovery and public
IP allocation.  This is a non-trivial subset of the cluster management
code that runs in the recovery daemon on all nodes.

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): Mon Nov 16 11:47:45 CET 2015 on sn-devel-104

8 years agoctdb-recmaster: Update capabilities before calling first election
Martin Schwenke [Tue, 27 Oct 2015 04:09:33 +0000 (15:09 +1100)]
ctdb-recmaster: Update capabilities before calling first election

Capabilities are used when computing an election result so having them
up-to-date seems like a good idea.

Also update several instances of an ambiguous comment.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-recoverd: Move VNN map retrieval to where it is needed
Martin Schwenke [Tue, 27 Oct 2015 03:35:09 +0000 (14:35 +1100)]
ctdb-recoverd: Move VNN map retrieval to where it is needed

The VNN map is only needed on the recovery master, so no need for all
recovery daemons to retrieve it.

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