From 0272d4419283d95e392cbb91b71ec9a232640c65 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Sat, 11 Jun 2022 17:27:37 +0200 Subject: [PATCH] mount: do not treat \\?\ prefixed paths as network share paths on windows See: #6234 --- cmd/cmount/mountpoint_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/cmount/mountpoint_windows.go b/cmd/cmount/mountpoint_windows.go index a1e511409..49f92c9c2 100644 --- a/cmd/cmount/mountpoint_windows.go +++ b/cmd/cmount/mountpoint_windows.go @@ -18,13 +18,13 @@ import ( var isDriveRegex = regexp.MustCompile(`^[a-zA-Z]\:$`) var isDriveRootPathRegex = regexp.MustCompile(`^[a-zA-Z]\:\\$`) var isDriveOrRootPathRegex = regexp.MustCompile(`^[a-zA-Z]\:\\?$`) -var isNetworkSharePathRegex = regexp.MustCompile(`^\\\\[^\\]+\\[^\\]`) +var isNetworkSharePathRegex = regexp.MustCompile(`^\\\\[^\\\?]+\\[^\\]`) // isNetworkSharePath returns true if the given string is a valid network share path, // in the basic UNC format "\\Server\Share\Path", where the first two path components // are required ("\\Server\Share", which represents the volume). // Extended-length UNC format "\\?\UNC\Server\Share\Path" is not considered, as it is -// not supported by cgofuse/winfsp. +// not supported by cgofuse/winfsp, so returns false for any paths with prefix "\\?\". // Note: There is a UNCPath function in lib/file, but it refers to any extended-length // paths using prefix "\\?\", and not necessarily network resource UNC paths. func isNetworkSharePath(l string) bool {