summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* ctdb-tests: Bracket IP addresses in NFS mounts and scp command (for IPv6)Martin Schwenke2014-12-052-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Try to handle IPv6 addresses for local daemonsMartin Schwenke2014-12-051-3/+11
| | | | | | | | | | | | | | | | | | | | | | | 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)
* ctdb-tests: Extend regexp to match IPv6 addressesMartin Schwenke2014-12-051-1/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Bracket IP addresses in onnode (for IPv6)Martin Schwenke2014-12-051-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Fix IP address comparisons for IPv6 addressesAmitay Isaacs2014-12-051-2/+10
| | | | | | | | 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>
* ctdb-scripts: Wait until IPv6 addresses are not "tentative"Martin Schwenke2014-12-051-0/+23
| | | | | | | | | | | | | | | 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>
* ctdb-eventscripts: Specify broadcast optionally to ip addr addAmitay Isaacs2014-12-051-1/+7
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Trust vnn->interface for an IP when releasing itMartin Schwenke2014-12-051-24/+1
| | | | | | | | | | | | | | | | | | | | 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>
* ctdb-scripts: Make 10.interface IPv6-safeMartin Schwenke2014-12-053-31/+65
| | | | | | | | | | | | | | | | | | | 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>
* ctdb-scripts: New functions ip6tables() and iptables_wrapper()Martin Schwenke2014-12-051-1/+14
| | | | | | | | | | | 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>
* ctdb-scripts: Add IPv6 addresses support in ip_maskbits_iface()Martin Schwenke2014-12-051-2/+9
| | | | | | | | 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>
* ctdb-utils: Update Nagios code to use ctdb -XMartin Schwenke2014-12-051-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-doc: Update examples to use ctdb -XMartin Schwenke2014-12-051-20/+20
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tool: Fix "ctdb -Y ifaces" output to have trailing delimitersMartin Schwenke2014-12-052-5/+5
| | | | | | | 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>
* ctdb-tests: Update integration tests to use ctdb -XMartin Schwenke2014-12-059-45/+45
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Update onnode and ctdb-diagnostics to use ctdb -XMartin Schwenke2014-12-057-30/+30
| | | | | | | Also update onnode unit tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Update eventscripts to use ctdb -X instead of ctdb -YMartin Schwenke2014-12-058-34/+34
| | | | | | | Also update associated eventscript unit tests and ctdb stub. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Add -X option for machine parsable output with separator '|'Martin Schwenke2014-12-052-0/+19
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Add -x option to specify delimiter for machine readable outputMartin Schwenke2014-12-052-4/+40
| | | | | | | | | 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>
* ctdb-tools: Produce machine readable output with new function printm()Martin Schwenke2014-12-051-86/+102
| | | | | | | | | 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>
* inotify: Properly handle cross-dir renamesVolker Lendecke2014-12-051-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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
* lib: Fix signed/unsigned comparisonsVolker Lendecke2014-12-052-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4: torture: leases. Simple lease_v2 rename test "v2_rename".Jeremy Allison2014-12-051-0/+134
| | | | | | | | | | | 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>
* s3: leases: Make SMB2 setinfo SMB2_FILE_RENAME_INFORMATION_INTERNAL async.Jeremy Allison2014-12-051-0/+218
| | | | | | | | | | 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>
* s3: leases: send_break_message() public.Jeremy Allison2014-12-052-1/+4
| | | | | | | | | 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>
* s3: leases: Make aio_add_req_to_fsp() public.Jeremy Allison2014-12-052-1/+2
| | | | | | | | 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>
* s3: leases : Cope with renaming leased open files.Jeremy Allison2014-12-051-1/+24
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: leases: Add leases_db_rename() to cope with renaming a leased file.Jeremy Allison2014-12-052-1/+27
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb-recoverd: Process all the records for vacuum fetch in a loopAmitay Isaacs2014-12-051-4/+1
| | | | | | | | | | | | | | 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
* ctdb-vacuum: Do not delete VACUUM MIGRATED records immediatelyAmitay Isaacs2014-12-051-0/+5
| | | | | | | | 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>
* ctdb-vacuum: Use non-blocking lock when traversing delete treeAmitay Isaacs2014-12-051-5/+1
| | | | | | | | This avoids vacuuming getting in the way of ctdb daemon to process record requests. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-vacuum: Use non-blocking lock when traversing delete queueAmitay Isaacs2014-12-051-5/+1
| | | | | | | | This avoids vacuuming getting in the way of ctdb daemon to process record requests. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-vacuum: Stagger vacuuming child processesAmitay Isaacs2014-12-051-0/+11
| | | | | | | | This prevents multiple child processes being forked at the same time for vacuuming TDBs. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-vacuum: Track time for vacuuming in database statisticsAmitay Isaacs2014-12-053-0/+12
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* vfs_fruit: add AAPL optionsRalph Boehme2014-12-051-0/+35
| | | | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Dec 5 00:34:01 CET 2014 on sn-devel-104
* s4:torture:vfs_fruit: smb2/create context AAPL testRalph Boehme2014-12-041-0/+273
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:libcli/raw: make short_name available in bufferRalph Boehme2014-12-042-0/+2
| | | | | | | | | | This will be used in smb2/create AAPL context torture tests, where the server returns an Mac OS X specific data blob in the short name buffer. It's not a string, so the existing string extraction doesn't cut it. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: add SMB_VFS_READDIR_ATTR() to marshall direntryRalph Boehme2014-12-041-6/+58
| | | | | | | | | | | | | | SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata for a directory entry when we're already marshalling the SMB reply buffer. This would we used, when there's a need to repurpose some fields in the the reply, like it's done with Apple's SMB2 extension "AAPL". We then fetch AAPL metadata with the shiny new SMB_VFS_READDIR_ATTR() VFS call and marshall appropiately. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_fruit: AAPL supportRalph Boehme2014-12-041-6/+453
| | | | | | | | | | * readdir_attr VFS functions, used in trans2 when marshalling metadata associated with a directory entry * support for reading and writing UNIX mode via MS NFS ACEs in NT ACL Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: ignore dacls with MS NFS ACEsRalph Boehme2014-12-043-0/+22
| | | | | | | | | | Ignore NFS ACEs in code the modifies * default POSIX ACLs * VFS: NFSv4 ACLs * VFS: xattr and tdb ACLs Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/security: add a function that checks for MS NFS ACEsRalph Boehme2014-12-042-0/+24
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/security: add NFS SID mappingsRalph Boehme2014-12-042-0/+22
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: add SMB2 AAPL create context definesRalph Boehme2014-12-042-0/+47
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:vfs: add create tags to SMB_VFS_CREATEFILERalph Boehme2014-12-0420-57/+125
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: allocate out_context_blobs with tallocRalph Boehme2014-12-041-16/+21
| | | | | | | | | | | | | By tallocing the out_context_blobs instead of using an automatic stack variable, we can use out_context_blobs as talloc parent for individual create tag that we add via smb2_create_blob_add(). This is in preperation of a SMB_VFS_CREATE_FILE modification where I add the in and out_context_blobs as additional args. With this change in place we can add create tags to out_context_blobs from there too. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:vfs: add SMB_VFS_READDIR_ATTR()Ralph Boehme2014-12-0410-0/+129
| | | | | | | | | | | | SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata for a directory entry when we're already marshalling the SMB reply buffer. This would be used, when there's a need to repurpose some fields in the the reply, like it's done with Apple's SMB2 extension "AAPL". Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* unix_msg: Fix unix_msg_test_drainVolker Lendecke2014-12-041-0/+7
| | | | | | | | | | | | poll_funcs_init_tevent does not register a tevent context by default. This used to be the case in an early development stage, but apparently I haven't tested this for a while :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Thu Dec 4 18:55:08 CET 2014 on sn-devel-104
* docs-xml: document the interaction between "write cache size" and "aio ↵Stefan Metzmacher2014-12-041-0/+2
| | | | | | | | | | read/write size" Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Dec 4 08:09:15 CET 2014 on sn-devel-104
* s3:smbd: document the interaction between "smb2 leases" and "write cache size"Stefan Metzmacher2014-12-043-0/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest:Samba3: use "smb2 leases = yes"Jeremy Allison2014-12-042-13/+1
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>