fix-wrong-arch-settings   [plain text]


Index: samba/source/smbd/negprot.c
===================================================================
--- samba/source/smbd/negprot.c.orig
+++ samba/source/smbd/negprot.c
@@ -259,7 +259,8 @@ static int reply_nt1(char *inbuf, char *
 	if ( (SVAL(inbuf, smb_flg2) & FLAGS2_EXTENDED_SECURITY) &&
 		((SVAL(inbuf, smb_flg2) & FLAGS2_UNKNOWN_BIT4) == 0) ) 
 	{
-		if (get_remote_arch() != RA_SAMBA) {
+	    	/* Don't override the SAMBA or CIFSFS arch */
+		if ((get_remote_arch() != RA_SAMBA) && (get_remote_arch() != RA_CIFSFS)) {
 			set_remote_arch( RA_VISTA );
 		}
 	}
Index: samba/source/smbd/sesssetup.c
===================================================================
--- samba/source/smbd/sesssetup.c.orig
+++ samba/source/smbd/sesssetup.c
@@ -1070,7 +1070,9 @@ static int reply_sesssetup_and_X_spnego(
 		if (!(global_client_caps & CAP_STATUS32)) {
 			remove_from_common_flags2(FLAGS2_32_BIT_ERROR_CODES);
 		}
-
+		/* They say they support UNIX CAPS assume they are a UNIX Client */
+		if (global_client_caps & CAP_UNIX)
+			set_remote_arch(RA_CIFSFS);
 	}
 		
 	p = (uint8 *)smb_buf(inbuf);
@@ -1343,6 +1345,10 @@ int reply_sesssetup_and_X(connection_str
 					set_remote_arch( RA_WIN95);
 				}
 			}
+			/* They say they support UNIX CAPS assume they are a UNIX Client */
+			if (global_client_caps & CAP_UNIX)
+				set_remote_arch(RA_CIFSFS);
+
 		}
 
 		if (!doencrypt) {