The branch, master has been updated via 1f523a6 ctdb-tests: Avoid early exits in scripts that appear on tail of a pipe via 4f82ef4 ctdb-scripts: Simplify 00.ctdb event script via e617e3e backupkey: Use ndr_pull_struct_blob_all() via 820a0a9 libcli/auth: Match Declaration of netlogon_creds_cli_context_tmp with implementation via d3b208c dsdb-tests: Give more helpful information about attribute differences from 4f4151e s3: lib: libsmbclient: If reusing a server struct, check every cli->timout miliseconds if it's still valid before use.
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 1f523a628ae05adfdda2c329af22788ba73ff759 Author: Amitay Isaacs <ami...@gmail.com> Date: Fri Mar 20 14:36:51 2015 +1100 ctdb-tests: Avoid early exits in scripts that appear on tail of a pipe When executing a shell script code "foo | bar", if "bar" terminates early, then "foo" can get I/O error when writing to stdout. The tdbtool stub did not wait to read anything from stdin when it is expected to. This would cause tests to fail randomly under load when tdbtool process exited early. Similarly, debug function read from stdin only under certain conditions (higher debug and when not reading from tty). Otherwise, exited early. Thanks to Andrew Bartlett for noticing the problem and Catalyst Cloud (http://catalyst.net.nz/cloud) for providing resources to test fixes. Signed-off-by: Amitay Isaacs <ami...@gmail.com> Pair-Programmed-With: Martin Schwenke <mar...@meltin.net> Reviewed-by: Andrew Bartlett <abart...@samba.org> Autobuild-User(master): Michael Adam <ob...@samba.org> Autobuild-Date(master): Fri Mar 20 16:26:37 CET 2015 on sn-devel-104 commit 4f82ef4b388406e9a1c802adfc81b1786d6f786d Author: Amitay Isaacs <ami...@gmail.com> Date: Fri Mar 20 01:30:55 2015 +1100 ctdb-scripts: Simplify 00.ctdb event script Avoid extra which commands. Signed-off-by: Amitay Isaacs <ami...@gmail.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit e617e3e74b7ea13bcf3ce385f3926e50e38dbe44 Author: Andrew Bartlett <abart...@samba.org> Date: Fri Mar 20 14:32:00 2015 +1300 backupkey: Use ndr_pull_struct_blob_all() This avoids bad decrypts from falling down to later code and getting the error code wrong, by strictly requiring the NDR parse to use all the data. A bad decyrpt is very unlikely to get the length correct, and so fall down to the other checks. This should fix: UNEXPECTED(failure): samba4.rpc.backupkey with seal.backupkey.server_wrap_decrypt_wrong_r2(ad_dc_ntvfs) REASON: Exception: Exception: ../source4/torture/rpc/backupkey.c:1926: r.out.result was WERR_INVALID_ACCESS, expected WERR_INVALID_PARAM: decrypt should fail with WERR_INVALID_PARAM BUG: https://bugzilla.samba.org/show_bug.cgi?id=11174 Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Stefan (metze) Metzmacher <me...@samba.org> commit 820a0a91fbd341f3172b0d048a920cb2538bbd38 Author: Thomas Schulz <sch...@adi.com> Date: Mon Mar 16 10:21:46 2015 -0700 libcli/auth: Match Declaration of netlogon_creds_cli_context_tmp with implementation I have been building 4.2.0 with the GNU C compiler but I decided to see how it works with the Sun C 5.11 compiler. The Sun compiler complains about a identifier being redeclared in libcli/auth/netlogon_creds_cli.c BUG: https://bugzilla.samba.org/show_bug.cgi?id=11140 Reviewed-by: Christof Schmitt <c...@samba.org> Reviewed-by: Michael Adam <ob...@samba.org> commit d3b208c1fc0258bef62731a5d47486ec233ccd1f Author: Andrew Bartlett <abart...@samba.org> Date: Thu Mar 19 18:35:05 2015 +1300 dsdb-tests: Give more helpful information about attribute differences Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Michael Adam <ob...@samba.org> ----------------------------------------------------------------------- Summary of changes: ctdb/config/events.d/00.ctdb | 11 ++++---- ctdb/config/functions | 6 +++- ctdb/tests/eventscripts/stubs/tdbtool | 32 +++++++++++++++++----- libcli/auth/netlogon_creds_cli.h | 2 +- source4/dsdb/tests/python/tombstone_reanimation.py | 4 ++- source4/rpc_server/backupkey/dcesrv_backupkey.c | 8 +++--- 6 files changed, 44 insertions(+), 19 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/config/events.d/00.ctdb b/ctdb/config/events.d/00.ctdb index ec18175..07bc7a7 100755 --- a/ctdb/config/events.d/00.ctdb +++ b/ctdb/config/events.d/00.ctdb @@ -17,17 +17,18 @@ select_tdb_checker () { # Find the best TDB consistency check available. use_tdb_tool_check=false - if which tdbtool >/dev/null 2>&1 && \ - echo "help" | tdbtool | grep -q check ; then + which tdbtool >/dev/null 2>&1 && found_tdbtool=true + which tdbdump >/dev/null 2>&1 && found_tdbdump=true - use_tdb_tool_check=true - elif which tdbtool >/dev/null 2>&1 && which tdbdump >/dev/null 2>&1 ; then + if $found_tdbtool && echo "help" | tdbtool | grep -q check ; then + use_tdb_tool_check=true + elif $found_tdbtool && $found_tdbdump ; then cat <<EOF WARNING: The installed 'tdbtool' does not offer the 'check' subcommand. Using 'tdbdump' for database checks. Consider updating 'tdbtool' for better checks! EOF - elif which tdbdump >/dev/null 2>&1 ; then + elif $found_tdbdump ; then cat <<EOF WARNING: 'tdbtool' is not available. Using 'tdbdump' to check the databases. diff --git a/ctdb/config/functions b/ctdb/config/functions index e6fe43f..da267d2 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -65,9 +65,13 @@ debug () # here document. if [ -n "$1" ] ; then echo "DEBUG: $*" - elif ! tty -s ; then + else sed -e 's@^@DEBUG: @' fi + else + if [ -z "$1" ] ; then + cat >/dev/null + fi fi } diff --git a/ctdb/tests/eventscripts/stubs/tdbtool b/ctdb/tests/eventscripts/stubs/tdbtool index c6c0a16..816df3b 100755 --- a/ctdb/tests/eventscripts/stubs/tdbtool +++ b/ctdb/tests/eventscripts/stubs/tdbtool @@ -1,15 +1,33 @@ #!/bin/sh -if [ -z "$1" ] ; then +do_help () +{ if [ "$FAKE_TDBTOOL_SUPPORTS_CHECK" = "yes" ] ; then echo "check" fi -fi + exit 0 +} -if [ "$FAKE_TDB_IS_OK" = "yes" ] ; then - echo "Database integrity is OK" -else - echo "Database is busted" -fi +do_check () +{ + if [ "$FAKE_TDB_IS_OK" = "yes" ] ; then + echo "Database integrity is OK" + else + echo "Database is busted" + fi + exit 0 +} + +do_cmd () +{ + case "$*" in + *check) do_check ;; + help) do_help ;; + "") read tdb_cmd && [ -n "$tdb_cmd" ] && do_cmd $tdb_cmd ;; + *) echo "$0: Not implemented: $*" ; exit 1 ;; + esac +} + +do_cmd $* exit 0 diff --git a/libcli/auth/netlogon_creds_cli.h b/libcli/auth/netlogon_creds_cli.h index 401ce8c..006367a 100644 --- a/libcli/auth/netlogon_creds_cli.h +++ b/libcli/auth/netlogon_creds_cli.h @@ -44,9 +44,9 @@ NTSTATUS netlogon_creds_cli_context_global(struct loadparm_context *lp_ctx, NTSTATUS netlogon_creds_cli_context_tmp(const char *client_computer, const char *client_account, enum netr_SchannelType type, - enum dcerpc_AuthLevel auth_level, uint32_t proposed_flags, uint32_t required_flags, + enum dcerpc_AuthLevel auth_level, const char *server_computer, const char *server_netbios_domain, TALLOC_CTX *mem_ctx, diff --git a/source4/dsdb/tests/python/tombstone_reanimation.py b/source4/dsdb/tests/python/tombstone_reanimation.py index ad780fd..af676fa 100644 --- a/source4/dsdb/tests/python/tombstone_reanimation.py +++ b/source4/dsdb/tests/python/tombstone_reanimation.py @@ -83,7 +83,9 @@ class RestoredObjectAttributesBaseTestCase(samba.tests.TestCase): return self.search_dn(msg['dn']) def assertAttributesEqual(self, obj_orig, attrs_orig, obj_restored, attrs_rest): - self.assertEqual(attrs_orig, attrs_rest, "Actual object does not have expected attributes") + self.assertEqual(attrs_orig, attrs_rest, + "Actual object does not have expected attributes, missing from expected (%s), extra (%s)" + % (str(attrs_orig.difference(attrs_rest)), str(attrs_rest.difference(attrs_orig)))) # remove volatile attributes, they can't be equal attrs_orig -= set(["uSNChanged", "dSCorePropagationData", "whenChanged"]) for attr in attrs_orig: diff --git a/source4/rpc_server/backupkey/dcesrv_backupkey.c b/source4/rpc_server/backupkey/dcesrv_backupkey.c index 749e48b..b3b7074 100644 --- a/source4/rpc_server/backupkey/dcesrv_backupkey.c +++ b/source4/rpc_server/backupkey/dcesrv_backupkey.c @@ -1496,8 +1496,8 @@ static WERROR bkrp_server_wrap_decrypt_data(struct dcesrv_call_state *dce_call, return WERR_INVALID_PARAM; } - ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &decrypt_request, - (ndr_pull_flags_fn_t)ndr_pull_bkrp_server_side_wrapped); + ndr_err = ndr_pull_struct_blob_all(&blob, mem_ctx, &decrypt_request, + (ndr_pull_flags_fn_t)ndr_pull_bkrp_server_side_wrapped); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return WERR_INVALID_PARAM; } @@ -1534,8 +1534,8 @@ static WERROR bkrp_server_wrap_decrypt_data(struct dcesrv_call_state *dce_call, arcfour_crypt_blob(encrypted_blob.data, encrypted_blob.length, &symkey_blob); - ndr_err = ndr_pull_struct_blob(&encrypted_blob, mem_ctx, &rc4payload, - (ndr_pull_flags_fn_t)ndr_pull_bkrp_rc4encryptedpayload); + ndr_err = ndr_pull_struct_blob_all(&encrypted_blob, mem_ctx, &rc4payload, + (ndr_pull_flags_fn_t)ndr_pull_bkrp_rc4encryptedpayload); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return WERR_INVALID_PARAM; } -- Samba Shared Repository