obnox/samba/samba-obnox.git
9 years agoselftest: Add 'net dom join' test which fails cause we are a DC
Andreas Schneider [Thu, 11 Dec 2014 15:41:55 +0000 (16:41 +0100)]
selftest: Add 'net dom join' test which fails cause we are a DC

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 years agonetapi: Move DC check to NetJoinDomain() where it is needed.
Andrew Bartlett [Wed, 11 Dec 2013 01:59:20 +0000 (14:59 +1300)]
netapi: Move DC check to NetJoinDomain() where it is needed.

This partially reverts 15f6e27bd5a9065c8b781fa21f5989ce2c355776.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agovfs_glusterfs: Set connectpath as snapdir-entry-path.
raghavendra talur [Wed, 10 Dec 2014 07:00:10 +0000 (12:30 +0530)]
vfs_glusterfs: Set connectpath as snapdir-entry-path.

snapview client in gluster would require connectpath
in order add snapdir entry to readdir result.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Dec 10 16:38:27 CET 2014 on sn-devel-104

9 years agovfs_glusterfs: Remember the connect path too for reopening.
raghavendra talur [Wed, 10 Dec 2014 06:56:34 +0000 (12:26 +0530)]
vfs_glusterfs: Remember the connect path too for reopening.

As Samba allows us to share subdirs, lets re-use preopened
connections to glusterfs only if they are for same volume
AND same connectpath.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agovfs_glusterfs: In vfs_gluster_sys_acl_get_file/fd, reduce the number of getxattr...
Poornima G [Thu, 30 Oct 2014 11:44:51 +0000 (17:14 +0530)]
vfs_glusterfs: In vfs_gluster_sys_acl_get_file/fd, reduce the number of getxattr calls.

Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 years agotorture: Fix raw.open.chained-ntcreatex
Volker Lendecke [Thu, 27 Nov 2014 20:44:18 +0000 (21:44 +0100)]
torture: Fix raw.open.chained-ntcreatex

sizeof(buf) is 5. On FreeBSD10/clang this overwrites "ret". Not good.

Same as 574750777a

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 Dec  9 19:43:31 CET 2014 on sn-devel-104

9 years agonotify_inotify: Simplify inotify_dispatch
Volker Lendecke [Thu, 4 Dec 2014 16:01:17 +0000 (16:01 +0000)]
notify_inotify: Simplify inotify_dispatch

Normally, I'm trying to simplify things with early returns. But in
this case I think the reverse makes the if-condition easier to
understand

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 Dec  9 06:37:24 CET 2014 on sn-devel-104

9 years agosmbd: Compile notify_inotify only if available
Volker Lendecke [Tue, 18 Nov 2014 11:28:20 +0000 (11:28 +0000)]
smbd: Compile notify_inotify only if available

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify_inotify: inotify_watch now takes a mem_ctx
Volker Lendecke [Wed, 5 Nov 2014 12:18:31 +0000 (12:18 +0000)]
notify_inotify: inotify_watch now takes a mem_ctx

This will make it easier to integrate into proper memory hierarchies.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify: Add "dir" to notify_event
Volker Lendecke [Wed, 5 Nov 2014 11:44:42 +0000 (11:44 +0000)]
notify: Add "dir" to notify_event

"notify_event" only reports names relative to some path that is only
implicitly known via "private_data". Right now "private_data" is the fsp
of the directory holding this notify. I want to use inotify_watch in a
notify-daemon that does not have a fsp available and has more problems
getting the path right out of "private_data". notify_inotify has the
directory under which the event happened available, so make it known to
the callback. Right now no caller uses it yet.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify_inotify: Make inotify_watch return 0/errno
Volker Lendecke [Mon, 27 Oct 2014 13:26:35 +0000 (13:26 +0000)]
notify_inotify: Make inotify_watch return 0/errno

More like a cleanup, but I want to use inotify_watch in notifyd
that I would like to keep as light as possible

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify_inotify: Slightly simplify watch_destructor
Volker Lendecke [Mon, 27 Oct 2014 13:20:15 +0000 (13:20 +0000)]
notify_inotify: Slightly simplify watch_destructor

Another case of an early return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify_inotify: Slightly simplify inotify_watch
Volker Lendecke [Mon, 27 Oct 2014 13:15:12 +0000 (13:15 +0000)]
notify_inotify: Slightly simplify inotify_watch

tallocing first avoids having to call inotify_rm_watch

This even fixes a real error: We share inotifies between different instances,
so the rm_watch in the error paths destroys other legitimate watches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify_inotify: Make inotify_setup return 0/errno
Volker Lendecke [Mon, 27 Oct 2014 13:09:44 +0000 (13:09 +0000)]
notify_inotify: Make inotify_setup return 0/errno

This gets rid of one NT_STATUS_HAVE_NO_MEMORY with its implicit return; :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify_inotify: Add a NULL check
Volker Lendecke [Mon, 27 Oct 2014 13:07:03 +0000 (13:07 +0000)]
notify_inotify: Add a NULL check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify_inotify: Simplify filter_match
Volker Lendecke [Sun, 26 Oct 2014 09:13:41 +0000 (09:13 +0000)]
notify_inotify: Simplify filter_match

Early returns make code simpler

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Move lp_parm_bool out of notify_inotify.c
Volker Lendecke [Mon, 27 Oct 2014 10:26:46 +0000 (10:26 +0000)]
smbd: Move lp_parm_bool out of notify_inotify.c

Notifyd should be as independent of Samba infrastructure as possible,
and it will call notify_inotify

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Use iov_buf in unix_msg
Volker Lendecke [Sat, 6 Dec 2014 10:28:16 +0000 (11:28 +0100)]
lib: Use iov_buf in unix_msg

Now that iov_buf does not pull in talloc we can use it

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Simplify iov_buf[len]
Volker Lendecke [Sat, 6 Dec 2014 10:22:35 +0000 (11:22 +0100)]
lib: Simplify iov_buf[len]

This makes iov_buf independent of talloc

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agomessaging3: Avoid self-send complexity
Volker Lendecke [Thu, 13 Nov 2014 10:38:40 +0000 (10:38 +0000)]
messaging3: Avoid self-send complexity

With the notify code I've hit another case where self-sends caused
a problem.  This time messages were lost because we tried to do
multiple dispatch_rec calls from within a single inotify callback.
Only the first one was being taken care of, the others did not find
receivers.

This patch makes self-sends go through the kernel as well, the
kernel queues everything nicely for us. With dgram messaging this
should be pretty fast. If it turns out to be a performance problem,
we can solve it later by doing proper queueing in user space. We
need to completely decouple any processing from callbacks.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Fix blank line endings
Volker Lendecke [Sun, 7 Dec 2014 13:13:51 +0000 (14:13 +0100)]
lib: Fix blank line endings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Fix a typo
Volker Lendecke [Sun, 7 Dec 2014 13:09:29 +0000 (14:09 +0100)]
lib: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:locking: Change the data model for leases_db to cope with dynamic path renames.
Jeremy Allison [Fri, 5 Dec 2014 20:47:52 +0000 (12:47 -0800)]
s3:locking: Change the data model for leases_db to cope with dynamic path renames.

interface leases_db
{
        typedef [public] struct {
                GUID client_guid;
                smb2_lease_key lease_key;
        } leases_db_key;

        typedef [public] struct {
                file_id id;
                [string,charset(UTF8)] char *servicepath;
                [string,charset(UTF8)] char *base_name;
                [string,charset(UTF8)] char *stream_name;
        } leases_db_file;

        typedef [public] struct {
                uint32 num_files;
                [size_is(num_files)] leases_db_file files[];
        } leases_db_value;
}

As designed by metze.

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): Tue Dec  9 03:44:04 CET 2014 on sn-devel-104

9 years agos3:locking: pass down servicepath to leases_db_add()
Jeremy Allison [Fri, 5 Dec 2014 20:58:39 +0000 (12:58 -0800)]
s3:locking: pass down servicepath to leases_db_add()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:locking: Add new utility function leases_db_copy_file_ids()
Jeremy Allison [Fri, 5 Dec 2014 20:57:24 +0000 (12:57 -0800)]
s3:locking: Add new utility function leases_db_copy_file_ids()

Will be used by lease db parsers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:locking: prepare the data model for leases_db to cope with dynamic path renames.
Jeremy Allison [Fri, 5 Dec 2014 20:47:52 +0000 (12:47 -0800)]
s3:locking: prepare the data model for leases_db to cope with dynamic path renames.

interface leases_db
{
        typedef [public] struct {
                GUID client_guid;
                smb2_lease_key lease_key;
        } leases_db_key;

        typedef [public] struct {
                file_id id;
                [string,charset(UTF8)] char *servicepath;
                [string,charset(UTF8)] char *base_name;
                [string,charset(UTF8)] char *stream_name;
        } leases_db_file;

        typedef [public] struct {
                uint32 num_files;
                [size_is(num_files)] leases_db_file files[];
        } leases_db_value;
}

As designed by metze.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:locking: pass servicename_new to leases_db_rename()
Jeremy Allison [Fri, 5 Dec 2014 20:56:03 +0000 (12:56 -0800)]
s3:locking: pass servicename_new to leases_db_rename()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agovfs: Add missing include for sys_pread() in cacheprime module.
Andreas Schneider [Mon, 8 Dec 2014 09:09:29 +0000 (10:09 +0100)]
vfs: Add missing include for sys_pread() in cacheprime module.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Dec  8 16:54:51 CET 2014 on sn-devel-104

9 years agosmbd: Add missing include for iov_buflen().
Andreas Schneider [Mon, 8 Dec 2014 09:07:42 +0000 (10:07 +0100)]
smbd: Add missing include for iov_buflen().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agosocket_wrapper: Add missing prototype check for eventfd.
Andreas Schneider [Wed, 26 Nov 2014 09:18:34 +0000 (10:18 +0100)]
socket_wrapper: Add missing prototype check for eventfd.

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

Newer glibc versions use and unsinged integer for the count instead of
an integer.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-tests/env_loadparm: Throw KeyError in case SMB_CONF_PATH
Kamen Mazdrashki [Tue, 2 Dec 2014 04:04:40 +0000 (05:04 +0100)]
s4-tests/env_loadparm: Throw KeyError in case SMB_CONF_PATH

A bit more specific for the caller to "know" that env key is missing

Change-Id: I4d4c2121af868d79f46f865f420336222bc67347
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date(master): Mon Dec  8 05:27:34 CET 2014 on sn-devel-104

9 years agos4-ldap: Pass on-wire transmitted control down the chain
Kamen Mazdrashki [Tue, 2 Dec 2014 00:53:18 +0000 (01:53 +0100)]
s4-ldap: Pass on-wire transmitted control down the chain

Change-Id: Ic3a117f74e8a67c45584fdb520d92e4f0cb01c5e
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3: modules: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Fri, 5 Dec 2014 23:37:11 +0000 (15:37 -0800)]
s3: modules: Fix *allocate* calls to follow POSIX error return convention.

Fix up the ceph, fruit, time_audit and streams_xattr modules to follow
the -1,errno convention for errors.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Dec  8 02:59:43 CET 2014 on sn-devel-104

9 years agos3: smbd: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Fri, 5 Dec 2014 23:34:12 +0000 (15:34 -0800)]
s3: smbd: Fix *allocate* calls to follow POSIX error return convention.

Fix vfs_allocate_file_space(), vfs_slow_fallocate(),
vfs_fill_sparse() to follow the -1,errno convention
for errors.

Standardize on the -1,errno convention.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
9 years agos3: smbd: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Fri, 5 Dec 2014 23:31:19 +0000 (15:31 -0800)]
s3: smbd: Fix *allocate* calls to follow POSIX error return convention.

vfswrap_fallocate() is broken in that it can call posix_fallocate()
which returns an int error (and doesn't set errno) but can also
call Linux fallocate() which returns -1 and sets errno.

Standardize on the -1,errno convention.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
9 years agolib: Simplify load_case_tables_library()
Volker Lendecke [Sun, 7 Dec 2014 11:08:55 +0000 (12:08 +0100)]
lib: Simplify load_case_tables_library()

We don't really need a talloc context here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Use read_data() in notify_inotify
Volker Lendecke [Wed, 19 Nov 2014 14:41:42 +0000 (14:41 +0000)]
smbd: Use read_data() in notify_inotify

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): Sun Dec  7 02:37:04 CET 2014 on sn-devel-104

9 years agolib: Add a simple read_data call without NTSTATUS
Volker Lendecke [Wed, 19 Nov 2014 14:35:14 +0000 (14:35 +0000)]
lib: Add a simple read_data call without NTSTATUS

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Make write_data take a const void *
Volker Lendecke [Wed, 19 Nov 2014 14:29:26 +0000 (14:29 +0000)]
lib: Make write_data take a const void *

This aligns it with write(2)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Split out write_data[_iov]
Volker Lendecke [Wed, 19 Nov 2014 14:25:56 +0000 (14:25 +0000)]
lib: Split out write_data[_iov]

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Split out iov_buf[len]
Volker Lendecke [Wed, 19 Nov 2014 14:21:17 +0000 (14:21 +0000)]
lib: Split out iov_buf[len]

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: read_data->read_data_ntstatus
Volker Lendecke [Wed, 19 Nov 2014 14:06:49 +0000 (14:06 +0000)]
lib: read_data->read_data_ntstatus

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Split out sys_[read|write] & friends
Volker Lendecke [Wed, 19 Nov 2014 13:33:06 +0000 (13:33 +0000)]
lib: Split out sys_[read|write] & friends

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoctdb: ctdb_protocol.h references struct sockaddr
Volker Lendecke [Wed, 3 Dec 2014 15:02:35 +0000 (16:02 +0100)]
ctdb: ctdb_protocol.h references struct sockaddr

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoFix signed/unsigned comparisons
Volker Lendecke [Fri, 5 Dec 2014 13:38:48 +0000 (14:38 +0100)]
Fix signed/unsigned comparisons

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoctdbd_conn: Accept msgs to all registered srvids
Volker Lendecke [Fri, 21 Nov 2014 15:20:10 +0000 (16:20 +0100)]
ctdbd_conn: Accept msgs to all registered srvids

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agorwrap: Bump version to 1.1.0.
Andreas Schneider [Wed, 3 Dec 2014 14:45:10 +0000 (15:45 +0100)]
rwrap: Bump version to 1.1.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Dec  6 01:54:12 CET 2014 on sn-devel-104

9 years agorwrap: Don't dereference NULL when skipping broken records.
Jakub Hrozek [Wed, 3 Dec 2014 14:45:09 +0000 (15:45 +0100)]
rwrap: Don't dereference NULL when skipping broken records.

CID: 83426
CID: 83425

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agorwrap: Support asking for A via CNAME
Jakub Hrozek [Wed, 3 Dec 2014 14:45:08 +0000 (15:45 +0100)]
rwrap: Support asking for A via CNAME

Adds support for querying for an A record using a name that only expands
into a CNAME.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agorwrap: Recursively add additional data
Jakub Hrozek [Wed, 3 Dec 2014 14:45:07 +0000 (15:45 +0100)]
rwrap: Recursively add additional data

Change how we construct the fake answer such that the header and
question are added first, then the answers and finally additional data.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agorwrap: Make the rwrap_fake_* functions only fake RRs.
Jakub Hrozek [Wed, 3 Dec 2014 14:45:06 +0000 (15:45 +0100)]
rwrap: Make the rwrap_fake_* functions only fake RRs.

The rwrap_fake_common() function did too much. Remove it and use
separate functions to add fake header and question sections. The
rwrap_fake_$RR functions will receive packet including the header and
question and only add its RR data.

This will allow recursive processing later.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agorwrap: CNAME record can recurse into A, AAAA or CNAME
Jakub Hrozek [Wed, 3 Dec 2014 14:45:05 +0000 (15:45 +0100)]
rwrap: CNAME record can recurse into A, AAAA or CNAME

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agorwrap: SRV record can recurse into A or AAAA.
Jakub Hrozek [Wed, 3 Dec 2014 14:45:04 +0000 (15:45 +0100)]
rwrap: SRV record can recurse into A or AAAA.

When querying for a SRV record, we'll need to include A or AAAA records
in additional section. Therefore, keep querying the host file until we
can either recurse the A/AAAA records or reach the recursion limit

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agorwrap: Use the rwrap_fake_rr structure instead of raw uint8_t pointers.
Jakub Hrozek [Wed, 3 Dec 2014 14:45:03 +0000 (15:45 +0100)]
rwrap: Use the rwrap_fake_rr structure instead of raw uint8_t pointers.

Currently only one instance of the rwrap_fake_rr structure is used. Recursion
will be implemented in a future patch.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agorwrap: Add data structures and functions to represent and manipulate RRs.
Jakub Hrozek [Wed, 3 Dec 2014 14:45:02 +0000 (15:45 +0100)]
rwrap: Add data structures and functions to represent and manipulate RRs.

Adds a structure that, using unions represents all supported RRs. Add a
bunch of utility functions that can be used to create these structures.

Currently the functions are unused.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agorwrap: Correctly calculate the response size and return it.
Andreas Schneider [Wed, 3 Dec 2014 14:45:01 +0000 (15:45 +0100)]
rwrap: Correctly calculate the response size and return it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agorwrap: Handle trailing dot in dns names.
Andreas Schneider [Wed, 3 Dec 2014 14:45:00 +0000 (15:45 +0100)]
rwrap: Handle trailing dot in dns names.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agorwrap: Compare dns names case insensitive.
Jakub Hrozek [Wed, 3 Dec 2014 14:44:59 +0000 (15:44 +0100)]
rwrap: Compare dns names case insensitive.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agolib: Add resolv_wrapper version 1.0.0.
Andreas Schneider [Wed, 3 Dec 2014 14:44:58 +0000 (15:44 +0100)]
lib: Add resolv_wrapper version 1.0.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoselftest: Add the normal dns name as an alias for the main DC.
Andreas Schneider [Wed, 3 Dec 2014 14:44:57 +0000 (15:44 +0100)]
selftest: Add the normal dns name as an alias for the main DC.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agotestprogs: Set functional domain level to 2003.
Andreas Schneider [Fri, 5 Dec 2014 16:03:31 +0000 (17:03 +0100)]
testprogs: Set functional domain level to 2003.

The default changed to 2008r2 recently.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoctdb-tests: Need to drop public IPs in kill-failover tests
Martin Schwenke [Wed, 3 Dec 2014 01:10:07 +0000 (12:10 +1100)]
ctdb-tests: Need to drop public IPs in kill-failover tests

These tests simulate a dead node rather than a CTDB failure, so drop
IP addresses when killing a "node" to avoid problems with duplicates.

To cope with a CTDB failure a watchdog would be needed to ensure that
the public IPs are dropped when CTDB dies.  Let's not do that now.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Dec  5 23:29:39 CET 2014 on sn-devel-104

9 years agoctdb-daemon: Gratuitous ARP equivalent for IPv6 is neighbor advertisement
Martin Schwenke [Mon, 1 Dec 2014 23:57:12 +0000 (10:57 +1100)]
ctdb-daemon: Gratuitous ARP equivalent for IPv6 is neighbor advertisement

Not neighbour solicitation.  See:

  https://tools.ietf.org/html/rfc4861#section-4.4

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: More debug on SSH failure
Martin Schwenke [Wed, 3 Dec 2014 01:09:12 +0000 (12:09 +1100)]
ctdb-tests: More debug on SSH failure

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Make tcpdump output more verbose
Martin Schwenke [Mon, 1 Dec 2014 02:30:29 +0000 (13:30 +1100)]
ctdb-tests: Make tcpdump output more verbose

This helps with debugging.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Use ip neigh command instead of arp
Martin Schwenke [Sat, 29 Nov 2014 09:01:20 +0000 (20:01 +1100)]
ctdb-tests: Use ip neigh command instead of arp

Extend select_test_node_and_ips() to set $test_prefix in addition to
$test_ip.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Generalise the gratarp and tickle sniffing code for IPv6
Martin Schwenke [Mon, 1 Dec 2014 03:07:57 +0000 (14:07 +1100)]
ctdb-tests: Generalise the gratarp and tickle sniffing code for IPv6

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

9 years agoctdb-tests: Match IPv6 connections in netstat output
Martin Schwenke [Mon, 1 Dec 2014 02:51:47 +0000 (13:51 +1100)]
ctdb-tests: Match IPv6 connections in netstat output

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Use ping_wrapper to do relevant ping or ping6
Martin Schwenke [Mon, 1 Dec 2014 02:50:42 +0000 (13:50 +1100)]
ctdb-tests: Use ping_wrapper to do relevant ping or ping6

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Extend regexps to handle IPv6 address matching
Martin Schwenke [Wed, 3 Dec 2014 04:58:20 +0000 (15:58 +1100)]
ctdb-tests: Extend regexps to handle IPv6 address matching

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Bracket IP addresses in NFS mounts and scp command (for IPv6)
Martin Schwenke [Wed, 3 Dec 2014 04:57:35 +0000 (15:57 +1100)]
ctdb-tests: Bracket IP addresses in NFS mounts and scp command (for IPv6)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Try to handle IPv6 addresses for local daemons
Martin Schwenke [Wed, 26 Nov 2014 10:32:22 +0000 (21:32 +1100)]
ctdb-tests: Try to handle IPv6 addresses for local daemons

If CTDB_USE_IPV6 is set then use IPv6 addresses for nodes and public
IPs.  This can be useful for some simple tests.  However, the node
address actually needs to be on lo so that ctdbd can bind to the port
on that address, so they actually need to be added as root before
running tests, like this:

  for i in $(seq 1 10) ; do ip addr add "fc00:10::${i}/64" dev lo ; done

IPv4 127.0.0.0/8 addresses are somehow magic and only one needs to be
on lo so that many can be bound to.

Also change the IPv4 node addresses to be (slightly) more exotic.

For both IPv4 and IPv6, choose addresses that are compatible with
socket wrapper.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Amitay Isaacs <amitay@gmail.com> (socket wrapper fixes)
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net> (socket wrapper fixes)
9 years agoctdb-tests: Extend regexp to match IPv6 addresses
Martin Schwenke [Wed, 26 Nov 2014 10:31:42 +0000 (21:31 +1100)]
ctdb-tests: Extend regexp to match IPv6 addresses

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Bracket IP addresses in onnode (for IPv6)
Martin Schwenke [Fri, 28 Nov 2014 10:49:08 +0000 (21:49 +1100)]
ctdb-tools: Bracket IP addresses in onnode (for IPv6)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: Fix IP address comparisons for IPv6 addresses
Amitay Isaacs [Tue, 25 Nov 2014 01:38:23 +0000 (12:38 +1100)]
ctdb-daemon: Fix IP address comparisons for IPv6 addresses

Before storing node IP address, convert into the correct abbreviated
string form for IPv6 addresses.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-scripts: Wait until IPv6 addresses are not "tentative"
Martin Schwenke [Fri, 21 Nov 2014 06:33:21 +0000 (17:33 +1100)]
ctdb-scripts: Wait until IPv6 addresses are not "tentative"

There are a few potential failure modes when adding an IPv6 address.
It takes a little while of duplicate address detection to complete, so
wait for a while.  After a timeout, also need to check to see if
duplicate address detection failed - if it did then actually drop the
IP address.

This really needs some careful thinking.  If CTDB disappears on a node
but the node's IP addresses are still on interfaces then the above
failure mode could cause the takeover nodes to become banned.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-eventscripts: Specify broadcast optionally to ip addr add
Amitay Isaacs [Thu, 20 Nov 2014 10:58:31 +0000 (21:58 +1100)]
ctdb-eventscripts: Specify broadcast optionally to ip addr add

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-daemon: Trust vnn->interface for an IP when releasing it
Martin Schwenke [Fri, 21 Nov 2014 03:52:47 +0000 (14:52 +1100)]
ctdb-daemon: Trust vnn->interface for an IP when releasing it

ctdb_sys_find_ifname() doesn't work for IPv6 addresses so don't use
it.

Trust the eventscript to do sanity checking on the interface.  Current
warnings are replaced with equivalents generated by the eventscript.
The unlikely message:

  Public IP %s is hosted on interface %s but we have no VNN

will be replaced by:

  WARNING: Public IP %s hosted on interface %s but VNN says __none__

which is clear enough.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Make 10.interface IPv6-safe
Martin Schwenke [Fri, 21 Nov 2014 03:46:00 +0000 (14:46 +1100)]
ctdb-scripts: Make 10.interface IPv6-safe

Add checking to "releaseip" and "updateip" to ensure that the given IP
address is really on the given interface with the given netmask.  If
reality doesn't match the given arguments then believe reality.

Use new function iptables_wrapper() instead of calling iptables()
directly.

Use new function flush_route_cache() instead of doing IPv4-specific
/proc magic.

Remove setting of otherwise unused variable "failed".

Fix a test for which the error message has changed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: New functions ip6tables() and iptables_wrapper()
Martin Schwenke [Fri, 21 Nov 2014 03:39:43 +0000 (14:39 +1100)]
ctdb-scripts: New functions ip6tables() and iptables_wrapper()

ip6tables() uses the same lock as iptables().  This is done on
suspicion.

iptables_wrapper() takes 1st argument "inet" or "inet6", and the rest
is passed to the correct iptables variant.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Add IPv6 addresses support in ip_maskbits_iface()
Martin Schwenke [Fri, 21 Nov 2014 03:37:54 +0000 (14:37 +1100)]
ctdb-scripts: Add IPv6 addresses support in ip_maskbits_iface()

It also prints a third word, the address family.  This is either
"inet" or "inet6".

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-utils: Update Nagios code to use ctdb -X
Martin Schwenke [Thu, 20 Nov 2014 23:48:25 +0000 (10:48 +1100)]
ctdb-utils: Update Nagios code to use ctdb -X

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-doc: Update examples to use ctdb -X
Martin Schwenke [Thu, 20 Nov 2014 23:47:22 +0000 (10:47 +1100)]
ctdb-doc: Update examples to use ctdb -X

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tool: Fix "ctdb -Y ifaces" output to have trailing delimiters
Martin Schwenke [Thu, 20 Nov 2014 23:45:57 +0000 (10:45 +1100)]
ctdb-tool: Fix "ctdb -Y ifaces" output to have trailing delimiters

In the CTDB CLI tool source code and the documentation example.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Update integration tests to use ctdb -X
Martin Schwenke [Thu, 20 Nov 2014 04:03:25 +0000 (15:03 +1100)]
ctdb-tests: Update integration tests to use ctdb -X

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Update onnode and ctdb-diagnostics to use ctdb -X
Martin Schwenke [Thu, 20 Nov 2014 03:39:59 +0000 (14:39 +1100)]
ctdb-tools: Update onnode and ctdb-diagnostics to use ctdb -X

Also update onnode unit tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Update eventscripts to use ctdb -X instead of ctdb -Y
Martin Schwenke [Thu, 20 Nov 2014 03:32:46 +0000 (14:32 +1100)]
ctdb-scripts: Update eventscripts to use ctdb -X instead of ctdb -Y

Also update associated eventscript unit tests and ctdb stub.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Add -X option for machine parsable output with separator '|'
Martin Schwenke [Wed, 19 Nov 2014 07:19:50 +0000 (18:19 +1100)]
ctdb-tools: Add -X option for machine parsable output with separator '|'

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Add -x option to specify delimiter for machine readable output
Martin Schwenke [Wed, 19 Nov 2014 06:15:21 +0000 (17:15 +1100)]
ctdb-tools: Add -x option to specify delimiter for machine readable output

To support this, update printm() to replace ':' in format string with
options.machineseparator, which is a string but must contain a single
character.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Produce machine readable output with new function printm()
Martin Schwenke [Wed, 19 Nov 2014 05:35:35 +0000 (16:35 +1100)]
ctdb-tools: Produce machine readable output with new function printm()

printm() is a printf(3) replacement and must be used to printing any
machine readable output.  It currently just calls vprintf(3).  Later
it will change the field delimiter.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoinotify: Properly handle cross-dir renames
Volker Lendecke [Fri, 5 Dec 2014 15:38:45 +0000 (15:38 +0000)]
inotify: Properly handle cross-dir renames

When watching two subdirectories with inotify and a file is moved between both,
we get a IN_MOVED_FROM for the source watch and a IN_MOVED_TO for the
destination watch. Without this patch we create a NOTIFY_ACTION_OLD_NAME for
the old directory. We hold this back in notify_fsp, expecting the NEW_NAME
immediately after it. In the cross-directory rename case this does not work,
we'll not get the NEW_NAME, there is no NEW_NAME in that directory.

This patch changes us to create NOTIFY_ACTION_REMOVED and NOTIFY_ACTION_ADDED
in this case. Not sure this is right, but at least it is better than before: We
get something at all.

This is more likely to happen with the notifyd approach, as there we
inotify-watch many subdirectories from one process. Without nootifyd you had to
have two explorer windows open and do a nfs or local mv between those two
directories to find this.

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): Fri Dec  5 21:01:54 CET 2014 on sn-devel-104

9 years agolib: Fix signed/unsigned comparisons
Volker Lendecke [Wed, 3 Dec 2014 14:54:19 +0000 (15:54 +0100)]
lib: Fix signed/unsigned comparisons

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4: torture: leases. Simple lease_v2 rename test "v2_rename".
Jeremy Allison [Fri, 5 Dec 2014 05:29:47 +0000 (21:29 -0800)]
s4: torture: leases. Simple lease_v2 rename test "v2_rename".

Proves that renaming files can break handle leases.

With the previous patches we now pass this.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos3: leases: Make SMB2 setinfo SMB2_FILE_RENAME_INFORMATION_INTERNAL async.
Jeremy Allison [Fri, 5 Dec 2014 05:19:32 +0000 (21:19 -0800)]
s3: leases: Make SMB2 setinfo SMB2_FILE_RENAME_INFORMATION_INTERNAL async.

If there are any RH leases we must break them to read
and must wait for the client response before doing the rename.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos3: leases: send_break_message() public.
Jeremy Allison [Fri, 5 Dec 2014 05:15:24 +0000 (21:15 -0800)]
s3: leases: send_break_message() public.

We're going to need this to allow async SMB2
setinfo renames to send lease break messages
as well as the open code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3: leases: Make aio_add_req_to_fsp() public.
Jeremy Allison [Fri, 5 Dec 2014 05:13:33 +0000 (21:13 -0800)]
s3: leases: Make aio_add_req_to_fsp() public.

We're going to need this to stop handle closures with
outstanding async SMB2 renames causing a crash.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3: leases : Cope with renaming leased open files.
Jeremy Allison [Thu, 4 Dec 2014 18:14:23 +0000 (10:14 -0800)]
s3: leases : Cope with renaming leased open files.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3: leases: Add leases_db_rename() to cope with renaming a leased file.
Jeremy Allison [Thu, 4 Dec 2014 18:13:47 +0000 (10:13 -0800)]
s3: leases: Add leases_db_rename() to cope with renaming a leased file.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoctdb-recoverd: Process all the records for vacuum fetch in a loop
Amitay Isaacs [Wed, 23 Apr 2014 08:02:39 +0000 (18:02 +1000)]
ctdb-recoverd: Process all the records for vacuum fetch in a loop

Processing one migration request at a time is very slow and processing
a batch of records can take longer than VacuumInterval.  This causes
subsequent vacuum fetch requests to be dropped.  The dropped records
can accumulate quickly and will cause the vacuum database traverse to
be quite expensive.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Dec  5 17:06:58 CET 2014 on sn-devel-104

9 years agoctdb-vacuum: Do not delete VACUUM MIGRATED records immediately
Amitay Isaacs [Mon, 14 Apr 2014 04:53:25 +0000 (14:53 +1000)]
ctdb-vacuum: Do not delete VACUUM MIGRATED records immediately

Such records should be processed by the local vacuuming daemon to ensure
that all the remote copies have been deleted first.

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