summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lib: dns: Clean up allocated structure on error exit.Jeremy Allison2016-04-221-4/+6
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org>
* pdb_ldap: Don't use autofree if "mods" still changesVolker Lendecke2016-04-221-1/+7
| | | | | | | | | This will prevent some use-after-free's, potentially it might for example fix bugzilla 11851. Not directly related, but it's a crash related to ldap-backed user creation. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* nss_wins: Fix the hostent setupTom Mortensen2016-04-221-3/+3
| | | | | | | | This can never have been tested.... Signed-off-by: Tom Mortensen <tomm@lime-technology.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* nss_wins: ip_pton expects the raw IP addressTom Mortensen2016-04-221-1/+6
| | | | | | Signed-off-by: Tom Mortensen <tomm@lime-technology.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbcheck: Avoid pathological behaviour in operational moduleGarming Sam2016-04-201-0/+4
| | | | | | | | | | | | | Because replPropertyMetadata was repeated for every object in the database, the attrs list became very long. This single line saves 20% of the time for make test TESTS=dbcheck. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Wed Apr 20 09:12:47 CEST 2016 on sn-devel-144
* cleanupd: restart as neededRalph Boehme2016-04-191-10/+25
| | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=11855 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Apr 19 20:35:33 CEST 2016 on sn-devel-144
* libads: record session expiry for spnego sasl bindsUri Simchoni2016-04-191-0/+9
| | | | | | | | | | | | | | With the move to gensec-based spnego, record the session expiry in tgs_expire, so that libads users such as winbindd can use this info to determine how long to keep the connection. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11852 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Tue Apr 19 16:53:57 CEST 2016 on sn-devel-144
* printing: handle "printcap cache time" change on HUPDavid Disseldorp2016-04-191-33/+46
| | | | | | | | | | Reschedule the housekeeping event on SIGHUP and conf reload. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Apr 19 13:14:20 CEST 2016 on sn-devel-144
* printing: use housekeeping period that matches cache timeDavid Disseldorp2016-04-192-14/+8
| | | | | | | | | | | | | The printcap housekeeping callback is scheduled to run every 60 seconds, and invokes pcap_cache_reload() to reload of the printcap cache *if* the "printcap cache time" period has expired. Given that pcap_cache_reload() invocation is the only job of the housekeeping callback, it makes much more sense to schedule it every "printcap cache time" seconds, rather than every 60 seconds. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:libcli:smb2: Use constant time memcmp() to verify the signatureAndreas Schneider2016-04-191-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli:smb2: Use constant time memcmp() to verify the signatureAndreas Schneider2016-04-191-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* util: Add memcmp_const_time()Andreas Schneider2016-04-192-0/+25
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tests/passwords: fix a typoGarming Sam2016-04-191-1/+1
| | | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Tue Apr 19 07:54:35 CEST 2016 on sn-devel-144
* tests/dsdb: Verify that only a new ldb affects reads of userPasswordGarming Sam2016-04-191-0/+89
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11853 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb: Only re-query dSHeuristics for userPassword support on modifiesAndrew Bartlett2016-04-191-2/+6
| | | | | | | | | | | | | | | | | | | | | We keep the database startup value for search behaviour, as to re-check is too expensive. It caused every search to have an additional search to the database. We do not need to check as_system when setting ac->userPassword as this is checked when all password attributes are stripped As userPassword is not written to after fUserPwdSupport is set we do not expose any data that was not already visible. The database overhead was an oversight when this was originally added with 7f171a9e0f9b5945bd16a1330ba0908090659030 in 2010. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11853 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* tests/rodc: Check that preload will skip broken usersGarming Sam2016-04-181-1/+35
| | | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Mon Apr 18 07:40:07 CEST 2016 on sn-devel-144
* rodc: Allow RODC preload to continue with invalid usersGarming Sam2016-04-181-3/+35
| | | | | | | | Either the user may be missing from the database, or the user is not included in the RODC password replication group. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb-tools: Remove simple uses of strcpy(3)Martin Schwenke2016-04-171-2/+3
| | | | | | | | 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 Apr 17 17:37:06 CEST 2016 on sn-devel-144
* ctdb-scripts: Use ss instead of netstat for finding TCP connectionsMartin Schwenke2016-04-172-10/+101
| | | | | | | | | ss with a filter is much faster than post-processing output from netstat. CTDB already has a hard dependency on iproute2 for IP address handling, so depending on ss is no big deal. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Missing NFS thread count file should just produce warningMartin Schwenke2016-04-171-2/+6
| | | | | | | | | | | | This currently causes monitor failure. Log a warning instead. If there is a transient issue, such as NFS being restarted in the background, then the thread count file should be there the next time around so the count can be adjusted if necessary. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Log a message when fork(2) failsMartin Schwenke2016-04-171-0/+2
| | | | | | | It is useful to know what error occurred. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* winbind: Base idmap_ad on tldapVolker Lendecke2016-04-152-406/+655
| | | | | | | | | | | | | | | The main reason for this is to do proper connection management. I tried hard, but I failed trying to slowly migrate the ads_struct based code to something saner. So I polished tldap, which thanks to metze does proper sasl. This patch is pretty much a complete rewrite, so looking at it in diff -u format does not really make sense. Look at the final output. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Apr 15 19:13:39 CEST 2016 on sn-devel-144
* winbind: handle DC_NOT_FOUND in wb_xids2sidsVolker Lendecke2016-04-151-0/+52
| | | | | | | | | | | | | | The idmap_ad child is designed to connect to domain controllers on its own. Finding a DC is a nontrivial task that the child should not do on its own, in particular it should not have to connect to "our" DC's NETLOGON pipe separately. So when idmap_ad finds that it needs to connect to a DC, it returns NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND. The parent then asynchronously does the lookup and stores the DC info in gencache. After that the parent re-does the idmap child call, during which the child will find the DC-info in gencache. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: handle DC_NOT_FOUND in wb_sids2xidsVolker Lendecke2016-04-151-1/+63
| | | | | | | | | | | | | | The idmap_ad child is designed to connect to domain controllers on its own. Finding a DC is a nontrivial task that the child should not do on its own, in particular it should not have to connect to "our" DC's NETLOGON pipe separately. So when idmap_ad finds that it needs to connect to a DC, it returns NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND. The parent then asynchronously does the lookup and stores the DC info in gencache. After that the parent re-does the idmap child call, during which the child will find the DC-info in gencache. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Add wb_dsgetdcname_gencache_[gs]etVolker Lendecke2016-04-152-0/+112
| | | | | | | | | | | This is a sneaky way to pass the DC info from the parent winbind to children and other users. Not sure where exactly to put these routines. For now, put them into the parent code to find the dcinfo from "our" dc. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tldap: Add tldap_gensec_bindVolker Lendecke2016-04-153-0/+416
| | | | | | | This enables sasl sign/sealed connections via tldap Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tldap: Add tldap_get/set_streamVolker Lendecke2016-04-152-0/+15
| | | | | | | This will be used to replace a nonencrypted socket with a sasl sealed one. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* idmap_ad: Separate out the nss functionsVolker Lendecke2016-04-154-421/+539
| | | | | | | | | | | The nss functions technically right now are part of the idmap modules. However, there is no intrinsic reason for this mixture of concerns. I would like to heavily modify the idmap_ad idmapping functions without modifying the nss functions (yet!!). So as a first step this patch moves the nss functions textually out of the way. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Mask general purpose signals for notifyd.Hemanth Thummala2016-04-151-0/+4
| | | | | | | | | | | | | | | Currently there is no signal handling available for notify daemon. Signals like SIGHUP and SIGUSR1 can lead to terminate the notify daemon. Masking these signals for notifyd as we are not handling them. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11840 Signed-off-by: Hemanth Thummala <hemanth.thummala@nutanix.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Apr 15 15:31:19 CEST 2016 on sn-devel-144
* ctdb-daemon: Drop --lvs option and support for CTDB_CAP_LVSMartin Schwenke2016-04-159-35/+5
| | | | | | | | 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 Apr 15 09:35:51 CEST 2016 on sn-devel-144
* ctdb-daemon: Drop --single-public-ip option and related codeMartin Schwenke2016-04-154-108/+4
| | | | | | | This has been replaced by scripts. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Simplify "ctdb lvs ..." outputMartin Schwenke2016-04-1511-47/+25
| | | | | | | | | | For "master", if there is a master then print the PNN, otherwise print nothing. For "list", print the PNN and IP addresses without a colon in between. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Change ctdb CLI to have a single "lvs" commandMartin Schwenke2016-04-1513-186/+345
| | | | | | | | | | | | | | | | | This simply calls out to the wrapper, so that commands are changed as follows: ctdb lvsmaster -> ctdb lvs master ctdb lvs -> ctdb lvs list This provides a simple, extensible interface and means that "ctdb lvs status" is also available. Unit tests are streamlined so that there is a single test for each CTDB state. Each test does "master", "list" and "status" sub-tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tool: Change ctdb lvs/lvsmaster CLI commands to use ctdb_lvs helperMartin Schwenke2016-04-1512-203/+127
| | | | | | | Update tests accordingly. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add monitoring of CTDB_LVS_PUBLIC_IFACEMartin Schwenke2016-04-154-0/+55
| | | | | | | ... and unit tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-doc: Add sample LVS configurationAmitay Isaacs2016-04-151-0/+90
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Call out to ctdb_lvs helper from 91.lvsMartin Schwenke2016-04-157-90/+244
| | | | | | | | | | | | | | | | | | | | To keep this commit comprehensible, 91.lvs and the CTDB CLI tool are temporarily inconsistent. The tool will be made consistent in a subsequent commit. LVS now uses a configuration file specified by CTDB_LVS_NODES and supports the same slave-only syntax as CTDB_NATGW_NODES. LVS also uses new variable CTDB_LVS_PUBLIC_IFACE instead of CTDB_PUBLIC_INTERFACE. Update unit tests and documentation. Note that the --lvs and --single-public-ip daemon options are no longer used. These will be removed and relevant documentation updated in a subsequent commit. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Move ctdb_get_ip_address() to functions fileMartin Schwenke2016-04-152-13/+13
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Add new ctdb_lvs helperMartin Schwenke2016-04-153-0/+228
| | | | | | | | This will replace the ctdb CLI tool "lvs" and "lvsmaster" options. It also makes LVS daemon support unnecessary. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: LVS eventscript cleanupsMartin Schwenke2016-04-151-41/+37
| | | | | | | Stylistic changes and cleaner code. No functional changes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add unit tests for LVS eventscriptMartin Schwenke2016-04-1510-0/+268
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: LVS support for ctdb tool stubMartin Schwenke2016-04-151-0/+24
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add ipvsadm test stubMartin Schwenke2016-04-151-0/+126
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add 32-bit netmask support to "ip addr show" stubMartin Schwenke2016-04-151-8/+6
| | | | | | | In this case do not show broadcast address. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add loopback support for "ip link show" stubMartin Schwenke2016-04-151-3/+15
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Allow scope to be specified in "ip addr add" stubMartin Schwenke2016-04-151-6/+10
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop "recovered" event from 91.lvsMartin Schwenke2016-04-151-1/+1
| | | | | | | | Having both "recovered" and "ipreallocated" means that everything happens twice when there is a recovery. No need for that. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: LVS eventscript error redirection improvementsMartin Schwenke2016-04-151-5/+5
| | | | | | | | | | | | | | | | | | Basic error redirection improvements before writing tests. Deleting the service during "startup" will usually fail because the service has never been setup, so redirect output to avoid logging an error. Similarly, deleting the service in "ipreallocated" will always fail the first time, which would cause an error to be logged. Given the simplicity of the script, there's no sane way to avoid the error sometimes and log it if it actually matters. This could potentially be tidied up in the future by making 91.lvs stateful, in a similar way to 11.natgw. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop hardcoded /sbin and /proc paths in LVS eventscriptMartin Schwenke2016-04-151-10/+8
| | | | | | | It can now be unit tested. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: die() should output to stderrMartin Schwenke2016-04-151-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>