The branch, master has been updated via 103f3a3 Log the actual error returned when creating a pipe for client logging in CTDB fails. Helps with debugging issues. via d3c4c1e s3:tests: Add a test which checks that the smbclient session setup works via b6f87af s3:libsmb: Fix printing the session setup information via a4efe64 libcli:smb: Fix pulling strings from the wire via e6b3d74 libcli:util: Update werror table from 29045da selftest/rodc: Do not run in single mode, this causes deadlocks
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 103f3a3cbe71375664297ea1a4cd29ef486090cb Author: Richard Sharpe <richard.sha...@primarydata.com> Date: Tue Jun 6 13:34:51 2017 -0700 Log the actual error returned when creating a pipe for client logging in CTDB fails. Helps with debugging issues. Signed-off-by: Richard Sharpe <realrichardsha...@gmail.com> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Wed Jun 7 09:22:29 CEST 2017 on sn-devel-144 commit d3c4c1e263f187d38a4b25ef63d9e1d8833822b5 Author: Andreas Schneider <a...@samba.org> Date: Tue Jun 6 17:54:18 2017 +0200 s3:tests: Add a test which checks that the smbclient session setup works BUG: https://bugzilla.samba.org/show_bug.cgi?id=12824 Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit b6f87af427a1fa2bd397668d9f14cb0cf8ec5015 Author: Andreas Schneider <a...@samba.org> Date: Tue Jun 6 17:29:16 2017 +0200 s3:libsmb: Fix printing the session setup information This fixes a regression and prints the session setup on connect again: Domain=[SAMBA-TEST] OS=[Windows 6.1] Server=[Samba 4.7.0pre1-DEVELOPERBUILD] smb: \> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12824 Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit a4efe647c51700cee93b7574e5955e264aa96893 Author: Andreas Schneider <a...@samba.org> Date: Tue Jun 6 17:27:44 2017 +0200 libcli:smb: Fix pulling strings from the wire BUG: https://bugzilla.samba.org/show_bug.cgi?id=12824 Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit e6b3d7410e621e5c515460cd2788dd4ff8dd4474 Author: Andreas Schneider <a...@samba.org> Date: Tue Jun 6 16:07:10 2017 +0200 libcli:util: Update werror table This adds ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED for MS-PAR. Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: ctdb/server/ctdb_logging.c | 3 ++- libcli/smb/util.c | 2 +- libcli/util/werror.h | 3 --- libcli/util/werror_err_table.txt | 8 +++++++- source3/libsmb/cliconnect.c | 3 ++- source3/libsmb/clidfs.c | 32 ++++++++++++++++++++++------- source3/libsmb/clientgen.c | 13 ------------ source3/script/tests/test_smbclient_s3.sh | 34 +++++++++++++++++++++++++++++++ source3/torture/masktest.c | 4 +++- 9 files changed, 74 insertions(+), 28 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c index 4c37063..e7ca9b2 100644 --- a/ctdb/server/ctdb_logging.c +++ b/ctdb/server/ctdb_logging.c @@ -169,7 +169,8 @@ struct ctdb_log_state *ctdb_vfork_with_logging(TALLOC_CTX *mem_ctx, log->logfn_private = logfn_private; if (pipe(p) != 0) { - DEBUG(DEBUG_ERR, (__location__ " Failed to setup pipe for child logging\n")); + DEBUG(DEBUG_ERR, (__location__ " Failed to setup pipe for child logging:" + " %s\n", strerror(errno))); goto free_log; } diff --git a/libcli/smb/util.c b/libcli/smb/util.c index ef8c9fa..80d3428 100644 --- a/libcli/smb/util.c +++ b/libcli/smb/util.c @@ -372,6 +372,6 @@ NTSTATUS smb_bytes_pull_str(TALLOC_CTX *mem_ctx, char **_str, bool ucs2, const uint8_t *buf, size_t buf_len, size_t *_buf_consumed) { - return internal_bytes_pull_str(mem_ctx, _str, ucs2, true, + return internal_bytes_pull_str(mem_ctx, _str, ucs2, false, buf, buf_len, _buf_consumed); } diff --git a/libcli/util/werror.h b/libcli/util/werror.h index c25a4ab..d3d3327 100644 --- a/libcli/util/werror.h +++ b/libcli/util/werror.h @@ -140,9 +140,6 @@ typedef uint32_t WERROR; #define WERR_DNS_ERROR_DNAME_COLLISION W_ERROR(0x000025F9) #define WERR_DNS_ERROR_ALIAS_LOOP W_ERROR(0x000025FA) -/* Typo in the windows error table.. */ -#define WERR_DS_INVALID_ATTRIBUTE_SYNTAX WERR_DS_INVALID_ATTRIBUTE_YNTAX - /* Configuration Manager Errors */ /* Basically Win32 errors meanings are specific to the \ntsvcs pipe */ #define WERR_CM_INVALID_POINTER W_ERROR(3) diff --git a/libcli/util/werror_err_table.txt b/libcli/util/werror_err_table.txt index 8adb55a..75e8020 100644 --- a/libcli/util/werror_err_table.txt +++ b/libcli/util/werror_err_table.txt @@ -9919,6 +9919,12 @@ ERROR_FAIL_REBOOT_INITIATED The requested operation failed. A system reboot has been initiated to roll back changes made. +0x00000BCB +ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED + + +The specified printer driver was not found on the system and needs to be downloaded. + 0x00000F6E ERROR_IO_REISSUE_AS_CACHED @@ -12924,7 +12930,7 @@ The specified directory service attribute or value does not exist. 0x0000200B -ERROR_DS_INVALID_ATTRIBUTE_YNTAX +ERROR_DS_INVALID_ATTRIBUTE_SYNTAX The attribute syntax specified to the directory service is invalid. diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index a28a582..0862722 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -1122,7 +1122,8 @@ static void cli_session_setup_gensec_ready(struct tevent_req *req) server_domain = gensec_ntlmssp_server_domain( state->auth_generic->gensec_security); - if (state->cli->server_domain[0] == '\0' && server_domain != NULL) { + if ((state->cli->server_domain == NULL || + state->cli->server_domain[0] == '\0') && server_domain != NULL) { TALLOC_FREE(state->cli->server_domain); state->cli->server_domain = talloc_strdup(state->cli, server_domain); diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index c477d7c..09e21ac 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -259,13 +259,31 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx, return status; } - if ( show_sessetup ) { - if (*c->server_domain) { - DEBUG(0,("Domain=[%s] OS=[%s] Server=[%s]\n", - c->server_domain,c->server_os,c->server_type)); - } else if (*c->server_os || *c->server_type) { - DEBUG(0,("OS=[%s] Server=[%s]\n", - c->server_os,c->server_type)); + if (show_sessetup) { + const char *server_os = "unknown"; + const char *server_type = "unknown"; + bool do_print = false; + + if (c->server_os != NULL && c->server_os[0] != '\0') { + server_os = c->server_os; + do_print = true; + } + if (c->server_type != NULL && c->server_type[0] != '\0') { + server_type = c->server_type; + do_print = true; + } + + if (c->server_domain != NULL && c->server_domain[0] != '\0') { + DEBUG(0, ("Domain=[%s] OS=[%s] Server=[%s]\n", + c->server_domain, + server_os, + server_type)); + } else { + if (do_print) { + DEBUG(0, ("OS=[%s] Server=[%s]\n", + server_os, + server_type)); + } } } DEBUG(4,(" session setup ok\n")); diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index bc5c1b1..2c0b8c5 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -104,19 +104,6 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx, return NULL; } - cli->server_domain = talloc_strdup(cli, ""); - if (!cli->server_domain) { - goto error; - } - cli->server_os = talloc_strdup(cli, ""); - if (!cli->server_os) { - goto error; - } - cli->server_type = talloc_strdup(cli, ""); - if (!cli->server_type) { - goto error; - } - cli->dfs_mountpoint = talloc_strdup(cli, ""); if (!cli->dfs_mountpoint) { goto error; diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 0ae85e8..1359ed2 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -1212,6 +1212,36 @@ EOF fi } +test_server_os_message() +{ + tmpfile=$PREFIX/smbclient_interactive_prompt_commands + cat > $tmpfile <<EOF +ls +quit +EOF + cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1' + eval echo "$cmd" + out=`eval $cmd` + ret=$? + rm -f $tmpfile + + if [ $ret -ne 0 ] ; then + echo "$out" + echo "failed to connect error $ret" + false + return + fi + + echo "$out" | grep 'Domain=\[SAMBA.*\] OS=\[Windows [0-9]\.[0-9]\] Server=\[Samba' + ret=$? + if [ $ret -ne 0 ] ; then + echo "$out" + echo "failed - should get: Domain=[SAMBA-TEST] OS=[Windows 6.1] Server=..." + false + return + fi +} + LOGDIR_PREFIX=test_smbclient_s3 # possibly remove old logdirs: @@ -1315,6 +1345,10 @@ testit "follow symlinks = no" \ test_nosymlinks || \ failed=`expr $failed + 1` +testit "server os message" \ + test_server_os_message || \ + failed=`expr $failed + 1` + testit "rm -rf $LOGDIR" \ rm -rf $LOGDIR || \ failed=`expr $failed + 1` diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c index 95e0b04..57607b0 100644 --- a/source3/torture/masktest.c +++ b/source3/torture/masktest.c @@ -212,7 +212,9 @@ static struct cli_state *connect_one(char *share) * mode to turn these on/off ? JRA. */ - if (*c->server_domain || *c->server_os || *c->server_type) + if (c->server_domain != NULL || + c->server_os != NULL || + c->server_type != NULL) DEBUG(1,("Domain=[%s] OS=[%s] Server=[%s]\n", c->server_domain,c->server_os,c->server_type)); -- Samba Shared Repository