From b15d847c2a44c7f0fe61e219b592f344b593e02a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 30 Jan 2012 13:53:28 -0800 Subject: [PATCH] Fix bug #8139 - smbclient fails if server does not support Echo request. Based on work by Matthias Scheler --- source3/client/client.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/source3/client/client.c b/source3/client/client.c index cf43171..9a25df9 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4482,12 +4482,16 @@ static void readline_callback(void) 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. Maybe server has closed " "the connection\n")); finished = true; smb_readline_done(); } + /* Ignore all other errors - sometimes servers simply + don't implement SMBecho (Apple for example). */ } } -- 1.7.7.3