Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index b468e9e37..887885d22 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2421,6 +2421,23 @@ restart:
{
status = NtQueryInformationFile (h, &io, pfnoi, sizeof *pfnoi,
FileNetworkOpenInformation);
+ if ((status == STATUS_INVALID_PARAMETER
+ || status == STATUS_NOT_IMPLEMENTED)
+ && RtlEqualUnicodePathPrefix (&upath, &ro_u_uncp, FALSE))
+ {
+ /* This occurs when accessing SMB share root dirs hosted on
+ NT4 (STATUS_INVALID_PARAMETER), or when trying to access
+ SMB share root dirs from NT4 (STATUS_NOT_IMPLEMENTED). */
+ status = NtQueryInformationFile (h, &io, &fbi, sizeof fbi,
+ FileBasicInformation);
+ if (NT_SUCCESS (status))
+ {
+ memcpy (pfnoi, &fbi, 4 * sizeof (LARGE_INTEGER));
+ pfnoi->EndOfFile.QuadPart
+ = pfnoi->AllocationSize.QuadPart = 0;
+ pfnoi->FileAttributes = fbi.FileAttributes;
+ }
+ }
if (NT_SUCCESS (status))
fileattr = pfnoi->FileAttributes;
}