summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/mount.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/mount.cc')
-rw-r--r--winsup/cygwin/mount.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 262168076..8954a9908 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -590,7 +590,7 @@ mount_item::build_win32 (char *dst, const char *src, unsigned *outflags, unsigne
int
mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
- unsigned *flags)
+ unsigned *flags, bool hide_cygwin_virtuals)
{
bool chroot_ok = !cygheap->root.exists ();
@@ -617,6 +617,13 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
converting normalizex UNIX path to a DOS-style path, looking up the
appropriate drive in the mount table. */
+ if (hide_cygwin_virtuals)
+ {
+ dev = *fs_dev;
+ backslashify (src_path, dst, 0);
+ rc = 0;
+ goto out_no_chroot_check;
+ }
/* See if this is a cygwin "device" */
if (win32_device_name (src_path, dst, dev))
{
@@ -1428,6 +1435,17 @@ mount_info::add_item (const char *native, const char *posix,
if (posix == NULL || !isabspath (posix) ||
is_unc_share (posix) || isdrive (posix))
posixerr = EINVAL;
+ else if (posix[0] == '/' && posix[1] == 0)
+ {
+ /* Special case hack for root, because the Cygnal
+ * version of normalize_posix_path
+ * doesn't handle this.
+ */
+ posixtail = posixtmp;
+ *posixtail++ = '/';
+ *posixtail = '\0';
+ posixerr = 0;
+ }
else
posixerr = normalize_posix_path (posix, posixtmp, posixtail);