From c3fdd86334fe62667cd97debf7601a0133d3de99 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 23 Mar 2005 15:36:48 +0000 Subject: r5994: proper fix for smbclient and win98 file servers; check the WCT value in the tcon&X reply before setting the cli_state->dfsroot flag --- source/libsmb/cliconnect.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/libsmb/cliconnect.c') diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c index c5154827c68..4208d6378d4 100644 --- a/source/libsmb/cliconnect.c +++ b/source/libsmb/cliconnect.c @@ -982,8 +982,12 @@ BOOL cli_send_tconX(struct cli_state *cli, cli->win95 = True; } - if ( cli->protocol >= PROTOCOL_LANMAN2 ) - cli->dfsroot = (SVAL( cli->inbuf, smb_vwv2 ) & SMB_SHARE_IN_DFS); + /* Make sure that we have the optional support 16-bit field. WCT > 2 */ + /* Avoids issues when connecting to Win9x boxes sharing files */ + + cli->dfsroot = False; + if ( (CVAL(cli->inbuf, smb_wct))>2 && cli->protocol >= PROTOCOL_LANMAN2 ) + cli->dfsroot = (SVAL( cli->inbuf, smb_vwv2 ) & SMB_SHARE_IN_DFS) ? True : False; cli->cnum = SVAL(cli->inbuf,smb_tid); return True; -- cgit