]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix bug #8139 - smbclient fails if server does not support Echo request.
authorJeremy Allison <jra@samba.org>
Mon, 30 Jan 2012 22:13:47 +0000 (14:13 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 30 Jan 2012 23:47:19 +0000 (00:47 +0100)
Based on work by Matthias Scheler <tron@NetBSD.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Jan 31 00:47:19 CET 2012 on sn-devel-104

source3/client/client.c

index 4b7df92877de469845427894570fbeeae002a924..9b36ff7098b6a6a1fc33a46be87bc14721c2a550 100644 (file)
@@ -5032,11 +5032,15 @@ 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_EQUAL(status, NT_STATUS_PIPE_BROKEN) ||
+                       NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE) ||
+                       NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
                DEBUG(0, ("SMBecho failed (%s). Maybe server has closed "
                        "the connection\n", nt_errstr(status)));
                finished = true;
                smb_readline_done();
+               /* Ignore all other errors - sometimes servers simply
+                  don't implement SMBecho (Apple for example). */
        }
 }