Reduces the permission to stat files in Windows.

Check explicitely to have read permission in scanning.
This commit is contained in:
Andrea Mazzoleni 2011-05-04 00:22:12 +02:00
parent 5a2e118c38
commit 64f4d59adb
4 changed files with 13 additions and 4 deletions

View file

@ -203,7 +203,7 @@ static inline int windows_stat(const char* file, struct windows_stat* st)
BY_HANDLE_FILE_INFORMATION info;
HANDLE h;
h = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
h = CreateFile(file, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
if (h == INVALID_HANDLE_VALUE) {
DWORD error = GetLastError();
switch (error) {