From adef8db0ae5ed1eb6f8edb88b2685ea6316ea35f Mon Sep 17 00:00:00 2001 From: Pierre Humblet Date: Mon, 9 May 2005 02:39:34 +0000 Subject: 2005-05-09 Pierre Humblet * fhandler.h (class fhandler_netdrive): New class. * fhandler_netdrive.cc (fhandler_netdrive::fhandler_netdrive): New constructor. (fhandler_netdrive::exists): New method. (fhandler_netdrive::fstat): Ditto. (fhandler_netdrive::readdir): Ditto. (fhandler_netdrive::open): Ditto. * dtable.cc (build_fh_pc): Handle case FH_NETDRIVE. * path.cc (isvirtual_dev): Add FH_NETDRIVE. (mount_info::conv_to_win32_path): Detect netdrive device and bypass mount search for network paths. --- winsup/cygwin/path.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 49aeea4b3..71275d652 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -154,7 +154,8 @@ struct win_shortcut_hdr (path_prefix_p (proc, (path), proc_len)) #define isvirtual_dev(devn) \ - (devn == FH_CYGDRIVE || devn == FH_PROC || devn == FH_REGISTRY || devn == FH_PROCESS) + (devn == FH_CYGDRIVE || devn == FH_PROC || devn == FH_REGISTRY \ + || devn == FH_PROCESS || devn == FH_NETDRIVE ) /* Return non-zero if PATH1 is a prefix of PATH2. Both are assumed to be of the same path style and / vs \ usage. @@ -1517,6 +1518,19 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev, } MALLOC_CHECK; + /* If the path is on a network drive, bypass the mount table. + If it's // or //MACHINE, use the netdrive device. */ + if (src_path[1] == '/') + { + if (!strchr (src_path + 2, '/')) + { + dev = *netdrive_dev; + set_flags (flags, PATH_BINARY); + } + backslashify (src_path, dst, 0); + /* Go through chroot check */ + goto out; + } if (isproc (src_path)) { dev = *proc_dev; -- cgit v1.2.3