svn commit: samba r5981 - in branches/SAMBA_3_0/source/libsmb: .

jra at samba.org jra at samba.org
Tue Mar 22 23:45:57 GMT 2005


Author: jra
Date: 2005-03-22 23:45:57 +0000 (Tue, 22 Mar 2005)
New Revision: 5981

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

Log:
Hack to fix DFS code to work with Win98 server. JERRY PLEASE REVIEW THIS !
I don't think this is correct - it just happens to work and fix bug #2530
to return all the files.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/libsmb/clidfs.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/clidfs.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clidfs.c	2005-03-22 23:20:41 UTC (rev 5980)
+++ branches/SAMBA_3_0/source/libsmb/clidfs.c	2005-03-22 23:45:57 UTC (rev 5981)
@@ -595,8 +595,26 @@
 
 	/* we got an error, check for DFS referral */
 			
-	if ( !cli_dfs_check_error(rootcli) )
+	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;
+			}
+		}
+
 		return False;
+	}
 
 	/* check for the referral */
 



More information about the samba-cvs mailing list