Merge pull request #272 from pfrejo/hotfix-1.5

Fixed data corruption when overwriting a file on a Fuse v3 filesystem
This commit is contained in:
Bill Zissimopoulos 2020-01-27 14:14:35 -08:00 committed by GitHub
commit e608920679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -64,6 +64,7 @@ CONTRIBUTOR LIST
|Gal Hammer (Red Hat, https://www.redhat.com) |ghammer at redhat.com
|John Oberschelp |john at oberschelp.net
|John Tyner |jtyner at gmail.com
|Pedro Frejo (Arpa System, https://arpasystem.com) |pedro.frejo at arpasystem.com
|Sam Kelly (DuroSoft Technologies LLC, https://durosoft.com) |sam at durosoft.com
|Santiago Ganis |sganis at gmail.com
|Tobias Urlaub |saibotu at outlook.de

View File

@ -1030,14 +1030,12 @@ static NTSTATUS fsp_fuse_intf_Open(FSP_FILE_SYSTEM *FileSystem,
* Some Windows applications (notably Go programs) specify FILE_APPEND_DATA without
* FILE_WRITE_DATA when opening files for appending. This caused the WinFsp-FUSE layer
* to erroneously pass O_RDONLY to the FUSE file system in such cases. We add a test
* for FILE_APPEND_DATA to ensure that either O_WRONLY or O_RDWR is specified and that
* the O_APPEND flag is set.
* for FILE_APPEND_DATA to ensure that either O_WRONLY or O_RDWR is specified.
*/
if (GrantedAccess & FILE_APPEND_DATA)
{
if (fi.flags == 0)
fi.flags = 1; /* need O_WRONLY as a bare minimum in order to append */
fi.flags |= 8/*O_APPEND*/;
}
if (0 != f->ops.open)