summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* ctdb-protocol: Add marshalling for eventd protocolAmitay Isaacs2016-12-186-6/+1363
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add data types for eventd communicationAmitay Isaacs2016-12-181-0/+80
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add sock_daemon abstractionAmitay Isaacs2016-12-185-0/+1718
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add generic socket I/OAmitay Isaacs2016-12-183-1/+348
| | | | | | | | This is a generic socket read/write to be used in the ctdb daemon. It is based on ctdb_io.c and comm.c. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add run_proc abstractionAmitay Isaacs2016-12-185-2/+874
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add marshalling for int32_tAmitay Isaacs2016-12-183-0/+46
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Fix marshalling of string with lengthAmitay Isaacs2016-12-181-7/+8
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tool: Improve error reporting if helper execution failsAmitay Isaacs2016-12-181-6/+15
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tool: Allow passing multiple command-line arguments to helperAmitay Isaacs2016-12-181-5/+25
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* selftest: make sure we always export KRB5CCNAMEStefan Metzmacher2016-12-171-0/+8
| | | | | | | | | | | | | We should not risk the usage of the users global ccache! This results in unpredictable effects for the user and selftest itself. 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): Sat Dec 17 22:58:28 CET 2016 on sn-devel-144
* selftest: also export TMPDIRStefan Metzmacher2016-12-171-0/+1
| | | | | | | This should hopefully avoid usage of /tmp. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* script/autobuild.py: create tmpdir for each try and export it as TMPDIRStefan Metzmacher2016-12-171-0/+4
| | | | | | | | This way the compiler and other tools hopefully don't use /tmp anymore. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* script/autobuild.py: cleanup testbase/prefix before each retryStefan Metzmacher2016-12-171-1/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* script/autobuild.py: remove pointless mkdir/rmdir commandsStefan Metzmacher2016-12-171-2/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* script/autobuild.py: don't add subdirs of testbase to cleanup_listStefan Metzmacher2016-12-171-3/+0
| | | | | | | We already have testbase in there. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_gpfs: simplify stat_with_capability() ifdefRalph Boehme2016-12-171-6/+4
| | | | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Sat Dec 17 12:58:07 CET 2016 on sn-devel-144
* vfs_gpfs: remove updating btime from stat VFS callsRalph Boehme2016-12-171-80/+2
| | | | | | | | | | | | | | | | | | This is now handled by the vfs_gpfs_(f)get_dos_attributes. Getting rid of this in the stat VFS functions is a huge performance saver. perf report found that in a kernel copy workload smbd was spending considerable CPU time in vfs_gpfs_(f|l)stat -> gpfs_get_winattrs. Most of the time the VFS stat caller is not interested in the btime. The SMB frontend processing around btime is designed to fetch btime together with DOS attributes via dos_mode() in all places that need these attributes. That's the way it is implemented in the default VFS module and that's what vfs_gpfs now does as well for performance reasons. This makes vfs_gpfs_fstat a null op and I'm therefor removing it. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* vfs_gpfs: update btime in vfs_gpfs_(f)get_dos_attributesRalph Boehme2016-12-171-0/+6
| | | | | | | | | | | | | This paves the way for removing btime updates from the stat VFS functions. This way we behave like the default VFS module where DOS attributes and btime are fetched from the same backing store and the frontend is designed around using dos_mode() -> SMB_VFS_GET_ATTRIBUTES to update both attributes as necessary in the SMB processing. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* idmap_autorid: Simplify idmap_autorid_loadconfigVolker Lendecke2016-12-162-42/+27
| | | | | | | | | | autorid_global_config is a fixed small structure that can be stack-allocated. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Dec 16 21:30:28 CET 2016 on sn-devel-144
* idmap_autorid: Fix a small memleakVolker Lendecke2016-12-161-0/+1
| | | | | | | Not long-term, all callers free our "mem_ctx" immediately Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: Fix a race condition when acquiring rangesVolker Lendecke2016-12-161-0/+20
| | | | | | | | | | | | | | Here we are in a transaction to create a range, but we already found one to exist. We need to return the information about this range to the caller, just as we do when actually allocating the range. This does not hit us with current code, as we just have one idmap child. However, if we parallelize that, two children might have found a domain to not exist and call idmap_autorid_acquire_range simultaneously. One will create the range, the other one will find it to already exist. The second child will also have to pass the info up. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: Use acquire_range directlyVolker Lendecke2016-12-161-1/+1
| | | | | | | | idmap_autorid_get_domainrange is reading again for an existing mapping. We know we need to allocate here, so avoid passing down that r/o boolean :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: Make idmap_autorid_acquire_range publicVolker Lendecke2016-12-162-2/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: Fix checks for valid domains to allocate ranges forVolker Lendecke2016-12-161-17/+61
| | | | | | | | | | | | | | | The tdc cache is not reliable. The main dynamic check is netsamlogon_cache_have: The only reliable way to see a domain as valid for allocating a range for is a successful login. With a recent addition to netsamlogon_cache_store, we can now reliably tell from there whether a domain is trusted. This also adds a few heuristic checks, such as allocation for the local domains and additional ranges where we already have a mapping for range index 0 for. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: Add ntstatus to a debug messageVolker Lendecke2016-12-161-2/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: Only look at the tdc cache when allocating rangesVolker Lendecke2016-12-161-0/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: Do a readonly attempt before looking at the tdc cacheVolker Lendecke2016-12-161-4/+12
| | | | | | | | | If autorid.tdb already has a mapping for a domain range, we can just return that. Even if the volatile tdc cache at this point does not have the domain, we should return a correct mapping. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: idmap_autorid_sid_to_id_rid only uses rangesize from "global"Volker Lendecke2016-12-161-3/+4
| | | | | | | | Simplification -- from the callers perspective looks like a complex routine which it is not Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: idmap_autorid_sid_to_id_rid only uses low_id from "range"Volker Lendecke2016-12-161-3/+3
| | | | | | | | Simplification -- from the callers perspective looks like a complex routine which it is not Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: Tighten idmap_autorid_id_to_sid a bitVolker Lendecke2016-12-161-9/+23
| | | | | | | | | We should only allow '#' as a sid/range-number separator in autorid.tdb. The logic might be a bit clumsy. But the switch statement with failure fall thru was the clearest I could come up with. Signed-off-by: Volker Lendecke <vl@samba.org>
* idmap_autorid: Fix a commentVolker Lendecke2016-12-161-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: Protect against dsize==0Volker Lendecke2016-12-161-1/+1
| | | | | | | Not sure it can happen, but you never know... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_tdb: Harden idmap_tdb_common_unixid_to_sidVolker Lendecke2016-12-161-0/+6
| | | | | | | | A non-null terminated record would make string_to_sid read beyond the end of allocated data. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idmap_autorid: Slightly simplify idmap_autorid_unixids_to_sidsVolker Lendecke2016-12-161-1/+2
| | | | | | | Avoid an else branch where it's not necessary Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* samlogon_cache: Rename "user_sid" to "sid"Volker Lendecke2016-12-162-3/+3
| | | | | | | This is no longer just a user, we can also check for domains Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* samlogon_cache: Add the user's domain sid into the samlogon_cacheVolker Lendecke2016-12-161-1/+20
| | | | | | | | | | | This will be used by autorid and possibly others instead of the tdc cache. The only reliable way to find a domain to be trusted is via a successful login. We indicate successful login via a netsamlogon_cache.tdb entry. This patch also adds the user's domain sid with an entry, so we can check for that existence without traversing the cache. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* samlogon_cache: Simplify netsamlogon_cache_haveVolker Lendecke2016-12-161-10/+7
| | | | | | | | | | | We're interested in existence only, we should be able to trust the data format consistency for this type of query. netsamlogon_cache_get calls netsamlogon_cache_init for us, now we have to do it directly. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* pam_winbind: Fix compiler warningsBjörn Jacke2016-12-161-4/+7
| | | | | | | | | | | | Thanks to Stef Walter <stefw@gnome.org> BUG: http://bugzilla.samba.org/show_bug.cgi?id=8888 Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Fri Dec 16 16:22:32 CET 2016 on sn-devel-144
* ctdb-tools: Don't trust non-hosting nodes in "ctdb ip all"Martin Schwenke2016-12-161-5/+28
| | | | | | | | | | | | | | | | Redundant RELEASE_IPs gives nodes a preview of where an IP address will move to. However, if the associated TAKEOVER_IP fails then the node will actually be unhosted. This is similar to commit 77a29b37334b9df62b755b6f538fb975e105e1ff. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470 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): Fri Dec 16 12:32:02 CET 2016 on sn-devel-144
* ctdb-tools: Print PNN as int in "ctdb ip -v"Martin Schwenke2016-12-161-2/+3
| | | | | | | | | Otherwise it prints 4294967295 for the PNN. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Skip GET_PUBLIC_IP_INFO for unassigned addressesMartin Schwenke2016-12-161-0/+10
| | | | | | | | | | The GET_PUBLIC_IP_INFO control fails for unassigned addresses because PNN is CTDB_UNKNOWN_PNN. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix memory corruption in "ctdb ip -v"Martin Schwenke2016-12-161-2/+2
| | | | | | | | | | First argument to talloc_asprintf_append() is the string being appended to, not a talloc context. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix sort order of "ctdb ip" outputMartin Schwenke2016-12-161-2/+12
| | | | | | | | | | | | | | | | | The new hash-table-based method of merging the IP information does not sort, whereas the RB-tree method implicitly sorted. This probably only really matters for the "all" case, but sort regardless to ensure consistent output format. Sorting has to be done here instead of when printing to ensure consistency between ip[] and ipinfo[]. No longer reverse the sort order. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add unit test for protocol utilitiesMartin Schwenke2016-12-163-0/+94
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-protocol: Add generalised socket address comparisonMartin Schwenke2016-12-162-23/+55
| | | | | | | | | | | | | Add new function ctdb_sock_addr_cmp(), which returns a 3-way result useful for qsort(3). Reimplent ctdb_sock_addr_same() using this. In the process, make arguments const so that ctdb_sock_addr_cmp() can be used with qsort(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Fix "ctdb reloadips" simple testMartin Schwenke2016-12-161-2/+0
| | | | | | | | | | | | | | | | | | The name of the addresses file to modify is based on the original selection of a test node at the top of the test. Repeating the selection a test node can result in a mismatch between the new test node and the addresses file. This occurs on local daemons, because the addresses file name has the original node number in it but the test is being performed on the the newly selected node number. For some reason this test has only occasionally failed. An upcoming commit that stops the output of "ctdb ip" from being reversed causes this test to fail (nearly?) every time. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-build: Remove unnecessary intermediate build targetAmitay Isaacs2016-12-161-10/+6
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Do not remove event script dir before shutting down ctdbAmitay Isaacs2016-12-161-0/+2
| | | | | | | | | | When the test is over, the exit_hook will remove the temporary event script directory and then CTDB is restarted. Explicitly shutting down CTDB ensures that event script directory is not removed while CTDB is still running. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Display filtered output when the test failsAmitay Isaacs2016-12-161-1/+1
| | | | | | | This simplifies comparing the output to the expected output. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Move function typedef to where it's usedAmitay Isaacs2016-12-162-6/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>