The Samba-Bugzilla – Attachment 17075 Details for
Bug 14939
smbclient -L doesn't set "client max protocol" to NT1 before calling the "Reconnecting with SMB1 for workgroup listing" path.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.15.next.
bug-14939-4.15 (text/plain), 5.22 KB, created by
Jeremy Allison
on 2022-01-07 20:41:33 UTC
(
hide
)
Description:
git-am fix for 4.15.next.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2022-01-07 20:41:33 UTC
Size:
5.22 KB
patch
obsolete
>From f83309e3c5078fd19839d1e027127b36d96d4a5c Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 3 Jan 2022 16:48:17 -0800 >Subject: [PATCH 1/2] s3: selftest: Add two tests that show we try and send an > SMB1 request over an SMB2 connection to list servers if "-mSMB3" is selected. > >Add knownfail: knownfail.d/list_servers > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14939 > >Signed-off-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Noel Power <npower@samba.org> >(cherry picked from commit 0d9d1546a7bad6e0fac58e146a75e4eb1ce78c11) >--- > selftest/knownfail.d/list_servers | 1 + > .../tests/test_smbclient_list_servers.sh | 45 +++++++++++++++++++ > source3/selftest/tests.py | 18 ++++++++ > 3 files changed, 64 insertions(+) > create mode 100644 selftest/knownfail.d/list_servers > create mode 100755 source3/script/tests/test_smbclient_list_servers.sh > >diff --git a/selftest/knownfail.d/list_servers b/selftest/knownfail.d/list_servers >new file mode 100644 >index 00000000000..3b6de88ae63 >--- /dev/null >+++ b/selftest/knownfail.d/list_servers >@@ -0,0 +1 @@ >+^samba3.blackbox.test_list_servers.* >diff --git a/source3/script/tests/test_smbclient_list_servers.sh b/source3/script/tests/test_smbclient_list_servers.sh >new file mode 100755 >index 00000000000..884a5a25b9a >--- /dev/null >+++ b/source3/script/tests/test_smbclient_list_servers.sh >@@ -0,0 +1,45 @@ >+#!/bin/sh >+# >+# Ensure we don't get an error smb1cli_req_writev_submit: called for dialect[SMB3_11] >+# when listing servers via -L. >+# BUG: https://bugzilla.samba.org/show_bug.cgi?id=14939 >+ >+if [ $# -lt 5 ]; then >+cat <<EOF >+Usage: test_smbclient_list_servers.sh SERVER SERVER_IP USERNAME PASSWORD SMBCLIENT >+EOF >+exit 1; >+fi >+ >+SERVER="$1" >+SERVER_IP="$2" >+USERNAME="$3" >+PASSWORD="$4" >+SMBCLIENT="$5" >+shift 5 >+ADDARGS="$@" >+ >+incdir=$(dirname "$0")/../../../testprogs/blackbox >+. "$incdir/subunit.sh" >+ >+failed=0 >+ >+test_smbclient_list_servers() >+{ >+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT -L //$SERVER -U$USERNAME%$PASSWORD -I $SERVER_IP -p139 "$ADDARGS" </dev/null 2>&1' >+ eval echo "$cmd" >+ out=$(eval "$cmd") >+ >+ echo "$out" | grep 'smb1cli_req_writev_submit:' >+ ret=$? >+ if [ $ret -eq 0 ] ; then >+ echo "$out" >+ echo 'failed - should not get: smb1cli_req_writev_submit: error.' >+ return 1 >+ fi >+ >+ return 0 >+} >+ >+testit "smb1_list_servers" test_smbclient_list_servers || failed=$((failed+1)) >+testok "$0" "$failed" >diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py >index 32f02396004..d072cf45b68 100755 >--- a/source3/selftest/tests.py >+++ b/source3/selftest/tests.py >@@ -560,6 +560,24 @@ for env in ["fileserver"]: > plantestsuite("samba3.blackbox.test_dangle_rmdir", env, > [os.path.join(samba3srcdir, "script/tests/test_delete_veto_files_only_rmdir.sh"), > '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/veto', smbclient3]) >+ plantestsuite("samba3.blackbox.test_list_servers.NT1", >+ env + "_smb1_done", >+ [os.path.join(samba3srcdir, "script/tests/test_smbclient_list_servers.sh"), >+ '$SERVER', >+ '$SERVER_IP', >+ '$USERNAME', >+ '$PASSWORD', >+ smbclient3, >+ "-mSMB3"]) >+ plantestsuite("samba3.blackbox.test_list_servers.SMB2", >+ env, >+ [os.path.join(samba3srcdir, "script/tests/test_smbclient_list_servers.sh"), >+ '$SERVER', >+ '$SERVER_IP', >+ '$USERNAME', >+ '$PASSWORD', >+ smbclient3, >+ "-mSMB3"]) > > # > # tar command tests >-- >2.30.2 > > >From 7ea51af07c8022e5792555e1b3acba2875780896 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 3 Jan 2022 16:52:25 -0800 >Subject: [PATCH 2/2] s3: smbclient: In do_host_query(), if we need SMB1, > ensure we select NT1 as the client max protocol" before continuing. > >Remove knownfail: selftest/knownfail.d/list_servers > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14939 > >Signed-off-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Noel Power <noel.power@suse.com> > >Autobuild-User(master): Noel Power <npower@samba.org> >Autobuild-Date(master): Thu Jan 6 11:50:32 UTC 2022 on sn-devel-184 > >(cherry picked from commit 099c62a654da2623653218c771dd8fabdc7cc091) >--- > selftest/knownfail.d/list_servers | 1 - > source3/client/client.c | 1 + > 2 files changed, 1 insertion(+), 1 deletion(-) > delete mode 100644 selftest/knownfail.d/list_servers > >diff --git a/selftest/knownfail.d/list_servers b/selftest/knownfail.d/list_servers >deleted file mode 100644 >index 3b6de88ae63..00000000000 >--- a/selftest/knownfail.d/list_servers >+++ /dev/null >@@ -1 +0,0 @@ >-^samba3.blackbox.test_list_servers.* >diff --git a/source3/client/client.c b/source3/client/client.c >index 98425048f4b..a8e11044b39 100644 >--- a/source3/client/client.c >+++ b/source3/client/client.c >@@ -6169,6 +6169,7 @@ static int do_host_query(const char *query_host) > > cli_shutdown(cli); > d_printf("Reconnecting with SMB1 for workgroup listing.\n"); >+ lp_set_cmdline("client max protocol", "NT1"); > status = cli_cm_open(talloc_tos(), NULL, > query_host, > "IPC$", >-- >2.30.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
npower
:
review+
Actions:
View
Attachments on
bug 14939
: 17075