summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* build: Address may be used uninitialized in this function on Ubuntu 10.04Andrew Bartlett2016-06-081-1/+2
| | | | | | | | | | This is not found by modern compilers, but prevents the -Werror -O3 build on Ubuntu 10.04 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 8 08:48:57 CEST 2016 on sn-devel-144
* build: Try to work around strict aliasing rules on Ubuntu 10.04Andrew Bartlett2016-06-081-2/+4
| | | | | | | | | | | | We get cc1: warnings being treated as errors ../lib/util/util_net.c: In function get_socket_port: ../lib/util/util_net.c:921: error: dereferencing pointer sa.106 does break strict-aliasing rules ../lib/util/util_net.c:921: note: initialized from here ../lib/util/util_net.c:925: error: dereferencing pointer sa.107 does break strict-aliasing rules ../lib/util/util_net.c:925: note: initialized from here Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-cluster-mutex: Fix #endif decorationAmitay Isaacs2016-06-081-1/+1
| | | | | | | | 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): Wed Jun 8 04:52:18 CEST 2016 on sn-devel-144
* ctdb-recoverd: Release recovery lock on exitMartin Schwenke2016-06-081-0/+21
| | | | | | | | | | | The recovery lock helper must exit when it notices its parent is gone. However, that can take a few seconds. The usual way of terminating the recovery daemon is for the main ctdbd to send it a SIGTERM. Installing a handler is nice and simple. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Add handler for lost recovery lockMartin Schwenke2016-06-081-2/+19
| | | | | | | | | | | If the process holding the recovery lock terminates unexpectedly then the recovery daemon needs to know that the lock is no longer held. While here, rename hold_reclock_handler() to take_reclock_handler() so there is a clear difference between the two handler names. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-cluster-mutex: Register an extra handler for when mutex is lostMartin Schwenke2016-06-084-4/+21
| | | | | | | Pass NULL if not needed. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-cluster-mutex: ctdb_cluster_mutex() registers handler and private dataMartin Schwenke2016-06-084-25/+12
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-cluster-mutex: Drop cluster_mutex_handler() ctdb and handle argumentsMartin Schwenke2016-06-084-18/+13
| | | | | | | | This makes the API more general. If they are needed in a handler then they can be in the private data. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recovery: Wrap private data for reclock test callbackMartin Schwenke2016-06-081-11/+22
| | | | | | | | This will allow a simplification of the cluster mutex API, so the private data can be registered when calling ctdb_cluster_mutex(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Simplify reclock handlerMartin Schwenke2016-06-081-4/+6
| | | | | | | Do the interesting work outside the handler. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Recovery lock handle should be in recovery deamon contextMartin Schwenke2016-06-083-16/+22
| | | | | | | This shouldn't be in the CTDB context. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-cluster-mutex: Pass a talloc context to allocate the handle offMartin Schwenke2016-06-084-5/+9
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: No need to reset reclock handlerMartin Schwenke2016-06-081-3/+0
| | | | | | | It won't be called more than once by the cluster mutex code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-cluster-mutex: Don't call the supplied hander more than onceMartin Schwenke2016-06-081-0/+9
| | | | | | | | After the first activity on the file descriptor, ignore any subsequent activity. Single-shot handlers are easier to write. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Fix buggy function return on memory allocation failureMartin Schwenke2016-06-081-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Don't expose internal cluster mutex statusMartin Schwenke2016-06-081-4/+4
| | | | | | | Just expose whether the lock was taken. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Rename recovery lock file to just recovery lockMartin Schwenke2016-06-085-17/+17
| | | | | | | | | It isn't necessarily a file. Don't bother changing the control, since it doesn't pervade the code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Drop function ctdb_set_recovery_lock_file()Martin Schwenke2016-06-083-30/+6
| | | | | | | Setting the recovery lock file at startup can be done more simply. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-protocol: CTDB_CONTROL_SET_RECLOCK_FILE is obsoleteMartin Schwenke2016-06-082-31/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-protocol: Drop support for SET_RECLOCKMartin Schwenke2016-06-086-60/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-client: Remove support for SET_RECLOCKMartin Schwenke2016-06-084-65/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recovery: Don't update recovery lock from daemonMartin Schwenke2016-06-081-53/+0
| | | | | | | It can't change after startup. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recovery: Don't sync recovery lock across clusterMartin Schwenke2016-06-081-39/+0
| | | | | | | | Support for updating the recovery lock is being removed because it isn't possible to recover from failure. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recovery: Consistency check reclock in start recovery controlMartin Schwenke2016-06-081-18/+101
| | | | | | | | If the recovery lock setting is not consistent with that of the recovery master then abort. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tool: Drop support for "ctdb setreclock" commandMartin Schwenke2016-06-082-62/+0
| | | | | | | | | | | | | | | | | | | | The recovery lock can not be reliably updated at run-time. If it fails to update on some nodes then split-brain protection is gone and there is no reasonable way to repair the situation. CTDB will have to be restarted on all nodes. So, if this feature is being used to avoid scheduling an outage then an outage will have to be scheduled just in case! To update the recovery lock, shut down CTDB on all nodes, reconfigure the recovery lock and start CTDB again. Those that *really* want to be able to change the recovery lock at run-time can still do so. Set CTDB_RECOVERY_LOCK to point to a script and this script can then be modified at run-time. However, please don't report bugs if bad things happen... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Replace "ctdb setrelock" test with "ctdb getreclock" testMartin Schwenke2016-06-082-123/+34
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* libsmb: Fix two CIDs for NULL dereferenceVolker Lendecke2016-06-071-6/+12
| | | | | | | | | | | This whole area is a known-to-be-broken mess, but this patch should fix the immediate crash Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jun 7 18:31:30 CEST 2016 on sn-devel-144
* rpc_server: Fix CID 1362565 Improper use of negative valueVolker Lendecke2016-06-071-1/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Fix CID 1362566 Dereference null return valueVolker Lendecke2016-06-071-1/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Add accept_send/recvVolker Lendecke2016-06-072-0/+88
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Move poll_funcs to lib/Volker Lendecke2016-06-076-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* lib/util: Expose few more subsystems for standalone ctdb buildAmitay Isaacs2016-06-071-17/+17
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* lib: Move msghdr to lib/util/Volker Lendecke2016-06-076-8/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* lib/poll_funcs: Build as SAMBA_SUBSYSTEMAmitay Isaacs2016-06-071-3/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* repl: Avoid use-after-free when working with the working_schemaAndrew Bartlett2016-06-071-1/+1
| | | | | | | | | | | | The original schema must live as long as the working_schema as the working_schema starts as a shallow-copy of schema. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=11953 Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Jun 7 14:33:39 CEST 2016 on sn-devel-144
* selftest: Add a reverse variation to ReplicateMoveObject3Andrew Bartlett2016-06-071-0/+180
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Samba <garming@catalyst.net.nz>
* selftest: Assert replPropertyMetaData values before and after replicationAndrew Bartlett2016-06-071-49/+916
| | | | | | | | | This covers renames, addition of attributes, and the delete. We also confirm the results via DRS. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Fix rename and RDN handling for replPropertyMetaDataAndrew Bartlett2016-06-073-73/+114
| | | | | | | | | | | | | | | This matches Windows 2012R2, which both has the RDN not sorted last and has it updated with the local invocation_id and a local version. The RDN attribute, unlike name, is not replicated over DRS, so the impact for interopability extends only to the incorrect RDN values that we were finding with dbcheck (values that did not match the name values). Finally, we always force the RDN to match the name attribute, which avoids issues in dbcheck where these diverge. As such, we can finally remove dbcheck as a flapping test, last re-added in e4bab3a8282d263eb2391bc7e8a6fd64ae068935 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Fix incorrect sorting of replPropertyMetaData with RDN lastAndrew Bartlett2016-06-076-101/+40
| | | | | | | | | | | Per tests against Windows 2012R2 the RDN is not sorted last and is instead sorted normally with all the other elements. The RDN attribute, unlike name, is not replicated over DRS, so this has no interopability impact. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz
* dsdb: Show initial replicated modify as well as resolved modify in ↵Andrew Bartlett2016-06-071-1/+21
| | | | | | | repl_meta_data Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz
* selftest: Add more tests to cover attribute changes vs DN renamesAndrew Bartlett2016-06-071-15/+645
| | | | | | | This covers a bug where unrelated attribute changes would reverse a rename Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz
* dsdb: Use replmd_replPropertyMetaData1_new_should_be_taken in ↵Andrew Bartlett2016-06-071-8/+20
| | | | | | | | | replmd_replicated_apply_search_callback() This is the primary handler for renames Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz
* dsdb: Use replmd_replPropertyMetaData1_new_should_be_taken in ↵Andrew Bartlett2016-06-071-20/+4
| | | | | | | | | replmd_replicated_apply_merge() This is the main handler for attribute conflicts Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz
* dsdb: Use replmd_replPropertyMetaData1_new_should_be_taken in ↵Andrew Bartlett2016-06-071-6/+20
| | | | | | | replmd_replicated_handle_rename() Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Use replmd_replPropertyMetaData1_new_should_be_taken in ↵Andrew Bartlett2016-06-071-6/+19
| | | | | | | replmd_op_possible_conflict_callback() Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Add new helper function replmd_replPropertyMetaData1_new_should_be_taken()Andrew Bartlett2016-06-071-0/+41
| | | | | | | | This will allow the test for "name" and the actual DN to be consistent, and so avoids dbcheck errors when CN and name do not match the DN Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz
* selftest: Do not scan the full DB to confirm a specific DN in dbcheckAndrew Bartlett2016-06-071-1/+1
| | | | | | | | This avoids a full DB scan and therefore reduces the test time taken when we just modified the cn=administrator record. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* selftest: Run the krb5.kdc test on a more selective basisAndrew Bartlett2016-06-071-18/+27
| | | | | | | | The previous tests would take 20mins, the new set of tests take around 7 mins and still cover the important combinations, given that it is the same KDC code in each environment Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* selftest: These replication tests are now OK after we fixed all the ↵Andrew Bartlett2016-06-071-3/+0
| | | | | | | | | | | | | replication bugs We have run this test a number of times, and these tests do not flap in those tests Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Jun 7 01:45:08 CEST 2016 on sn-devel-144
* selftest: Add tests to show that we can not create duplicate schema entriesAndrew Bartlett2016-06-061-2/+655
| | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Jun 6 20:32:54 CEST 2016 on sn-devel-144