mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
In Windows, Go clears any write-related flags when O_APPEND is
specified. This causes WinFSP to think that any O_APPEND requests are actually read-only. This adds an additional check for the FILE_APPEND_DATA flag so that we can ensure the request is sent with at least O_WRONLY and O_APPEND set.
This commit is contained in:
parent
3fe69f2208
commit
b513128cfe
@ -56,6 +56,7 @@ CONTRIBUTOR LIST
|
|||||||
|===
|
|===
|
||||||
|Ben Rubson |ben.rubson at gmail.com
|
|Ben Rubson |ben.rubson at gmail.com
|
||||||
|Bill Zissimopoulos |billziss at navimatics.com
|
|Bill Zissimopoulos |billziss at navimatics.com
|
||||||
|
|Brett Dutro |brett.dutro at gmail.com
|
||||||
|Colin Atkinson (Atakama, https://atakama.com) |colin at atakama.com
|
|Colin Atkinson (Atakama, https://atakama.com) |colin at atakama.com
|
||||||
|Felix Croes |felix at dworkin.nl
|
|Felix Croes |felix at dworkin.nl
|
||||||
|Francois Karam (KS2, http://www.ks2.fr) |francois.karam at ks2.fr
|
|Francois Karam (KS2, http://www.ks2.fr) |francois.karam at ks2.fr
|
||||||
|
@ -1026,6 +1026,22 @@ static NTSTATUS fsp_fuse_intf_Open(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* In Windows, Go clears any write-related flags when O_APPEND is specified.
|
||||||
|
* This causes WinFSP to think that any O_APPEND requests are actually read-only.
|
||||||
|
* Adding an additional check for the FILE_APPEND_DATA flag ensures the request
|
||||||
|
* is sent with at least O_WRONLY and O_APPEND set.
|
||||||
|
*/
|
||||||
|
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)
|
if (0 != f->ops.open)
|
||||||
{
|
{
|
||||||
err = f->ops.open(contexthdr->PosixPath, &fi);
|
err = f->ops.open(contexthdr->PosixPath, &fi);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user