Author: jerry
Date: 2005-03-23 15:36:48 +0000 (Wed, 23 Mar 2005)
New Revision: 5994

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5994

Log:
proper fix for smbclient and win98 file servers; check the WCT value in the 
tcon&X reply before setting the cli_state->dfsroot flag
Modified:
   branches/SAMBA_3_0/source/libsmb/cliconnect.c
   branches/SAMBA_3_0/source/libsmb/clidfs.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/cliconnect.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/cliconnect.c       2005-03-23 14:28:27 UTC 
(rev 5993)
+++ branches/SAMBA_3_0/source/libsmb/cliconnect.c       2005-03-23 15:36:48 UTC 
(rev 5994)
@@ -982,9 +982,13 @@
                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;
 }

Modified: branches/SAMBA_3_0/source/libsmb/clidfs.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clidfs.c   2005-03-23 14:28:27 UTC (rev 
5993)
+++ branches/SAMBA_3_0/source/libsmb/clidfs.c   2005-03-23 15:36:48 UTC (rev 
5994)
@@ -595,26 +595,8 @@
 
        /* we got an error, check for DFS referral */
                        
-       if ( !cli_dfs_check_error(rootcli) ) {
-               /* Check for Win98 server - doesn't support this call. */
-               uint32 flgs2 = SVAL(rootcli->inbuf,smb_flg2);
-
-               /* only deal with DS when we negotiated NT_STATUS codes and 
UNICODE */
-
-               if ( !( (flgs2&FLAGS2_32_BIT_ERROR_CODES) && 
(flgs2&FLAGS2_UNICODE_STRINGS) ) ) {
-                       uint8 eclass = 0;
-                       uint32 ecode = 0;
-                       cli_dos_error(rootcli, &eclass, &ecode);
-                       if ((eclass == ERRDOS) && (ecode == ERRbadfunc)) {
-                               rootcli->dfsroot = 0;
-                               *targetcli = rootcli;
-                               pstrcpy( targetpath, path );
-                               return True;
-                       }
-               }
-
+       if ( !cli_dfs_check_error(rootcli) ) 
                return False;
-       }
 
        /* check for the referral */
 

Reply via email to