summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-05-16 17:17:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:22:11 -0500
commit478ccc150ba3b8c87ac67769c46be20a73d14096 (patch)
tree9c778802fe6db5591cd226467c05dee3a33c6ebd /source3/libsmb
parent0570ce21ffd6c2a52bf701cd72fbb66ed7b3eb3e (diff)
downloadsamba-478ccc150ba3b8c87ac67769c46be20a73d14096.tar.gz
samba-478ccc150ba3b8c87ac67769c46be20a73d14096.tar.bz2
samba-478ccc150ba3b8c87ac67769c46be20a73d14096.zip
r22950: Fix the issue Volker reported here :
"Attempt to fix some build farm failures: On port 139 the first successful packet gives len==0 from the server, so the = in if (len <= 0) { in line 136 of clientgen.c throws a failure." The irritating thing is that I already had it correct in SAMBA_3_0_26 and forgot to merge the change across. len == 0 is a valid return - I messed that up when converting client_receive_smb() to return a length rather than a BOOL. Doh ! Jeremy. (This used to be commit a398bdf08d9efac51af28aed29f2c0f151cd5aad)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c2
-rw-r--r--source3/libsmb/clientgen.c28
2 files changed, 2 insertions, 28 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index f13aa21fbd..86834ad081 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1347,7 +1347,7 @@ BOOL cli_session_request(struct cli_state *cli,
cli_send_smb(cli);
DEBUG(5,("Sent session request\n"));
- if (!cli_receive_sessionreply(cli))
+ if (!cli_receive_smb(cli))
return False;
if (CVAL(cli->inbuf,0) == 0x84) {
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index ef74de9f4b..43211a6c5a 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -133,7 +133,7 @@ BOOL cli_receive_smb_internal(struct cli_state *cli, BOOL eat_keepalives)
}
/* If the server is not responding, note that now */
- if (len <= 0) {
+ if (len < 0) {
DEBUG(0, ("Receiving SMB: Server stopped responding\n"));
cli->smb_rw_error = smb_read_error;
close(cli->fd);
@@ -191,32 +191,6 @@ BOOL cli_receive_smb_return_keepalive(struct cli_state *cli)
}
/****************************************************************************
- Recv an smb session reply
-****************************************************************************/
-
-BOOL cli_receive_sessionreply(struct cli_state *cli)
-{
- ssize_t len;
-
- /* fd == -1 causes segfaults -- Tom (tom@ninja.nl) */
- if (cli->fd == -1)
- return False;
-
- len = client_receive_smb(cli, False, 0);
-
- /* If the server is not responding, note that now */
- if (len < 0) {
- DEBUG(0, ("Receiving SMB: Server stopped responding\n"));
- cli->smb_rw_error = smb_read_error;
- close(cli->fd);
- cli->fd = -1;
- return False;
- }
-
- return True;
-}
-
-/****************************************************************************
Read the data portion of a readX smb.
The timeout is in milliseconds
****************************************************************************/