mirror of
https://github.com/obarthel/amiga-smbfs.git
synced 2025-12-08 14:58:35 +00:00
smbfs 1.73 (17.4.2009)
- Modified smb_valid_packet() in proc.c to check whether the packet received is smaller than expected, not whether the length matches exactly. This seems to fix the protocol negotiation with Samba 3.2.5 for now. Haven't checked Vista yet, though... git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/amiga-smbfs/trunk@23 26594b9e-b914-4e86-b7a1-9402bd427170
This commit is contained in:
+15
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: proc.c,v 1.7 2009-04-14 11:32:51 obarthel Exp $
|
||||
* $Id: proc.c,v 1.8 2009-04-17 11:09:41 obarthel Exp $
|
||||
*
|
||||
* :ts=8
|
||||
*
|
||||
@@ -259,14 +259,25 @@ smb_valid_packet (byte * packet)
|
||||
{
|
||||
int result;
|
||||
|
||||
LOG (("len: %ld, wct: %ld, bcc: %ld\n", smb_len (packet), SMB_WCT (packet), SMB_BCC (packet)));
|
||||
LOG (("len: %ld, wct: %ld, bcc: %ld -- SMB_HEADER_LEN[%ld] + SMB_WCT (packet) * 2[%ld] + SMB_BCC (packet)[%ld] + 2 = %ld\n",
|
||||
smb_len (packet),
|
||||
SMB_WCT (packet),
|
||||
SMB_BCC (packet),
|
||||
SMB_HEADER_LEN,
|
||||
SMB_WCT (packet) * 2,
|
||||
SMB_BCC (packet),
|
||||
SMB_HEADER_LEN + SMB_WCT (packet) * 2 + SMB_BCC (packet) + 2));
|
||||
|
||||
/* olsen: During protocol negotiation Samba 3.2.5 may return SMB responses which contain
|
||||
more data than is called for. I'm not sure what the right approach to handle
|
||||
this would be. But for now, I've modified this test to check only if there
|
||||
is less data in a response than required. */
|
||||
result = (packet[4] == 0xff
|
||||
&& packet[5] == 'S'
|
||||
&& packet[6] == 'M'
|
||||
&& packet[7] == 'B'
|
||||
&& (smb_len (packet) + 4 == (dword)(
|
||||
SMB_HEADER_LEN + SMB_WCT (packet) * 2 + SMB_BCC (packet) + 2))) ? 0 : (-EIO);
|
||||
&& (smb_len (packet) + 4 >= (dword)
|
||||
(SMB_HEADER_LEN + SMB_WCT (packet) * 2 + SMB_BCC (packet) + 2))) ? 0 : (-EIO);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 72
|
||||
#define DATE "14.4.2009"
|
||||
#define VERS "smbfs 1.72"
|
||||
#define VSTRING "smbfs 1.72 (14.4.2009)\r\n"
|
||||
#define VERSTAG "\0$VER: smbfs 1.72 (14.4.2009)"
|
||||
#define REVISION 73
|
||||
#define DATE "17.4.2009"
|
||||
#define VERS "smbfs 1.73"
|
||||
#define VSTRING "smbfs 1.73 (17.4.2009)\r\n"
|
||||
#define VERSTAG "\0$VER: smbfs 1.73 (17.4.2009)"
|
||||
|
||||
@@ -1 +1 @@
|
||||
72
|
||||
73
|
||||
|
||||
Reference in New Issue
Block a user