From fcce452557a6f5cfc46972617ed6932bb7fbeb95 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 Aug 1996 16:09:27 +0000 Subject: [PATCH] - fix client for pathworks 4 access - fix "connection already connected" bug in open_socket_out() --- source/client/client.c | 6 +++--- source/lib/util.c | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/source/client/client.c b/source/client/client.c index cc178967a16..cdf33a14b3d 100644 --- a/source/client/client.c +++ b/source/client/client.c @@ -168,7 +168,7 @@ void setup_pkt(char *outbuf) SSVAL(outbuf,smb_pid,pid); SSVAL(outbuf,smb_uid,uid); SSVAL(outbuf,smb_mid,mid); - if (Protocol > PROTOCOL_CORE) + if (Protocol > PROTOCOL_COREPLUS) { SCVAL(outbuf,smb_flg,0x8); SSVAL(outbuf,smb_flg2,0x1); @@ -3316,7 +3316,7 @@ static BOOL send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setu strcpy(pword, ""); passlen=1; } - if (Protocol <= PROTOCOL_CORE) { + if (Protocol <= PROTOCOL_COREPLUS) { set_message(outbuf,0,6 + strlen(service) + passlen + strlen(dev),True); CVAL(outbuf,smb_com) = SMBtcon; setup_pkt(outbuf); @@ -3376,7 +3376,7 @@ static BOOL send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setu } - if (Protocol <= PROTOCOL_CORE) { + if (Protocol <= PROTOCOL_COREPLUS) { max_xmit = SVAL(inbuf,smb_vwv0); cnum = SVAL(inbuf,smb_vwv1); diff --git a/source/lib/util.c b/source/lib/util.c index e13a4c37e80..31ad3da31cb 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -2888,6 +2888,13 @@ connect_again: return -1; } +#ifdef EISCONN + if (ret < 0 && errno == EISCONN) { + errno = 0; + ret = 0; + } +#endif + if (ret < 0) { DEBUG(2,("error connecting to %s:%d (%s)\n", inet_ntoa(*addr),port,strerror(errno))); -- 2.11.4.GIT