]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmbclient: Allow server (NetApp) to return STATUS_INVALID_PARAMETER from an echo.
authorJeremy Allison <jra@samba.org>
Fri, 8 Sep 2017 23:20:34 +0000 (16:20 -0700)
committerKarolin Seeger <kseeger@samba.org>
Fri, 17 Nov 2017 09:03:14 +0000 (10:03 +0100)
It does this if we send a session ID of zero. The server still replied.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13007

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Nov 11 08:44:37 CET 2017 on sn-devel-144

(cherry picked from commit a0f6ea8dec1ab3d19bc93da12a9b0a1c0ccf6142)

source3/client/client.c
source3/libsmb/libsmb_server.c

index bb2518a8c63f6068d78e412bb839c1393b90e297..0900df1dd217425eda10c147e72f27fc1f889f3e 100644 (file)
@@ -5696,7 +5696,13 @@ static void readline_callback(void)
        /* Ping the server to keep the connection alive using SMBecho. */
        memset(garbage, 0xf0, sizeof(garbage));
        status = cli_echo(cli, 1, data_blob_const(garbage, sizeof(garbage)));
-       if (NT_STATUS_IS_OK(status)) {
+       if (NT_STATUS_IS_OK(status) ||
+                       NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER)) {
+               /*
+                * Even if server returns NT_STATUS_INVALID_PARAMETER
+                * it still responded.
+                * BUG: https://bugzilla.samba.org/show_bug.cgi?id=13007
+                */
                return;
        }
 
index b0e5926fa65613c7fc461be0967d82f42d4e371b..2d41f2facf3bca6f3f426caeeea2c1d9d75a520f 100644 (file)
@@ -61,7 +61,16 @@ SMBC_check_server(SMBCCTX * context,
                                        1,
                                        data_blob_const(data, sizeof(data)));
                if (!NT_STATUS_IS_OK(status)) {
-                       return 1;
+                       /*
+                        * Some NetApp servers return
+                        * NT_STATUS_INVALID_PARAMETER.That's OK, they still
+                        * replied.
+                        * BUG: https://bugzilla.samba.org/show_bug.cgi?id=13007
+                        */
+                       if (!NT_STATUS_EQUAL(status,
+                                       NT_STATUS_INVALID_PARAMETER)) {
+                               return 1;
+                       }
                }
                server->last_echo_time = now;
        }