[SCM] Samba Shared Repository - branch master updated

Noel Power npower at samba.org
Thu Jan 6 11:51:01 UTC 2022


The branch, master has been updated
       via  099c62a654d s3: smbclient: In do_host_query(), if we need SMB1, ensure we select NT1 as the client max protocol" before continuing.
       via  0d9d1546a7b 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.
      from  42cf3f4f007 lib: Fix a typo

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 099c62a654da2623653218c771dd8fabdc7cc091
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jan 3 16:52:25 2022 -0800

    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 at samba.org>
    Reviewed-by: Noel Power <noel.power at suse.com>
    
    Autobuild-User(master): Noel Power <npower at samba.org>
    Autobuild-Date(master): Thu Jan  6 11:50:32 UTC 2022 on sn-devel-184

commit 0d9d1546a7bad6e0fac58e146a75e4eb1ce78c11
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jan 3 16:48:17 2022 -0800

    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 at samba.org>
    Reviewed-by: Noel Power <npower at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/client/client.c                            |  1 +
 .../script/tests/test_smbclient_list_servers.sh    | 45 ++++++++++++++++++++++
 source3/selftest/tests.py                          | 18 +++++++++
 3 files changed, 64 insertions(+)
 create mode 100755 source3/script/tests/test_smbclient_list_servers.sh


Changeset truncated at 500 lines:

diff --git a/source3/client/client.c b/source3/client/client.c
index 7ea9f4f96aa..690f9deaec9 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -6224,6 +6224,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$",
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 1b4466cc33b..df39fdaa53a 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


-- 
Samba Shared Repository



More information about the samba-cvs mailing list