]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r5994: proper fix for smbclient and win98 file servers; check the WCT value in the...
authorGerald Carter <jerry@samba.org>
Wed, 23 Mar 2005 15:36:48 +0000 (15:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:56:14 +0000 (10:56 -0500)
source/libsmb/cliconnect.c
source/libsmb/clidfs.c

index c5154827c680f8d74b67a17fc722b93f8e94e137..4208d6378d4d965e04e7f9800aff9c330605793e 100644 (file)
@@ -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;
index e2456800ddc8f071ff615d180549f1af5a5163ad..21046cd380bc7d4760ba5642a3f7f401a9a12d2e 100644 (file)
@@ -595,26 +595,8 @@ BOOL cli_resolve_path( const char *mountpt, struct cli_state *rootcli, const cha
 
        /* 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 */