* mount.cc (fs_info::update): Open filesystem with access set to 0.
Explain why.
This commit is contained in:
parent
c9b8019225
commit
d974d420d4
|
@ -1,3 +1,8 @@
|
|||
2009-07-22 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* mount.cc (fs_info::update): Open filesystem with access set to 0.
|
||||
Explain why.
|
||||
|
||||
2009-07-22 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* mount.cc: Revert accidental checkin.
|
||||
|
|
|
@ -133,8 +133,11 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
|
|||
/* Always caseinsensitive. We really just need access to the drive. */
|
||||
InitializeObjectAttributes (&attr, upath, OBJ_CASE_INSENSITIVE, NULL,
|
||||
NULL);
|
||||
status = NtOpenFile (&vol, READ_CONTROL, &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 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,
|
||||
FILE_OPEN_FOR_BACKUP_INTENT);
|
||||
while (!NT_SUCCESS (status)
|
||||
&& (attr.ObjectName->Length > 7 * sizeof (WCHAR)
|
||||
|| status == STATUS_NO_MEDIA_IN_DEVICE))
|
||||
|
@ -149,8 +152,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
|
|||
}
|
||||
else if (dir.Length > 7 * sizeof (WCHAR))
|
||||
dir.Length -= sizeof (WCHAR);
|
||||
status = NtOpenFile (&vol, READ_CONTROL, &attr, &io,
|
||||
FILE_SHARE_VALID_FLAGS,
|
||||
status = NtOpenFile (&vol, 0, &attr, &io, FILE_SHARE_VALID_FLAGS,
|
||||
FILE_OPEN_FOR_BACKUP_INTENT);
|
||||
}
|
||||
if (!NT_SUCCESS (status))
|
||||
|
|
Loading…
Reference in New Issue