summaryrefslogtreecommitdiff
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
...
* ctdb: Fix build on AIXAmitay Isaacs2018-07-105-12/+12
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 40a8ab1ce0c1b291af7263da13c25c37cee69670)
* ctdb-common: Use sin6_len only if the structure supports itAmitay Isaacs2018-07-103-4/+4
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 79992dbb73ac9749ac987cb6a88964fa600b4c35)
* ctdb-docs: Fix the documentation for VNN mapMartin Schwenke2018-07-101-4/+3
| | | | | | | | | | | It is incorrectly says that nodes not in the VNN map can not be DMASTER. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit af446d5209e37a38363911e5f339869b73d87963)
* ctdb-server: Rename CTDB_BROADCAST_VNNMAP -> CTDB_BROADCAST_ACTIVEMartin Schwenke2018-07-107-17/+27
| | | | | | | | | | | | | | | | | | | | | | This broadcast is misnamed. Both places where this type of broadcast is used expect the broadcast to go to all active nodes. Make the corresponding change to the semantics in the daemon by sending to all active nodes. There is a mismatch between the ideas of VNN map and active nodes. A node that is not in the VNN map but is active can still host database records. These were the same until the LMASTER capability was introduced and then the logic was not updated. The only place where the VNN map is relevant is when finding the location master of a record in the migration code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 36938bfdd075a174daecb466085702adfe6a6c09)
* ctdb-tests: Add a simple test for database traversesMartin Schwenke2018-07-101-0/+94
| | | | | | | | | | | This tests that volatile databases traverse correctly, including the case where a record was updated on a non-lmaster node. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit ec72fadecd5233234947633360fe46a3a4053c07)
* ctdb-tests: Add check for non-lmaster node status in integration testsMartin Schwenke2018-07-101-0/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 4b008556d6b1f07fd5057af845526bf941497f18)
* ctdb-client: Fix typo where CTDB_BROADCAST_ALL is repeatedMartin Schwenke2018-07-101-1/+1
| | | | | | | | | | Surely this is meant to be CTDB_BROADCAST_CONNECTED? BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 77db0b15b56f9921961bd753c210e6fdbaf97f6d)
* ctdb-client: Remove ununsed functions from old client codeAmitay Isaacs2018-05-072-2529/+10
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13411 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 01c8dc7e15b8764a9b8c8e34b84d0cab790edf47)
* ctdb-scripts: Drop "net serverid wipe" from 50.samba event scriptAmitay Isaacs2018-04-101-2/+0
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13359 There is no serverid database anymore. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Sat Mar 31 08:34:00 CEST 2018 on sn-devel-144 (cherry picked from commit 6b75d2c650aa9ee632122fa87ea8a2a98f1fa613)
* ctdb-client: Client code should never free the client contextAmitay Isaacs2018-04-061-1/+0
| | | | | | | | This should never have been done. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 376e9794e2d19e8d17b0bdde36ce8a1a205986c6)
* ctdb-client: Add missing initialization of tevent_contextAmitay Isaacs2018-04-061-0/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13356 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 4e37be92bfb790150b3791bef552aa4acf8f78b7)
* ctdb-client: Do not try to allocate 0 sized recordAmitay Isaacs2018-04-061-7/+12
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13356 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 92a68af1a8473dc2a5d9d6036830f944e968606d)
* ctdb-tests: Don't use nc -d or -w optionsMartin Schwenke2018-04-066-6/+6
| | | | | | | | | | | | | | | | | | | nmap-ncat is used in some distributions to replace netcat. It has a different meaning for these options. We can get the same effect as the current combination of -d and -w by piping a sleep process to nc. Subsequent use of $! works because it gets the last process in pipeline. Note that redirecting from /dev/null doesn't work with some versions of nc. They just exit when they get EOF. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13327 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 9e954bcbf43d67a18ee55f84cda0b09028f96b92)
* ctdb-tests: Set test timeout to an hourMartin Schwenke2018-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The current 10 minute timeout is causing autobuild failures in some environments. This timeout is simply meant to stop a test run from hanging indefinitely due to a broken test. A 1 hour timeout is better than no timeout. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Feb 8 04:42:56 CET 2018 on sn-devel-144 (cherry picked from commit a3485c41b826e307b31a1113abcea9843ca78540) The last 6 patches address https://bugzilla.samba.org/show_bug.cgi?id=13265 Autobuild-User(v4-8-test): Stefan Metzmacher <metze@samba.org> Autobuild-Date(v4-8-test): Mon Feb 12 15:54:28 CET 2018 on sn-devel-144
* ctdb-tests: Fix a typoMartin Schwenke2018-02-121-1/+0
| | | | | | | | | | | | | | | | | This typo causes the script to be run with the default shell. If this is not bash then the shell will fail to parse integration.bash. This is a regression caused by commit c607989d91b64d837253aae794b1a3d6013eb3e0. Clearly nobody has run this test on Debian for a long time. :-( Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Wed Jan 24 10:28:52 CET 2018 on sn-devel-144 (cherry picked from commit 8b82d10856160d3b3f172bf7d45ac561002dbcac)
* ctdb-tests: Add a UNIT pseudo-test-suiteMartin Schwenke2018-02-121-5/+27
| | | | | | | | This runs all of the unit tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 50150d75814de6a1e2cb28fb7af72caa31d73e3c)
* ctdb-tests: Only use socket-wrapper for simple, local daemon testsMartin Schwenke2018-02-123-11/+11
| | | | | | | | | The run_tests.sh -S option now takes the path to the socker-wrapper shared library. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit e17d02d4039001563d189b33200c30e3906ce845)
* ctdb-tests: Add timeout for individual tests, default is 10 minutesMartin Schwenke2018-02-121-2/+7
| | | | | | | | | | This will cause a hung test to time out and fail rather than letting a test run hang indefinitely. Some tests can take 5 minutes to run, so 10 minutes should be plenty. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit da3aaf972ab5b339b51ba1e802329b69885ccfe4)
* ctdb-tests: Avoid race condition in sock_daemon test 5Amitay Isaacs2018-02-121-9/+17
| | | | | | | | | This test fails when it takes more than 10s to run. This can occur when the system is loaded and socket-wrapper is used. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 33c0f5599d93a34619c8f37945f79a6e399a1b5e)
* build: deal with recent glibc sunrpc header removalGünther Deschner2018-01-251-1/+1
| | | | | | | | | | | | | | | | We need to rely on libtirpc or libntirpc to be around in that case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238 BUG: https://bugzilla.samba.org/show_bug.cgi?id=10976 Guenther Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> (cherry picked from commit ee0be7eb723be1420fd601ea1abe0af748562953)
* systemd: Add documentation to Unit filesMathieu Parent2018-01-141-0/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12402 Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* doc/ctdb: fix two typosBjörn Baumbach2017-12-191-2/+2
| | | | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb/tcp/tcp_connect.c set socket close on execGary Lockyer2017-12-181-0/+1
| | | | | | | | | | Set SOCKET_CLOEXEC on the sockets returned by accept. This ensures that the socket is unavailable to any child process created by system(). Making it harder for malicious code to set up a command channel, as seen in the exploit for CVE-2015-0240 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb/server/ctdb_daemon.c set socket close on execGary Lockyer2017-12-181-0/+1
| | | | | | | | | | Set SOCKET_CLOEXEC on the sockets returned by accept. This ensures that the socket is unavailable to any child process created by system(). Making it harder for malicious code to set up a command channel, as seen in the exploit for CVE-2015-0240 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb-recovery-helper: Deregister message handler in error pathsAmitay Isaacs2017-12-131-4/+12
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13188 If PULL_DB control times out but the remote node is still sending the data, then the tevent_req for pull_database_send will be freed without removing the message handler. So when the data is received, srvid handler will be called and it will try to access tevent_req which will result in use-after-free and abort. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Add async version for ctdb_client_init()Amitay Isaacs2017-12-132-66/+166
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Avoid using void ** argumentAmitay Isaacs2017-12-132-3/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Apply dependency to correct subsystemAmitay Isaacs2017-12-131-2/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Send STARTUP control after startup eventAmitay Isaacs2017-11-302-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13154 STARTUP control is primarily used to synchronise tcp tickles from running nodes to a node which has just started up. Earlier STARTUP control was sent (using BROADCAST_ALL) after setup event. Once the other nodes in the cluster connected to this node, the queued up messages would be sent and the tcp tickles would get synchronised. Recent fix to drop messages to disconnected or not-yet-connected nodes, the STARTUP control was never sent to the remote nodes and the tcp tickles did not get synchronised. To fix this problem send the STARTUP control (using BROADCAST_CONNECTED) after startup event. By this time all the running nodes in the cluster are connected. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Nov 30 15:29:48 CET 2017 on sn-devel-144
* ctdb-takeover: Send tcp tickles immediately on STARTUP controlAmitay Isaacs2017-11-301-8/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13154 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-takeover: Refactor code to send tickle lists for all public IPsAmitay Isaacs2017-11-301-17/+27
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13154 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* build: Move socket_wrapper to third_partyAndreas Schneider2017-11-251-6/+15
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* ctdb-eventd: Simplify eventd codeAmitay Isaacs2017-11-241-166/+17
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Nov 24 15:49:46 CET 2017 on sn-devel-144
* ctdb-common: Add special monitor handling to run_event abstractionAmitay Isaacs2017-11-241-10/+135
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Make sure child processes are waited on after terminationAmitay Isaacs2017-11-241-2/+11
| | | | | | | | | Looks like the if a process holding fcntl lock (on pid file) is killed, then the lock is not released till the process is reaped using either wait() or waitpid(). Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add async version of shutdown in sock_daemonAmitay Isaacs2017-11-213-9/+110
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Tue Nov 21 08:58:45 CET 2017 on sn-devel-144
* ctdb-common: Add async version of reconfigure in sock_daemonAmitay Isaacs2017-11-214-0/+161
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add async version of startup in sock_daemonAmitay Isaacs2017-11-214-0/+95
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Create sock_daemon_funcs per testAmitay Isaacs2017-11-211-30/+40
| | | | | | | This avoids defining sock_daemon functions that are not needed in the test. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Handle errors on unexpected socket close in sock_daemonAmitay Isaacs2017-11-211-3/+16
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Start listening to sockets only on successful startupAmitay Isaacs2017-11-213-43/+161
| | | | | | | | Fix tests to use wait_send() instead of startup() as a synchronization point to ensure that the socket is listening. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Start wait computation only after successful startupAmitay Isaacs2017-11-212-11/+23
| | | | | | | This orders the startup events in sock_daemon code. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Return status from sock_daemon startup()/reconfigure()Amitay Isaacs2017-11-214-18/+85
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Do not use sock->req outside sock_socket functionsAmitay Isaacs2017-11-211-3/+4
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Call missing tevent_wakeup_recv() in sock_daemonAmitay Isaacs2017-11-211-0/+8
| | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=13153 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Allocate deferred calls off calling contextAmitay Isaacs2017-11-211-1/+13
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13152 This makes sure that if a client disconnects, all the deferred calls from the client are correctly freed. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* gpo: move mkdir_p to lib/utilDavid Mulder2017-11-202-48/+2
| | | | | | | | Move the mkdir_p function to lib/util so it can be used elsewhere Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb-tests: Fix some harmless CIDsMartin Schwenke2017-11-081-8/+6
| | | | | | | | | | | | | | | | | | CID 1420632: Resource leaks (RESOURCE LEAK) CID 1420631: Security best practices violations (TOCTOU) CID 1417432: Resource leaks (RESOURCE LEAK) CID 1417429: Security best practices violations (TOCTOU) CID 1417427: Resource leaks (RESOURCE LEAK) These are all in test code and constrained to the test environment, so can't result in privilege escape. No backport necessary. However, we might as well get them off the list. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Wed Nov 8 11:28:40 CET 2017 on sn-devel-144
* ctdb-tests: Add sock_daemon test for stale socket handlingMartin Schwenke2017-11-072-0/+141
| | | | | | | | 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 Nov 7 07:51:02 CET 2017 on sn-devel-144
* ctdb-common: Fix stale socket removalAmitay Isaacs2017-11-073-23/+61
| | | | | | | | | | | Sockets need to be created from sock_daemon_run_send(). This means that stale socket removal can depend on the PID file context being initialised. Also fix associated test. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>