summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "ctdb-tests: Make unit.sh pass shellcheck"Martin Schwenke2020-07-222-12/+6
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit 30293baae5f22628405d327fc0b6bae993e96cd8. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-tests: Do not trigger ctdb_test_error() from ctdb_init()"Martin Schwenke2020-07-221-15/+6
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit 44e05ac8515be3220a334ae8001db83b06bec59f. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-tests: Separate custom cluster startup from test initialisation"Martin Schwenke2020-07-224-30/+14
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit e9df17b500146e62539feac66d0cd4b3ef7aa47a. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-tests: Don't bother shutting down daemons in ctdb_init()"Martin Schwenke2020-07-221-0/+2
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit 58f9f699f181ac217cda8de512b8385da173f884. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-tests: Drop uses of "onnode any ..." in testcases"Martin Schwenke2020-07-228-25/+23
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit aa5b214eaa88414c87410fd068fe7624e9790185. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-tests: Improve test portability"Martin Schwenke2020-07-221-29/+14
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit 1079d6e3ae5805ef65a3628edf0a3ac2cd7fac1c. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-tests: Improve test quality"Martin Schwenke2020-07-221-18/+20
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit ea1cbff624383fb9d5b83b863fa6bd00a8fb77fa. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-tests: Improve test portability"Martin Schwenke2020-07-221-1/+1
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit 1f6556916e7f3a731d7d760fa6fd857e7f571541. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-tests: Improve test quality"Martin Schwenke2020-07-221-9/+12
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit a308f2534d3991866efa2c662921ec63b4238888. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-tests: Improve test portability/quality"Martin Schwenke2020-07-221-23/+25
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit d2f8cd835da39784f2d99231f9a1067ae56ede7a. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-tests: Stop cat command failure from causing test failure"Martin Schwenke2020-07-221-1/+1
| | | | | | | | | Fix missing Reviewed-by: tag. This reverts commit 5707781ccf682d95a5a05a7c3e00a43003dbe62e. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Stop cat command failure from causing test failureMartin Schwenke2020-07-221-1/+1
| | | | | | | | | | | | | | | In certain circumstance, which aren't obvious, cat(1) can fail when attempting to write a lot of data. This is due to something (probably write(2)) returning EAGAIN. Given that the -v option should only really be used for test debugging, ignore the failure instead of spending time debugging it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14446 Signed-off-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Wed Jul 22 04:10:47 UTC 2020 on sn-devel-184
* ctdb-tests: Improve test portability/qualityMartin Schwenke2020-07-221-25/+23
| | | | | | | | Avoid use of non-portable md5sum by constructing database names using index. Improve indentation, use more modern commands, code improvements (shellcheck). Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Improve test qualityMartin Schwenke2020-07-221-12/+9
| | | | | | Simplify code, use more modern commands, code improvements (shellcheck). Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Improve test portabilityMartin Schwenke2020-07-221-1/+1
| | | | | | | "wc -l" on some platforms (e.g. FreeBSD) contains leading spaces, so strip them. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Improve test qualityMartin Schwenke2020-07-221-20/+18
| | | | | | | | Select test node with IPs instead of using a fixed node. Remove unnecessary code, use more modern commands, code improvements (shellcheck). Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Improve test portabilityMartin Schwenke2020-07-221-14/+29
| | | | | | | | "wc -l" on some platforms (e.g. FreeBSD) contains leading spaces and stops "$num from being a number. Create a more portable solution and put it in a function instead of repeating the logic. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Drop uses of "onnode any ..." in testcasesMartin Schwenke2020-07-228-23/+25
| | | | | | | | | | | | It would be nice to get rid of "onnode any". There's no use making tests nondeterministic. If covering different cases matters then they should be explicitly handled. In most places "any" is replaced by "$test_node". In some cases, where $test_node is not set, a fixed node that is already used elsewhere can be reused. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Don't bother shutting down daemons in ctdb_init()Martin Schwenke2020-07-221-2/+0
| | | | | | They'll never be up here... Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Separate custom cluster startup from test initialisationMartin Schwenke2020-07-224-14/+30
| | | | | | | | | | | | | | | | | | | Separate cluster startup from test initialisation for tests that start the cluster with customised configuration. In these cases the result of the cluster startup is actually the point of the test. Additionally, pubips.013.failover_noop.sh claims to have completed test initialisation twice, which just seems wrong. The result is: * ctdb_test_init() takes one option (-n) to indicate when it should not configure/start the cluster * New function ctdb_nodes_start_custom() accepts options for special cluster configuration, only operates on local daemons and triggers a test failure rather than a test error on failure. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Do not trigger ctdb_test_error() from ctdb_init()Martin Schwenke2020-07-221-6/+15
| | | | | | | | The only caller calls ctdb_test_error() on failure and nesting this calls can be confusing. A future change will make this even more confusing. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Make unit.sh pass shellcheckMartin Schwenke2020-07-222-6/+12
| | | | | | | | | Mostly avoidance of quoting warnings. Silencing warnings about unquoted $CTDB_TEST_CAT_RESULTS_OPTS is handled by passing '-' to cat when that variable's value is empty. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Make integration.bash pass shellcheckMartin Schwenke2020-07-222-41/+52
| | | | | | | | | | | | | | | | Apart from the non-constant sourcing of include files. Mostly avoidance of quoting warnings. One subtle change is to simply pass "120" to wait_until_ready() to stop warnings that it expects arguments but none are passed (both SC2119 and SC2120). There seems no way to indicate to structure function argument handling so that shellcheck realises arguments are optional. In later shellcheck versions, disabling SC2120 for a function also silences complaints about its callers... but not all of our testing uses "later" shellcheck versions. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Use "#!/usr/bin/env bash" for improved portabilityMartin Schwenke2020-07-221-1/+1
| | | | Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Update preamble for INTEGRATION testsMartin Schwenke2020-07-2262-1060/+313
| | | | | | | | | | | | | | | | | | | | * Use "#!/usr/bin/env bash" for improved portability * Drop test_info() definition and replace it with a comment The use of test_info() is pointless. * Drop call to cluster_is_healthy() This is a holdover from when the previous test would restart daemons to get things ready for a test. There was also a bug where going into recovery during the restart would sometimes cause the cluster to become unhealthy. If we really need something like this then we can add it to ctdb_test_init(). * Make order of preamble consistent Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Drop unreachable lineMartin Schwenke2020-07-221-1/+0
| | | | | | ctdb_test_skip() will exit. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Redirect stderr too when checking for shellcheckMartin Schwenke2020-07-221-1/+1
| | | | | | | | | | | Avoid: .../UNIT/shellcheck/scripts/local.sh: line 14: type: shellcheck: not found The "type" command in dash prints the "not found" message to stdout but the bash version prints to stderr, so redirect stderr too. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Show hung script debugging outputMartin Schwenke2020-07-221-0/+5
| | | | | | | | | | The output in a test failure appears to contain no pstree output because "00\.test\.script,.*" does not match. However, this is just a guess because the output is not shown. Showing the output makes it easier to understand test failures. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Enable SOCKET_WRAPPER_DIR_ALLOW_ORIGMartin Schwenke2020-07-221-0/+1
| | | | | | | | This will allow local daemons to be used in more contexts, especially in tests run by Jenkins where the directory names for some targets can be very long. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Don't build/install tests in top-level build by defaultMartin Schwenke2020-07-221-0/+7
| | | | | | | | The standalone build still includes tests, as does the top-level build when --enable-selftest is used. The latter is consistent with the use of --enable-selftest in the rest of the tree. Signed-off-by: Martin Schwenke <martin@meltin.net>
* smbd: build smb_fname per file to delete in unlink_internals()Ralph Boehme2020-07-181-13/+23
| | | | | | | | | | | Make sure to pass fresh smb_fname's to do_unlink(). Needed for path-ref fsps in the future. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jul 18 07:21:11 UTC 2020 on sn-devel-184
* smbd: consolidate fsp allocation for open_directory() and open_file_ntcreate()Ralph Boehme2020-07-181-64/+31
| | | | | | | ...at one place in the caller create_file_unixpath(). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: factor out fsp_bind_smb()Ralph Boehme2020-07-182-23/+38
| | | | | | | Needed for path-ref fsps in the future. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: don't mess with smb_dname->base_name in call_trans2findfirst()Ralph Boehme2020-07-181-4/+11
| | | | | | | | Create a fresh name instead. Needed to proper support for path-ref fsps in the future. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/lib: fsp_str_dbg() doesn't show a possible stream nameRalph Boehme2020-07-181-1/+6
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: use helper variable for fd in fd_open()Ralph Boehme2020-07-181-8/+7
| | | | | | | | No change in behaviour. Fwiw, no need to set fsp->fh->fd to -1 in the error case, as that is initialized to -1 in fsp_new(). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: remove errno saving from fd_open()Ralph Boehme2020-07-181-8/+0
| | | | | | | This is not needed anymore since 97d061237b0f2e07ae9c8e893734e222e58cfa4e. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: remove a nested block in non_widelink_open()Ralph Boehme2020-07-181-12/+9
| | | | | | | No change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: use (global) POSIX pathname state in non_widelink_open()Ralph Boehme2020-07-181-1/+1
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: check for conn->cwd_fsp in fd_close()Ralph Boehme2020-07-181-0/+4
| | | | | | | This avoids doing the check in all callers. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: check for conn->cwd_fsp in file_free()Ralph Boehme2020-07-181-0/+4
| | | | | | | This avoids doing the check in all callers. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: use a helper variable in open_file()Ralph Boehme2020-07-181-0/+5
| | | | | | | No change in behaviour, this just prepares for changes to come. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: remove unused NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETERalph Boehme2020-07-182-4/+1
| | | | | | | The previous commit removed the only consumer of the flags. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: ensure we do a base open for internal stream deletesRalph Boehme2020-07-181-2/+2
| | | | | | | | | | Otherwise we're not opening the basefile so fsp->base_fsp remains NULL for fsp handles on streams. As there are some places that use the check (fsp->base_fsp != NULL) to check for stream handles, eg streams_xattr_fstat(), we must ensure it is set otherwise we open a pretty big window for undefined behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_posixacl: Remove unnecessary call to acl_set_permsetChristof Schmitt2020-07-171-1/+2
| | | | | | | | | | | | | After the initial acl_get_permset, the permset is alreadying pointing to the ACL entry and all changes are done on the ACL entry. There is no need to overwrite the permissions in the ACL entry again with the same value in the acl_set_permset call. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Fri Jul 17 18:33:41 UTC 2020 on sn-devel-184
* test_vfs_posixacl: Add unit test for Linux POSIX ACL mappingChristof Schmitt2020-07-173-0/+168
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* pam_winbind: Fix CID 242274 Time of check time of useChristof Schmitt2020-07-171-5/+14
| | | | | | | | | Always issue the mkdir call to avoid the TOCTOU issue. Only if there is already an object with the requested name, check whether it is a directory. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* docs: Fix documentation for require_membership_of of pam_winbind.confAndreas Schneider2020-07-171-3/+6
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14358 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Isaac Boukris <iboukris@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jul 17 13:07:44 UTC 2020 on sn-devel-184
* python: samba.compat rejects Python 2Douglas Bagnall2020-07-171-71/+2
| | | | | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Mulder <dmulder@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jul 17 08:39:38 UTC 2020 on sn-devel-184
* python: wrap 'import dckeytab' in an explanatory functionDouglas Bagnall2020-07-173-2/+24
| | | | | | | | | | | | The samba.dckeytab module has magic effects on samba.net, but never appears to be used. That can be confusing, both to people and to linters. Here we wrap that confusion up into a well-commented function, so we never again have to wonder why the unused import is there. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Mulder <dmulder@samba.org>