summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* s3:ctdb_conn: only use ctdb_protocol.h or ctdb_private.h in ctdb_conn.cStefan Metzmacher2014-03-242-16/+9
| | | | | | | We don't need them in ctdb_conn.h. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* wafsamba: use cluster_support_features in build_options.cStefan Metzmacher2014-03-241-0/+5
| | | | | | | | This way 'smbd -b' returns the cluster features of the currently used libsamba-cluster-support.so. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:lib: add cluster_support_[available|features]()Stefan Metzmacher2014-03-243-0/+112
| | | | | | | This allows runtime selection of libsamba-cluster-support.so Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:param: move lp_ctdbd_socket() to ctdbd_conn.cStefan Metzmacher2014-03-248-14/+24
| | | | | | | This allows us to use CTDB_PATH only in ctdbd_conn.c Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:lib: move all ctdb related dummy functions to ctdb_dummy.cStefan Metzmacher2014-03-247-121/+180
| | | | | | | This gets all dummy functions for the build without CLUSTER_SUPPORT. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:ctdbd_conn: always provide ctdb_serverids_exist()Stefan Metzmacher2014-03-241-4/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:ctdbd_conn: add ctdb_serverids_exist_supported()Stefan Metzmacher2014-03-242-0/+10
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:wscript: create a libsamba-cluster-support.soStefan Metzmacher2014-03-241-7/+18
| | | | | | | | | | This collects the ctdb version dependent files, which allows vendors to provide multiple versions of libsamba-cluster-support.so each compiled against different ctdb versions. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* wafsamba: add CONFIG_RESET()Stefan Metzmacher2014-03-241-0/+8
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lsa.idl: define lsa.ForestTrustCollisionInfo and ForestTrustCollisionRecord ↵Alexander Bokovoy2014-03-241-2/+2
| | | | | | | | | | | | | | | | | | | | | as public structs For Python bindings PIDL wants the struct to be defined as public if we want to use __ndr_print/pack/unpack. Define the [public] attribute to ForestTrustCollisionInfo/Record to allow easier debugging when there is collision in establishing a trust. This change does not affect C code as NDR functions are always generated, only not exposed in Python bindings. https://bugzilla.samba.org/show_bug.cgi?id=10504 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Mon Mar 24 12:44:50 CET 2014 on sn-devel-104
* ctdb/daemon: Optimise deletion of IPsMartin Schwenke2014-03-231-11/+11
| | | | | | | | | | | | | | | | Previous commits maintained the ordering between ctdb_remove_orphaned_ifaces() and ctdb_vnn_unassign_iface(). This meant that ctdb_remove_orphaned_ifaces() needed to steal the orphaned interfaces and they would be freed later. Unassign the interface first and things get simpler. ctdb_remove_orphaned_ifaces() is now self-contained. 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): Sun Mar 23 06:20:43 CET 2014 on sn-devel-104
* ctdb/daemon: Make delete IP wait until the IP is releasedMartin Schwenke2014-03-233-31/+100
| | | | | | | | | | | | reloadips really expects deleted IPs to be released before completing. Otherwise the recovery daemon starts failing the local IP check. The races that follow can cause a node to be banned. To make the error handling simple, do the actual deletion in release_ip_callback(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Improve tickle testsMartin Schwenke2014-03-233-20/+45
| | | | | | | | | | | | | | | | | | | | | It is hard to diagnose failures in the NFS tickle test because there's no way of telling if the test node doesn't have the tickle or if it didn't get propagated. Factor out check_tickles() into local.bash and give it some parameters. Have the NFS test call it first to ensure the tickle has been registered. Then use new function check_tickles_all() to ensure the tickle has been propagated to all nodes. Give this a bit of extra time (double the timeout) just in case we're racing with the update. Add a useful comment to the CIFS test so that I stop asking myself how the test could ever have worked reliably. :-) Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
* ctdb-eventscripts: Fix regression in IP add/delete functionsMartin Schwenke2014-03-231-4/+8
| | | | | | | | Commit 176ae6c704528c021fcc34a41878584f43a00119 caused these functions to exit on failure. This is incorrect and broke NAT gateway. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Do not disable monitoring when running eventscriptsMartin Schwenke2014-03-231-5/+0
| | | | | | | | | | | | This is racy and cbffbb7c2f406fc1d8ebad3c531cc2757232690e makes it unnecessary. The eventscript code still knows that monitor events are special compared to other events. However, the general concept of monitoring is no longer tangled up with running scripts. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-eventscripts: Attach to persistent ctdb.tdb in "startup" eventMartin Schwenke2014-03-231-1/+2
| | | | | | | | | | | | | "statd-callout notify" currently complains until an add-client or del-client is done. Given that we might use ctdb.tdb for something else in the future it makes sense attach to it in the "startup" event. This could be done in the background but it should be so lightweight that a timeout will indicate serious problems. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Fix tickle updates to recently started nodesMartin Schwenke2014-03-231-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0723fedcedd4a97870f7b1224945f1587363c9bf added a cheap implemention of ctdb_control_startup() that simply flags the recipient node as needing to send updates for each IP when the tickle update loop next fires. Commit 026996550d726836091ff5ebd1ebf925bf237bb0 ensures that a node only sends tickle updates once being flagged to do so. CTDB_CONTROL_STARTUP is broadcast to all nodes, so this is a good start. However, the tickle updates are only broadcast to connected nodes. A recently started node may not yet be considered to be connected because the keepalive monitoring loop may not yet have marked the node as connected. This means that the tickle update loop races with the keepalive monitoring loop. If the tickle update loop wins then updates will not be sent to the recently started node. The simplest improvement is to stop the tickle update from depending on whether a node is connected or not. So instead of broadcasting tickle updates to connected nodes, they are broadcast to all nodes. Since no reply is expected, this should work just fine. While looking at this code, ctdb_ctrl_set_tcp_tickles() is named like a client function. It isn't a client function. Also, 2 of the arguments are ignored. So rename this function to ctdb_send_set_tcp_tickles_for_ip() and remove the ignored arguments. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Parse IP addresses when reading a list from a fileMartin Schwenke2014-03-231-21/+15
| | | | | | | | This way this logic is centralised. It also means that the IP address comparisons in the NAT gateway code are IPv6 safe. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Remove redundant filtering of trailing empty linesMartin Schwenke2014-03-231-3/+0
| | | | | | | There is a check for empty lines in the loop just below. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Use DLIST_ADD_END() to avoid reversing the listMartin Schwenke2014-03-231-14/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Factor out function read_pnn_node_file()Martin Schwenke2014-03-231-58/+36
| | | | | | | | Factor it from read_nodes_file(). Use it there and in read_natgw_nodes_file(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add "ctdb listnodes" and "ctdb xpnn" stub testsMartin Schwenke2014-03-238-1/+158
| | | | | | | | | | | | | | | Tests for xpnn need to implement a stub for ctdb_sys_have_ip(). The cheapest way of doing this is to read a fake nodemap using the existing code and check if the IP of the "current" node is the one being asked about. However, the fake state initialisation isn't currently available to without_daemon commands because it is meant to represent daemon state. However, it can be made available by moving the relevant code into a new stub for tevent_context_init(). The stub still needs to initialise a tevent context - this can be done by calling a lower level function. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Read NAT gateway nodes from a separate functionMartin Schwenke2014-03-231-38/+53
| | | | | | | Now it gets easier to refactor. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Add and use function filter_nodemap_by_natgw_nodes()Martin Schwenke2014-03-231-29/+43
| | | | | | | | | | | | Add another filter function, like the ones for capabilities and flags to, for filtering by NAT gateway nodes. This makes the main natgw_list function more readable. Note that this drops the early filtering of disconnected nodes, so they will now be listed in a NAT gateway group. This makes sense. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Update LVS commands to use filter_nodemap_by_flags()Martin Schwenke2014-03-231-67/+41
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Update LVS commands to use filter_nodemap_by_capabilities()Martin Schwenke2014-03-231-42/+22
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Fixes for "lvs" and "lvsmaster" commandsMartin Schwenke2014-03-231-3/+4
| | | | | | | The index of the nodes array in nodemap isn't the PNN. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Generalise find_natgw() -> filter_nodemap_by_flags()Martin Schwenke2014-03-231-15/+28
| | | | | | | | | | | | Instead of just finding the first node that doesn't have any flags in flag_mask set, change it into a function that filters a nodemap to exclude nodes with the given flags. This makes the NATGW code simpler but also provides a function that can be used in other code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Update natgwlist to filter nodes by NATGW capabilityMartin Schwenke2014-03-231-14/+55
| | | | | | | | Check capabilities once to build a filtered node list instead of repeatedly checking capabilities Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: New natgwlist tests where nodes capability not setMartin Schwenke2014-03-232-0/+74
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Update ctdb stub LVS tests and add some new onesMartin Schwenke2014-03-2310-5/+194
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Support fake capabilities in CTDB tool stubMartin Schwenke2014-03-232-4/+77
| | | | | | | ... and add a test to make sure it works. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Remove old, unused copy of a CTDB tool unit testMartin Schwenke2014-03-231-34/+0
| | | | | | | | This looks to have got left behind a long time ago when things got moved around... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Don't close stderr when running without_daemon commandsMartin Schwenke2014-03-231-1/+0
| | | | | | | | | | | | | It looks like the original without_daemon code still tried to establish a client connection to the daemon. Closing stderr looks to be a cheap way of hiding the errors when this failed. However, later cleanups avoid the client connection altogether, so do not close stderr. Now debug output from without_daemon commands actually appears. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb/pmda: Fix metric identifiersDavid Disseldorp2014-03-221-123/+141
| | | | | | | | | | | | | | | The commit "pmda: Use upstream assigned PCP domain id" updated the Performance Metrics Namespace (pmns) file, without changing the corresponding metric identifiers used by the agent. This change fixes the agent metric identifier values to match the pmns definitions. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Mar 22 00:07:31 CET 2014 on sn-devel-104
* smbd: Remove unused "share_mode_data->id"Volker Lendecke2014-03-212-2/+0
| | | | | | | | 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 Mar 21 21:22:24 CET 2014 on sn-devel-104
* smbd: Keep "the_lock"s file id separatelyVolker Lendecke2014-03-211-1/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Avoid checking the_lock->id for fresh locksVolker Lendecke2014-03-211-4/+5
| | | | | | | If we just fetched the lock, this check will always be true. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Explicitly pass "file_id" to rename_share_filenameVolker Lendecke2014-03-213-3/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use fsp->file_id in open_file_ntcreateVolker Lendecke2014-03-211-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Explicitly pass "file_id" to schedule_defer_openVolker Lendecke2014-03-211-3/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Explicitly pass "file_id" to rename_open_filesVolker Lendecke2014-03-211-3/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dfs_server: randomize the server redirect setArvid Requate2014-03-211-0/+20
| | | | | | | | comply with [MS-DFSC] section 3.2.1.1 Signed-off-by: Arvid Requate <requate@univention.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: smbd: Ensure we always go via getgroups_unix_user() when creating an NT ↵Jeremy Allison2014-03-211-0/+61
| | | | | | | | | | | | | | | token. This has to be done in every code path that creates an NT token, as remote users may have been added to the local /etc/group database. Tokens created merely from the info3 structs (via the DC or via the krb5 PAC) won't have these local groups. https://bugzilla.samba.org/show_bug.cgi?id=10508 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* build: Exclude source4/selftest/provisions/release-4-1-0rc3 from the tarballAndrew Bartlett2014-03-211-1/+1
| | | | | | | | | Change-Id: Id4ddaabb91363174d2fbef09e823f53b13912a51 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Mar 21 10:06:04 CET 2014 on sn-devel-104
* dbcheck: Ensure dbcheck can operate with --attrs setAndrew Bartlett2014-03-212-1/+6
| | | | | | | This also includes a test to ensure we do not regress on this point. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-rpc_server: Fix handling of fragmented rpc requests.Andreas Schneider2014-03-201-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to call pipe_init_outgoing_data() as the first thing in process_complete_pdu(). Otherwise the caller may use uninitialized memory and tries to write a response into the socket. The problem happens only if a real socket is used, which means in all cases for master and only with external rpc daemons in v4-0 and v4-1. The problem looks like this in the logs. [2014/03/20 14:49:35.531663, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1627(process_complete_pdu) Processing packet type 0 [2014/03/20 14:49:35.531695, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1472(dcesrv_auth_request) Checking request auth. [2014/03/20 14:49:35.531738, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:521(named_pipe_packet_process) Sending 1 fragments in a total of 0 bytes [2014/03/20 14:49:35.531769, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:526(named_pipe_packet_process) Sending PDU number: 0, PDU Length: 4294967228 [2014/03/20 14:49:35.531801, 2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:565(named_pipe_packet_done) Writev failed! [2014/03/20 14:49:35.531845, 2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:595(named_pipe_packet_done) Fatal error(Message too long). Terminating client(127.0.0.1) connection! BUG: https://bugzilla.samba.org/show_bug.cgi?id=10481 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Guenther Deschner <gd@samba.org Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Mar 20 18:30:17 CET 2014 on sn-devel-104
* s4-torture: add some tests for pre-allocated buffers in enumprinterdrivers call.Günther Deschner2014-03-201-0/+10
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4-torture: add test_EnumPrinterDrivers_buffers function.Günther Deschner2014-03-201-11/+31
| | | | | | | | | This will allow to test the enumdriver call with pre-allocated buffer. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: smbd: Fileserving share access checks.Jeremy Allison2014-03-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git commit 86d1e1db8e2747e30c89627cda123fde1e84f579 fixed share_access not being reset between users, by changing make_connection_snum() to call a common function check_user_share_access() in the same way that change_to_user() (which can be called on any incoming packet) does. Unfortunately that bugfix was incorrect and broke "force user" and "force group" as it called check_user_share_access() inside make_connection_snum() using the conn->session_info pointer instead of the vuser->session_info pointer. conn->session_info represents the token to use when actually accessing the file system, and so is modified by force user and force group. conn->session_info represents the "pristine" token of the user logging in, and is never modified by force user and force group. Samba 3.6.x checked the share access based on the "pristine" token of the user logging in, not the token modified by force user and force group. This change restores the expected behavior. Fixes bug #9878 - force user does not work as expected https://bugzilla.samba.org/show_bug.cgi?id=9878 Signed-off-by: Jeremy Allison <jra@samba.org> Tested-by: Gerhard Wiesinger <lists@wiesinger.com> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Mar 18 19:19:31 CET 2014 on sn-devel-104