From c18f10e9ab8279375bb6d9388d1ab44c62f902ba Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 22 Jun 2007 07:01:18 +0000 Subject: [PATCH] DEVEL15-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. (cherry picked from commit afa909e66ca66db50b71434ad0396d9b5a7af936) --- src/WINNT/afsd/smb3.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index 6496aed63..3207a9d01 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -3719,7 +3719,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 */ -- 2.39.5