diff options
Diffstat (limited to 'winsup/cygwin/mount.cc')
-rw-r--r-- | winsup/cygwin/mount.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc index c11ae5ace..2fe9c835a 100644 --- a/winsup/cygwin/mount.cc +++ b/winsup/cygwin/mount.cc @@ -578,7 +578,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 (); @@ -605,6 +605,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)) { @@ -1416,6 +1423,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); |