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/mount.cc')
-rw-r--r--winsup/cygwin/mount.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 64583c7ab..867dab76b 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -130,14 +130,20 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
vol = in_vol;
else
{
+ ULONG access = READ_CONTROL;
/* Always caseinsensitive. We really just need access to the drive. */
InitializeObjectAttributes (&attr, upath, OBJ_CASE_INSENSITIVE, NULL,
NULL);
- /* At least one filesystem (HGFS, VMware shared folders) doesn't like
- to be opened with acces set to just READ_CONTROL. No worries, since
- filesystem information is available without any access bit set. */
- status = NtOpenFile (&vol, 0, &attr, &io, FILE_SHARE_VALID_FLAGS,
+ status = NtOpenFile (&vol, access, &attr, &io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT);
+ /* At least one filesystem (HGFS, VMware shared folders) doesn't like
+ to be opened with access set to just READ_CONTROL. */
+ if (status == STATUS_INVALID_PARAMETER)
+ {
+ access |= FILE_READ_DATA;
+ status = NtOpenFile (&vol, access, &attr, &io, FILE_SHARE_VALID_FLAGS,
+ FILE_OPEN_FOR_BACKUP_INTENT);
+ }
while (!NT_SUCCESS (status)
&& (attr.ObjectName->Length > 7 * sizeof (WCHAR)
|| status == STATUS_NO_MEDIA_IN_DEVICE))
@@ -152,7 +158,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
}
else if (dir.Length > 7 * sizeof (WCHAR))
dir.Length -= sizeof (WCHAR);
- status = NtOpenFile (&vol, 0, &attr, &io, FILE_SHARE_VALID_FLAGS,
+ status = NtOpenFile (&vol, access, &attr, &io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT);
}
if (!NT_SUCCESS (status))