ira/samba-autobuild/.git
2 years agobuildscripts: Fix the regression with --without-acl-support. master origin/HEAD origin/master
Ira Cooper [Tue, 26 Jul 2016 15:44:47 +0000 (11:44 -0400)]
buildscripts: Fix the regression with --without-acl-support.

This will disable the vfs_glusterfs and vfs_cephfs modules if
you provide --without-acl-support.

In addition it makes compiling in POSIXACL_XATTR conditional
on vfs_glusterfs or vfs_cephfs being built in.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Steve French <sfrench@samba.org>
Tested-by: Steve French <sfrench@samba.org>
2 years agosource3/wscript: Add support for disabling vfs_cephfs
Ira Cooper [Tue, 26 Jul 2016 15:22:43 +0000 (11:22 -0400)]
source3/wscript: Add support for disabling vfs_cephfs

--enable-cephfs and --disable-cephfs both work now.

--enable-cephfs is the default to match previous
versions of Samba.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Steve French <sfrench@samba.org>
Tested-by: Steve French <sfrench@samba.org>
2 years agoVERSION: Bump version up to 4.6.0pre1
Stefan Metzmacher [Wed, 27 Jul 2016 13:07:03 +0000 (15:07 +0200)]
VERSION: Bump version up to 4.6.0pre1

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul 28 13:51:06 CEST 2016 on sn-devel-144

2 years agoVERSION: Set version to 4.5.0rc1...
Stefan Metzmacher [Wed, 27 Jul 2016 05:16:37 +0000 (07:16 +0200)]
VERSION: Set version to 4.5.0rc1...

and disable git snapshots for 4.5.0rc1 release.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 years agoWHATSNEW: add shadow:snapprefix and shadow:delimiter
Stefan Metzmacher [Thu, 28 Jul 2016 07:42:38 +0000 (09:42 +0200)]
WHATSNEW: add shadow:snapprefix and shadow:delimiter

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2 years agoshadow_copy2: Fix error handling in shadow_copy2_get_shadow_copy_data
Rajesh Joseph [Thu, 21 Jul 2016 09:58:43 +0000 (09:58 +0000)]
shadow_copy2: Fix error handling in shadow_copy2_get_shadow_copy_data

Memory was freed in most of the failure cases. It is always better
to free the memory at the end of the function so that all exit path
of the function will free the memory. Otherwise chances are that
you might miss some cleanup.

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2 years agoshadow_copy2: update man pages for the newly introduced options
Rajesh Joseph [Tue, 12 Jul 2016 11:01:32 +0000 (11:01 +0000)]
shadow_copy2: update man pages for the newly introduced options

shadow:snapprefix and shadow:delimiter are the two newly added options
in shadow copy. Update man pages explaining the two options.

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2 years agoshadow_copy2: Add test case for snapprefix and delimiter
Rajesh Joseph [Wed, 13 Jul 2016 16:15:27 +0000 (16:15 +0000)]
shadow_copy2: Add test case for snapprefix and delimiter

Add test case for the newly addded option shadow:snapprefix
and shadow:delimiter

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2 years agoshadow_copy2: allow configurable prefix for snapshot name
Rajesh Joseph [Wed, 13 Jul 2016 18:59:18 +0000 (18:59 +0000)]
shadow_copy2: allow configurable prefix for snapshot name

With growing number of snapshots file-systems need some mechanism
to differentiate one set of snapshots from other, e.g. monthly, weekly,
manual, special events, etc. Therefore these file-systems provide
different ways to tag snapshots, e.g. provide a configurable way to
name snapshots, which is not just based on time. With only shadow:format
it is very difficult to filter these snapshots.

As part of this change added two new options, shadow:snapprefix and
shadow:delimiter, in shadow_copy2 config. This option will accept regular
expression (BRE) as input. With this optional parameter, one can specify a
variable prefix component for names of the snapshot directories in the
file-system. If this parameter is set, together with the shadow:format and
shadow:delimiter parameters it determines the possible names of snapshot
directories in the file-system.

e.g.
shadow:snapprefix = [a-z]*[0-9]

When this option is provided then shadow:format option should always
start with <delimiter> string. This delimiter is configurable via a new option,
i.e. shadow:delimiter. Default value for this is "_GMT",
e.g. _GMT-%Y.%m.%d-%H.%M.%S

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2 years agoshadow_copy2: create structure to store module specific information
Rajesh Joseph [Mon, 11 Jul 2016 11:27:37 +0000 (11:27 +0000)]
shadow_copy2: create structure to store module specific information

Create a separate structure to store module specific information. Currently
only config values are saved. As of now there is no cleaner way to store run-time
information or other module specific information in shadow_copy2 module.

Therefore created a new structure to store all module specific information
including config.

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2 years agoshadow_copy2: Add test cases to cover shadow:format
Rajesh Joseph [Tue, 12 Jul 2016 09:33:29 +0000 (09:33 +0000)]
shadow_copy2: Add test cases to cover shadow:format

Added test cases which will filter snapshot names based
on shadow:format option in smb.conf

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2 years agoshadow_copy2: Fix shadow_copy2_posix_gmt_string return type
Rajesh Joseph [Mon, 11 Jul 2016 12:28:46 +0000 (12:28 +0000)]
shadow_copy2: Fix shadow_copy2_posix_gmt_string return type

This function returns -1 on error but the return type is
size_t which is unsigned.

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2 years agoldb: version 1.1.27
Stefan Metzmacher [Tue, 26 Jul 2016 18:30:04 +0000 (20:30 +0200)]
ldb: version 1.1.27

* performance improvements
* VLV control improvements
* build fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoldb: Use ldb_unpack_data_only_attr_list_flags in re_index()
Andrew Bartlett [Tue, 26 Jul 2016 23:21:43 +0000 (11:21 +1200)]
ldb: Use ldb_unpack_data_only_attr_list_flags in re_index()

This avoids allocation of every value during a re-index scan

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoldb: fix compiler warnings on ldb_unpack_data() arguments
Stefan Metzmacher [Tue, 26 Jul 2016 19:16:46 +0000 (21:16 +0200)]
ldb: fix compiler warnings on ldb_unpack_data() arguments

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoldb: Add flags to ltdb_search_dn1() to control memory allocation
Andrew Bartlett [Tue, 26 Jul 2016 12:20:27 +0000 (00:20 +1200)]
ldb: Add flags to ltdb_search_dn1() to control memory allocation

This is used in the index code in particular to avoid an allocation per value
(as there may be one value per DB object at times

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoldb: Prepare for adding flags to ltdb_search_dn1() to control memory allocation
Andrew Bartlett [Tue, 26 Jul 2016 12:20:27 +0000 (00:20 +1200)]
ldb: Prepare for adding flags to ltdb_search_dn1() to control memory allocation

Because the memory layout will change in the next commit, we need to add
a talloc_steal() of msg, which holds the memory on one big chunk.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoldb: Add ldb_unpack_data_only_attr_list_flags()
Andrew Bartlett [Tue, 26 Jul 2016 12:17:36 +0000 (00:17 +1200)]
ldb: Add ldb_unpack_data_only_attr_list_flags()

This function allows us to control allocation of memory during parse
of the packed ldb data.

This in turn can have an important performance impact as each
small allocation can have a large overhead

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoldb: Free empty index lists as talloc_realloc() fails in this case
Andrew Bartlett [Tue, 26 Jul 2016 22:26:56 +0000 (10:26 +1200)]
ldb: Free empty index lists as talloc_realloc() fails in this case

talloc_realloc() requires that we know the correct parent to do the 0 -> free behaviour
and we do not have the correct parent here, list->dn may be a child of the module->idxptr
cache.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoldb_tdb index: fix whitespace
Douglas Bagnall [Wed, 20 Jul 2016 01:35:58 +0000 (13:35 +1200)]
ldb_tdb index: fix whitespace

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotorture: Add tests for ndr_push_struct_into_fixed_blob()
Andrew Bartlett [Mon, 25 Jul 2016 03:34:39 +0000 (15:34 +1200)]
torture: Add tests for ndr_push_struct_into_fixed_blob()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agodsdb: Limit potential stack use when parsing extended DNs
Andrew Bartlett [Mon, 27 Jun 2016 00:35:24 +0000 (12:35 +1200)]
dsdb: Limit potential stack use when parsing extended DNs

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agolib/ldb-samba: Avoid talloc() in ldif_read_objectSid() by parsing the SID string...
Andrew Bartlett [Mon, 27 Jun 2016 00:18:37 +0000 (12:18 +1200)]
lib/ldb-samba: Avoid talloc() in ldif_read_objectSid() by parsing the SID string on the stack

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agolib/ldb-samba: Use ndr_push_struct_into_fixed_blob() in ldif_handlers.c
Andrew Bartlett [Sun, 26 Jun 2016 22:52:55 +0000 (10:52 +1200)]
lib/ldb-samba: Use ndr_push_struct_into_fixed_blob() in ldif_handlers.c

This avoids a number of pointless and pointlessly-large allocations
in inner loops.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agolibrpc: Add ndr_push_struct_into_fixed_blob() and use it in GUID_to_ndr_blob()
Andrew Bartlett [Fri, 17 Jun 2016 01:29:51 +0000 (13:29 +1200)]
librpc: Add ndr_push_struct_into_fixed_blob() and use it in GUID_to_ndr_blob()

This allows us to allocate only the correct size, not a default of 1024 bytes
per push.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agoWHATSNEW: document new samba-tool drs replicate options
Stefan Metzmacher [Thu, 28 Jul 2016 06:40:51 +0000 (08:40 +0200)]
WHATSNEW: document new samba-tool drs replicate options

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@samba.org>
2 years agotests:samba_tool_drs: test samba-tool drs replicate with --async-op
Stefan Metzmacher [Thu, 28 Jul 2016 06:29:39 +0000 (08:29 +0200)]
tests:samba_tool_drs: test samba-tool drs replicate with --async-op

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@samba.org>
2 years agotests:samba_tool_drs: test samba-tool drs replicate with implicit machine credentials
Stefan Metzmacher [Thu, 28 Jul 2016 06:29:39 +0000 (08:29 +0200)]
tests:samba_tool_drs: test samba-tool drs replicate with implicit machine credentials

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@samba.org>
2 years agosamba-tool: add --async-rep option to 'samba-tool drs replicate'
Stefan Metzmacher [Thu, 28 Jul 2016 05:50:03 +0000 (07:50 +0200)]
samba-tool: add --async-rep option to 'samba-tool drs replicate'

We may not want to wait for the replication to finish.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@samba.org>
2 years agosamba-tool: use a timeout of 5 minutes in 'samba-tool drs replicate'
Stefan Metzmacher [Thu, 28 Jul 2016 05:48:44 +0000 (07:48 +0200)]
samba-tool: use a timeout of 5 minutes in 'samba-tool drs replicate'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@samba.org>
2 years agos4:pyrpc: correctly implement .request_timeout
Stefan Metzmacher [Thu, 28 Jul 2016 04:36:05 +0000 (06:36 +0200)]
s4:pyrpc: correctly implement .request_timeout

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@samba.org>
2 years agorpc_server/drsuapi: Don't set msDS_IntId as attid for linked attributes if schema
Garming Sam [Wed, 27 Jul 2016 02:22:39 +0000 (14:22 +1200)]
rpc_server/drsuapi: Don't set msDS_IntId as attid for linked attributes if schema

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agogetncchanges: Set is_schema_nc when EXOP_OBJ
Garming Sam [Wed, 27 Jul 2016 03:51:47 +0000 (15:51 +1200)]
getncchanges: Set is_schema_nc when EXOP_OBJ

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agomsds_intid: Add test for schema linked attributes
Garming Sam [Tue, 26 Jul 2016 04:57:24 +0000 (16:57 +1200)]
msds_intid: Add test for schema linked attributes

This test only covers the forward link case.

NOTE: We can't confirm this against Windows because they prevent us from
modifying the schema for the schema classes.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoreplmd: Send replicated update OID for forward links
Garming Sam [Wed, 27 Jul 2016 01:06:09 +0000 (13:06 +1200)]
replmd: Send replicated update OID for forward links

(The backward link case needs to be tested)

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoreplmd: Remove data field on DSDB_CONTROL_REPLICATED_UPDATE_OID
Garming Sam [Wed, 27 Jul 2016 04:09:22 +0000 (16:09 +1200)]
replmd: Remove data field on DSDB_CONTROL_REPLICATED_UPDATE_OID

There were no users of the data, and it added additional complexity

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agorpc_server/drsuapi: Set msDS_IntId as attid for linked attributes if exists
Evgeny Sinelnikov [Tue, 29 Mar 2016 15:37:40 +0000 (18:37 +0300)]
rpc_server/drsuapi: Set msDS_IntId as attid for linked attributes if exists

We got WERR_DS_DRA_SCHEMA_MISMATCH for linked attributes with 8418 error for
extended attributes when using same attid as attribute object.

Signed-off-by: Evgeny Sinelnikov <sin@altlinux.ru>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agomsds_intid: Add test for (non-schema) linked attributes
Garming Sam [Tue, 26 Jul 2016 04:12:05 +0000 (16:12 +1200)]
msds_intid: Add test for (non-schema) linked attributes

Prior to this, none of the linked attributes would be checked for their
ids.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agovalgrind: Avoid a warning about uninitialized memory
Garming Sam [Mon, 25 Jul 2016 23:54:07 +0000 (11:54 +1200)]
valgrind: Avoid a warning about uninitialized memory

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoreplmd: Check dsdb_dn for syntax errors
Garming Sam [Tue, 26 Jul 2016 21:50:33 +0000 (09:50 +1200)]
replmd: Check dsdb_dn for syntax errors

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotevent: version 0.9.28
Stefan Metzmacher [Tue, 26 Jul 2016 18:25:53 +0000 (20:25 +0200)]
tevent: version 0.9.28

* performance improvements
* documentation updates
* build fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul 28 08:45:34 CEST 2016 on sn-devel-144

2 years agotalloc: version 2.1.8
Stefan Metzmacher [Tue, 26 Jul 2016 18:23:27 +0000 (20:23 +0200)]
talloc: version 2.1.8

* performance improvements
* build fixes
* documentation updates

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotdb: version 1.3.10
Stefan Metzmacher [Tue, 26 Jul 2016 18:21:21 +0000 (20:21 +0200)]
tdb: version 1.3.10

* performance improvements
* make pthread mutex code more portable
* builf fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agofss_agent: Fix a signed/unsigned mixup
Volker Lendecke [Fri, 22 Jul 2016 13:43:58 +0000 (15:43 +0200)]
fss_agent: Fix a signed/unsigned mixup

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agolib: Move "message_send_all" to serverid.c
Volker Lendecke [Thu, 14 Jul 2016 10:47:16 +0000 (12:47 +0200)]
lib: Move "message_send_all" to serverid.c

Trying to trim down messages.c a bit: Sending to all processes that are
registered in serverid.tdb and filtering to me is not really logic of general
messaging but more of the serverid code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3/notifyd: add async send/recv functions
Ralph Boehme [Fri, 22 Jul 2016 06:29:13 +0000 (08:29 +0200)]
s3/notifyd: add async send/recv functions

Previously, without this patch, if notifyd died for whatever reason, it
would be restarted from smbd. However, if its initialization failed and
it exitted again, there would be no child entry in smbd for it and it
wouldn't be attempted to restart it again.

This patch adds async send/recv methods for starting cleanupd that will
reschedule restart attempt every second in case initilisation failed.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agos3/cleanupd: use smbd_cleanupd.tdb
Ralph Boehme [Thu, 21 Jul 2016 17:08:47 +0000 (19:08 +0200)]
s3/cleanupd: use smbd_cleanupd.tdb

Instead of using messaging to send individual cleanup events, it works
this way:

o parent smbd stores cleanup events (ie exitted children) in
  smbd_cleanup.tdb

o it sends cleanupd an empty MSG_SMB_NOTIFY_CLEANUP message

o cleanupd does a traverse on the smbd_cleanupd.tdb and collects all
  childs in a list

o after the traverse cleanupd walks the list and does the real work

It would have been possible to optimize for the common case by passing
info about exitted childs with the message (as was done before this
patch), adding a new message type for triggering a db traverse that
would be used when cleanupd had to be restarted and cleanup events may
have been accumulated in cleanup.tdb.

But this could be subject to subtle race conditions and could loose
events if cleanupd dies randomly.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agos3/smbd: add cleanupd_init_send()/recv()
Ralph Boehme [Thu, 14 Jul 2016 14:31:44 +0000 (16:31 +0200)]
s3/smbd: add cleanupd_init_send()/recv()

Previously, without this patch, if cleanupd died for whatever reason, it
would be restarted from smbd. However, if cleanupd initialization
failed and it exitted again, there would be no child entry in smbd for
it and it wouldn't be attempted to restart it again.

This patch adds async send/recv methods for starting cleanupd that will
reschedule restart attempt every second in case initilisation failed.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agos3/lib: add smbd_cleanupd.tdb
Ralph Boehme [Thu, 21 Jul 2016 14:53:15 +0000 (16:53 +0200)]
s3/lib: add smbd_cleanupd.tdb

This will be used between cleanupd and smbd for passing information
about exitted smbd childs.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agoctdb-daemon: Fix CID 1364527/8/9: Null pointer dereferences (NULL_RETURNS)
Martin Schwenke [Wed, 27 Jul 2016 01:45:49 +0000 (11:45 +1000)]
ctdb-daemon: Fix CID 1364527/8/9: Null pointer dereferences (NULL_RETURNS)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agoctdb-tests: Pretend not to ignore return from fgets()
Martin Schwenke [Wed, 27 Jul 2016 05:44:20 +0000 (15:44 +1000)]
ctdb-tests: Pretend not to ignore return from fgets()

With some compilers and picky compiler settings, ignoring the return
value of fgets() can cause compilation to fail.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Avoid portability issue in porting tests
Martin Schwenke [Wed, 27 Jul 2016 05:24:58 +0000 (15:24 +1000)]
ctdb-tests: Avoid portability issue in porting tests

EUID is bash-only, so this condition always fails on other shells.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Remove duplicate EOF terminators in some tool unit tests
Martin Schwenke [Wed, 27 Jul 2016 04:41:39 +0000 (14:41 +1000)]
ctdb-tests: Remove duplicate EOF terminators in some tool unit tests

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Avoid division by zero in NFS eventscript unit test
Martin Schwenke [Wed, 27 Jul 2016 04:40:52 +0000 (14:40 +1000)]
ctdb-tests: Avoid division by zero in NFS eventscript unit test

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Removing sleep from porting_tests
Amitay Isaacs [Wed, 27 Jul 2016 05:21:39 +0000 (15:21 +1000)]
ctdb-tests: Removing sleep from porting_tests

This avoids test failures due to timing issues.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Do not add $VALGRIND to ctdb command
Amitay Isaacs [Wed, 27 Jul 2016 04:59:02 +0000 (14:59 +1000)]
ctdb-tests: Do not add $VALGRIND to ctdb command

unit_test wrapper already adds VALGRIND wrapper.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Fix valgrind unintialized error
Amitay Isaacs [Wed, 27 Jul 2016 04:57:58 +0000 (14:57 +1000)]
ctdb-tests: Fix valgrind unintialized error

struct ctdb_dbid has padding and needs to be initialized.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoWHATSNEW: ctdb updates
Amitay Isaacs [Tue, 26 Jul 2016 05:38:44 +0000 (15:38 +1000)]
WHATSNEW: ctdb updates

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-packaging: Move ctdb configuration to ctdbd.conf
Amitay Isaacs [Tue, 28 Jun 2016 06:11:47 +0000 (16:11 +1000)]
ctdb-packaging: Move ctdb configuration to ctdbd.conf

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-protocol: Deprecate global transaction controls
Amitay Isaacs [Mon, 25 Jul 2016 05:55:12 +0000 (15:55 +1000)]
ctdb-protocol: Deprecate global transaction controls

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-protocol: Drop marshalling for global transaction controls
Amitay Isaacs [Mon, 25 Jul 2016 05:54:16 +0000 (15:54 +1000)]
ctdb-protocol: Drop marshalling for global transaction controls

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-client: Drop client code for global transaction controls
Amitay Isaacs [Mon, 25 Jul 2016 05:49:20 +0000 (15:49 +1000)]
ctdb-client: Drop client code for global transaction controls

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-daemon: Drop implementation of global transaction controls
Amitay Isaacs [Mon, 25 Jul 2016 05:41:34 +0000 (15:41 +1000)]
ctdb-daemon: Drop implementation of global transaction controls

These were used in serial recovery and for restoring databases using
older ctdb tool.  New code uses database specific transaction controls.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-protocol: Deprecate THAW control
Amitay Isaacs [Thu, 21 Jul 2016 04:22:39 +0000 (14:22 +1000)]
ctdb-protocol: Deprecate THAW control

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-daemon: Drop the implementation of THAW control
Amitay Isaacs [Thu, 21 Jul 2016 04:17:02 +0000 (14:17 +1000)]
ctdb-daemon: Drop the implementation of THAW control

This control was used by the older implementation of tool to restore a
database from backup.  In the new implemenation of tool, it freezes and thaws
only the database being restored.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Adjust unit test output matching new ctdb
Amitay Isaacs [Tue, 26 Jul 2016 03:55:41 +0000 (13:55 +1000)]
ctdb-tests: Adjust unit test output matching new ctdb

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tool: Add replacement ctdb tool using new client API
Amitay Isaacs [Fri, 17 Jul 2015 12:45:04 +0000 (22:45 +1000)]
ctdb-tool: Add replacement ctdb tool using new client API

New tool breaks some of the tool unit tests due to improved error
messages.  Those changes are in the following patch.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tool: Remove old ctdb tool
Amitay Isaacs [Tue, 26 Jul 2016 03:34:11 +0000 (13:34 +1000)]
ctdb-tool: Remove old ctdb tool

Removing and adding replacement code makes the commits cleaner.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-daemon: Deletion of IPs is deferred until the next takeover run
Martin Schwenke [Wed, 22 Jan 2014 06:12:09 +0000 (17:12 +1100)]
ctdb-daemon: Deletion of IPs is deferred until the next takeover run

This drastically simplifies the code.  "ctdb reloadips" behaves the
same, since it causes a takeover run immediately after IPs are
deleted.  "ctdb delip" now needs to be followed with an explicit "ctdb
ipreallocate".

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-daemon: Use consistent naming for monitoring mode
Amitay Isaacs [Fri, 22 Jul 2016 05:41:59 +0000 (15:41 +1000)]
ctdb-daemon: Use consistent naming for monitoring mode

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-daemon: Reduce QueueBufferSize from 16k to 1k
Amitay Isaacs [Tue, 26 Jul 2016 04:50:10 +0000 (14:50 +1000)]
ctdb-daemon: Reduce QueueBufferSize from 16k to 1k

This avoids CTDB spending too much time processing multiple packets and
return to the event loop sooner.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-daemon: Add QueueBufferSize tunable
Amitay Isaacs [Fri, 13 May 2016 14:25:31 +0000 (00:25 +1000)]
ctdb-daemon: Add QueueBufferSize tunable

This controls the maximum size of data ctdb will read from sockets at
a time.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-protocol: Add function ctdb_sock_addr_same_ip
Amitay Isaacs [Fri, 22 Jul 2016 03:35:00 +0000 (13:35 +1000)]
ctdb-protocol: Add function ctdb_sock_addr_same_ip

... to check if only the addresses are the same.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-common: Fix parsing of debug level
Amitay Isaacs [Fri, 22 Jul 2016 04:31:02 +0000 (14:31 +1000)]
ctdb-common: Fix parsing of debug level

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Add machinereadable output tests
Amitay Isaacs [Tue, 26 Jul 2016 03:30:18 +0000 (13:30 +1000)]
ctdb-tests: Add machinereadable output tests

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Add more tests for ctdb setdbsticky and setdbreadonly
Amitay Isaacs [Tue, 26 Jul 2016 04:18:35 +0000 (14:18 +1000)]
ctdb-tests: Add more tests for ctdb setdbsticky and setdbreadonly

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Add tests for idempotence
Amitay Isaacs [Tue, 26 Jul 2016 04:17:20 +0000 (14:17 +1000)]
ctdb-tests: Add tests for idempotence

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Improve test to match exact output
Amitay Isaacs [Tue, 26 Jul 2016 04:32:39 +0000 (14:32 +1000)]
ctdb-tests: Improve test to match exact output

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Fix typo
Amitay Isaacs [Tue, 26 Jul 2016 03:55:18 +0000 (13:55 +1000)]
ctdb-tests: Fix typo

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Clean database before the test
Amitay Isaacs [Fri, 17 Jun 2016 08:06:07 +0000 (18:06 +1000)]
ctdb-tests: Clean database before the test

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-daemon: Fix statistics update macro
Amitay Isaacs [Fri, 27 Mar 2015 05:32:11 +0000 (16:32 +1100)]
ctdb-daemon: Fix statistics update macro

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-doc: Drop documentation for obsolete tunable
Amitay Isaacs [Tue, 26 Jul 2016 04:53:38 +0000 (14:53 +1000)]
ctdb-doc: Drop documentation for obsolete tunable

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Fix CID 1364526 (Argument cannot be negative)
Amitay Isaacs [Wed, 27 Jul 2016 02:22:45 +0000 (12:22 +1000)]
ctdb-tests: Fix CID 1364526 (Argument cannot be negative)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Fix CID 1364525 (Argument cannot be negative)
Amitay Isaacs [Wed, 27 Jul 2016 02:22:06 +0000 (12:22 +1000)]
ctdb-tests: Fix CID 1364525 (Argument cannot be negative)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Fix CID 1364524 (Argument cannot be negative)
Amitay Isaacs [Wed, 27 Jul 2016 02:21:25 +0000 (12:21 +1000)]
ctdb-tests: Fix CID 1364524 (Argument cannot be negative)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Fix CID 1364523 (Argument cannot be negative)
Amitay Isaacs [Wed, 27 Jul 2016 02:20:21 +0000 (12:20 +1000)]
ctdb-tests: Fix CID 1364523 (Argument cannot be negative)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Fix CID 1364522 (Argument cannot be negative)
Amitay Isaacs [Wed, 27 Jul 2016 02:19:45 +0000 (12:19 +1000)]
ctdb-tests: Fix CID 1364522 (Argument cannot be negative)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Fix CID 1364521 (Argument cannot be negative)
Amitay Isaacs [Wed, 27 Jul 2016 02:19:04 +0000 (12:19 +1000)]
ctdb-tests: Fix CID 1364521 (Argument cannot be negative)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-common: Fix CID 1363227 (Resource leak)
Amitay Isaacs [Wed, 27 Jul 2016 02:02:19 +0000 (12:02 +1000)]
ctdb-common: Fix CID 1363227 (Resource leak)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-daemon: Move CTDB VNN structure to IP takeover code
Martin Schwenke [Mon, 13 Jun 2016 20:44:29 +0000 (06:44 +1000)]
ctdb-daemon: Move CTDB VNN structure to IP takeover code

It is only used in this code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-ipalloc: Use a cumulative timeout for takeover run stages
Martin Schwenke [Fri, 27 May 2016 05:22:27 +0000 (15:22 +1000)]
ctdb-ipalloc: Use a cumulative timeout for takeover run stages

RELEASE_IP sometimes times out because killing TCP connections can
take a long time.

The aim of the takeover timeout is actually to limit the total amount
of time for an IP takeover run.  So, calculate a combined timeout
offset once and use it for each of the RELEASE_IP, TAKEOVER_IP,
IPREALLOCATED stages.  This gives RELEASE_IP more time to kill TCP
connections but still limits the total time.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-doc: ctdb_diagnostics(1) tweaks and cross-references
Martin Schwenke [Tue, 26 Jul 2016 00:58:36 +0000 (10:58 +1000)]
ctdb-doc: ctdb_diagnostics(1) tweaks and cross-references

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-doc: Integrate ctdb_diagnostics man page into build
Martin Schwenke [Fri, 12 Feb 2016 08:40:43 +0000 (19:40 +1100)]
ctdb-doc: Integrate ctdb_diagnostics man page into build

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-doc: Add ctdb_diagnostics man page
martijn van brummelen [Fri, 9 Oct 2015 13:59:50 +0000 (15:59 +0200)]
ctdb-doc: Add ctdb_diagnostics man page

Signed-off-by: martijn van brummelen <martijn@brumit.nl>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agodsdb: Fix CID 1364520 Incorrect expression (EVALUATION_ORDER)
Volker Lendecke [Tue, 26 Jul 2016 10:42:49 +0000 (12:42 +0200)]
dsdb: Fix CID 1364520 Incorrect expression (EVALUATION_ORDER)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jul 26 23:48:19 CEST 2016 on sn-devel-144

2 years agoldb_ldb: Do not re-scan the index list for new DNs
Andrew Bartlett [Tue, 26 Jul 2016 02:17:47 +0000 (14:17 +1200)]
ldb_ldb: Do not re-scan the index list for new DNs

This DN can not already be in the list, because it is being
added to this DB for the first time just now.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jul 26 16:42:16 CEST 2016 on sn-devel-144

2 years agokcc: Clean up repsTo attribute for old DCs
Garming Sam [Mon, 25 Jul 2016 00:51:13 +0000 (12:51 +1200)]
kcc: Clean up repsTo attribute for old DCs

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): Tue Jul 26 05:11:57 CEST 2016 on sn-devel-144

2 years agokcc: Add a TODO for msDS[-RO]-Replica-Locations
Garming Sam [Fri, 22 Jul 2016 04:33:12 +0000 (16:33 +1200)]
kcc: Add a TODO for msDS[-RO]-Replica-Locations

When you modify the replica locations to exclude a DSA, it should be respected.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agokcc: Add corresponding methods for repsTo
Garming Sam [Fri, 22 Jul 2016 02:14:20 +0000 (14:14 +1200)]
kcc: Add corresponding methods for repsTo

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoWHATSNEW: CTDB updates
Martin Schwenke [Tue, 31 May 2016 05:50:25 +0000 (15:50 +1000)]
WHATSNEW: CTDB updates

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): Tue Jul 26 01:21:57 CEST 2016 on sn-devel-144