From: VMware, Inc <> Date: Tue, 28 Jun 2011 19:36:24 +0000 (-0700) Subject: Fix RO attribute dropped in directory read with HGFS Posix Server X-Git-Tag: 2011.06.27-437995~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=863dc2451696e5ee8b37528fc05ede8f577ee1ea;p=thirdparty%2Fopen-vm-tools.git Fix RO attribute dropped in directory read with HGFS Posix Server Flags were incorrectly being tested for to map to HgfsDirentryV4 when on a Posix HGFS host. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index 59392bff2..2150fb45b 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -7180,7 +7180,10 @@ HgfsServerSearchReadAttrToMask(HgfsFileAttrInfo *attr, // IN/OUT: attributes HGFS_ATTR_VALID_CHANGE_TIME))) { *mask |= (HGFS_SEARCH_READ_TIME_STAMP); } - if (0 != (attr->mask & HGFS_ATTR_VALID_FLAGS)) { + if (0 != (attr->mask & (HGFS_ATTR_VALID_FLAGS | + HGFS_ATTR_VALID_OWNER_PERMS | + HGFS_ATTR_VALID_GROUP_PERMS | + HGFS_ATTR_VALID_OTHER_PERMS))) { Bool isReadOnly = TRUE; *mask |= (HGFS_SEARCH_READ_FILE_ATTRIBUTES); @@ -7203,6 +7206,7 @@ HgfsServerSearchReadAttrToMask(HgfsFileAttrInfo *attr, // IN/OUT: attributes } if (isReadOnly) { attr->flags |= HGFS_ATTR_READONLY; + attr->mask |= HGFS_ATTR_VALID_FLAGS; } } if (0 != (attr->mask & (HGFS_ATTR_VALID_FILEID |