fixed #438: use FILE_WRITE_ATTRIBUTES instead of

FILE_ALL_ACCESS permission to set file time
This commit is contained in:
Günter Obiltschnig 2014-11-19 22:15:48 +01:00
parent bd9d051e46
commit 7cd76b4f69
2 changed files with 2 additions and 2 deletions

View File

@ -228,7 +228,7 @@ void FileImpl::setLastModifiedImpl(const Timestamp& ts)
FILETIME ft;
ft.dwLowDateTime = low;
ft.dwHighDateTime = high;
FileHandle fh(_path, FILE_ALL_ACCESS, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING);
FileHandle fh(_path, FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING);
if (SetFileTime(fh.get(), 0, &ft, &ft) == 0)
handleLastErrorImpl(_path);
}

View File

@ -232,7 +232,7 @@ void FileImpl::setLastModifiedImpl(const Timestamp& ts)
FILETIME ft;
ft.dwLowDateTime = low;
ft.dwHighDateTime = high;
FileHandle fh(_path, _upath, FILE_ALL_ACCESS, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING);
FileHandle fh(_path, _upath, FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING);
if (SetFileTime(fh.get(), 0, &ft, &ft) == 0)
handleLastErrorImpl(_path);
}