From: VMware, Inc <> Date: Wed, 26 Dec 2012 21:20:31 +0000 (-0800) Subject: HGFS: Fix Windows server virtual folders X-Git-Tag: 2012.12.26-958366~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d434ecaf223ff0de7061b2e1ffae42b4c3a6284;p=thirdparty%2Fopen-vm-tools.git HGFS: Fix Windows server virtual folders For the UNC or DRIVE virtual folders enabled by setting the share's host path to an empty string, currently are not quite handled correctly. The shares with empty host names are listed in their Shared Folders virtual folder but have incorrect attriubtes. This is because the shares host paths are passed to the real get attributes function which fails when the path is an empty string. These entries should be defaulted to the HGFS virtual folder attributes. Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index 40e1aa934..9f1da8112 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -7904,13 +7904,24 @@ HgfsGetDirEntry(HgfsHandle hgfsSearchHandle, // IN: ID for search data * problems on the host, the server still enumerates it and * returns to the client. */ +#if defined(_WIN32) /* - * XXX: We will open a new handle for this, but it should be safe - * from oplock-induced deadlock because these are all directories, - * and thus cannot have oplocks placed on them. + * For Windows hosts an empty share path has special meaning and we + * treat it the same as another virtual folder. E.g. Drive or UNC. */ - status = HgfsPlatformGetattrFromName(sharePath, configOptions, - dent->d_name, attr, NULL); + if (0 == sharePathLen) { + HgfsPlatformGetDefaultDirAttrs(attr); + } else +#endif + { + /* + * XXX: We will open a new handle for this, but it should be safe + * from oplock-induced deadlock because these are all directories, + * and thus cannot have oplocks placed on them. + */ + status = HgfsPlatformGetattrFromName(sharePath, configOptions, + dent->d_name, attr, NULL); + } /* * For some reason, Windows marks drives as hidden and system. So