From: Jeffrey Altman Date: Fri, 22 Jun 2007 07:00:27 +0000 (+0000) Subject: windows-fake-stat-20070622 X-Git-Tag: BP-openafs-windows-kdfs-ifs~650 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=afa909e66ca66db50b71434ad0396d9b5a7af936;p=packages%2Fo%2Fopenafs.git windows-fake-stat-20070622 When we are faking the status data we can use the vnode value to determine if the object should be treated as a directory or file. even is a directory and odd is a file. This works even when we have never successfully obtained status data for the object. --- diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index 480c92db4..abb28f33a 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -3713,7 +3713,17 @@ smb_ApplyV3DirListPatches(cm_scache_t *dscp, *((u_long *)dptr) = SMB_ATTR_DIRECTORY; break; default: - *((u_long *)dptr) = SMB_ATTR_NORMAL; + /* if we get here we either have a normal file + * or we have a file for which we have never + * received status info. In this case, we can + * check the even/odd value of the entry's vnode. + * even means it is to be treated as a directory + * and odd means it is to be treated as a file. + */ + if (mustFake && (scp->fid.vnode % 2 == 0)) + *((u_long *)dptr) = SMB_ATTR_DIRECTORY; + else + *((u_long *)dptr) = SMB_ATTR_NORMAL; } /* merge in hidden attribute */