From: Jeffrey Altman Date: Tue, 6 Jun 2006 17:58:50 +0000 (+0000) Subject: STABLE14-windows-smb-mountpt-is-dir-20060606 X-Git-Tag: openafs-stable-1_4_2-beta1~8 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=86bb89598c90ec95f51402374485f39fd6c6f87d;p=packages%2Fo%2Fopenafs.git STABLE14-windows-smb-mountpt-is-dir-20060606 Be consistent about reporting mountpoints and invalid links as directories to the CIFS client. (cherry picked from commit 422f2d4523ae9be2ff3f1395db1dd62b0b3a3b4b) --- diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index 39be6f606..ce164a676 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -4761,7 +4761,8 @@ long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack * in a readonly volume doesn't mean it shojuld be marked as RO */ if (newScp->fileType == CM_SCACHETYPE_DIRECTORY || - newScp->fileType == CM_SCACHETYPE_MOUNTPOINT) + newScp->fileType == CM_SCACHETYPE_MOUNTPOINT || + newScp->fileType == CM_SCACHETYPE_INVALID) attrs = SMB_ATTR_DIRECTORY; else attrs = 0; diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index 2ae478548..ef66ca5cc 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -2845,7 +2845,9 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *((u_long *)op) = scp->linkCount; op += 4; *op++ = 0; *op++ = 0; - *op++ = (scp->fileType == CM_SCACHETYPE_DIRECTORY ? 1 : 0); + *op++ = ((scp->fileType == CM_SCACHETYPE_DIRECTORY || + scp->fileType == CM_SCACHETYPE_MOUNTPOINT || + scp->fileType == CM_SCACHETYPE_INVALID) ? 1 : 0); *op++ = 0; } else if (infoLevel == SMB_QUERY_FILE_EA_INFO) { @@ -2967,7 +2969,9 @@ long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *((LARGE_INTEGER *)op) = scp->length; op += 8; /* EOF */ *((u_long *)op) = scp->linkCount; op += 4; *op++ = (delonclose ? 1 : 0); - *op++ = (scp->fileType == CM_SCACHETYPE_DIRECTORY ? 1 : 0); + *op++ = ((scp->fileType == CM_SCACHETYPE_DIRECTORY || + scp->fileType == CM_SCACHETYPE_MOUNTPOINT || + scp->fileType == CM_SCACHETYPE_INVALID)? 1 : 0); *op++ = 0; *op++ = 0; } @@ -6123,7 +6127,9 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* filetype */ smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* dev state */ smb_SetSMBParmByte(outp, parmSlot, - scp->fileType == CM_SCACHETYPE_DIRECTORY); /* is a dir? */ + (scp->fileType == CM_SCACHETYPE_DIRECTORY || + scp->fileType == CM_SCACHETYPE_MOUNTPOINT || + scp->fileType == CM_SCACHETYPE_INVALID) ? 1 : 0); /* is a dir? */ lock_ReleaseMutex(&scp->mx); smb_SetSMBDataLength(outp, 0); @@ -6749,7 +6755,9 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* EOF */ *((USHORT *)outData) = 0; outData += 2; /* filetype */ *((USHORT *)outData) = 0; outData += 2; /* dev state */ - *((USHORT *)outData) = (scp->fileType == CM_SCACHETYPE_DIRECTORY); + *((USHORT *)outData) = ((scp->fileType == CM_SCACHETYPE_DIRECTORY || + scp->fileType == CM_SCACHETYPE_MOUNTPOINT || + scp->fileType == CM_SCACHETYPE_INVALID) ? 1 : 0); outData += 2; /* is a dir? */ lock_ReleaseMutex(&scp->mx); } else { @@ -6797,7 +6805,9 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* EOF */ *((USHORT *)outData) = 0; outData += 2; /* filetype */ *((USHORT *)outData) = 0; outData += 2; /* dev state */ - *((USHORT *)outData) = (scp->fileType == CM_SCACHETYPE_DIRECTORY); + *((USHORT *)outData) = ((scp->fileType == CM_SCACHETYPE_DIRECTORY || + scp->fileType == CM_SCACHETYPE_MOUNTPOINT || + scp->fileType == CM_SCACHETYPE_INVALID) ? 1 : 0); outData += 1; /* is a dir? */ memset(outData,0,24); outData += 24; /* Volume ID and file ID */ *((ULONG *)outData) = 0x001f01ffL; outData += 4; /* Maxmimal access rights */