From: Jeffrey Altman Date: Sun, 28 Dec 2008 04:41:48 +0000 (+0000) Subject: DEVEL15-windows-smb-fs-attr-info-20081227 X-Git-Tag: openafs-devel-1_5_56~8 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b74cf71aedb87419fa8185e2e0cbb279e035cf42;p=packages%2Fo%2Fopenafs.git DEVEL15-windows-smb-fs-attr-info-20081227 LICENSE MIT even though the docs for FILE_FS_ATTRIBUTE_INFORMATION state that the MaximumComponentNameLength field is in bytes, it turns out that Windows SMB servers return the value in characters. Reduce the reported value to 255 to match NTFS. (cherry picked from commit 8f3e660270d9c1af268ba45118ab87740fbeeef8) --- diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index be166be99..9976d10ce 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -2757,15 +2757,8 @@ long smb_ReceiveTran2QFSInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t * /* The maxCompLength is supposed to be in bytes */ #ifdef SMB_UNICODE qi.u.FSattributeInfo.attributes |= 0x04; - - if ((vcp->flags & SMB_VCFLAG_USEUNICODE) == SMB_VCFLAG_USEUNICODE) - qi.u.FSattributeInfo.maxCompLength = MAX_PATH * sizeof(wchar_t); - else { -#endif - qi.u.FSattributeInfo.maxCompLength = MAX_PATH; -#ifdef SMB_UNICODE - } #endif + qi.u.FSattributeInfo.maxCompLength = 255; smb_UnparseString(op, qi.u.FSattributeInfo.FSname, _C("AFS"), &sz, SMB_STRF_IGNORENUL); qi.u.FSattributeInfo.FSnameLength = sz;