mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-14 00:14:07 +00:00
Do not allow open with O_RDONLY and O_TRUNC (#1620)
Found via pjdfstests. References #1589.
This commit is contained in:
parent
23e1fbf7b9
commit
01a26a9011
@ -2204,6 +2204,10 @@ static int s3fs_open(const char* _path, struct fuse_file_info* fi)
|
||||
|
||||
S3FS_PRN_INFO("[path=%s][flags=0x%x]", path, fi->flags);
|
||||
|
||||
if ((fi->flags & O_ACCMODE) == O_RDONLY && fi->flags & O_TRUNC) {
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
// clear stat for reading fresh stat.
|
||||
// (if object stat is changed, we refresh it. then s3fs gets always
|
||||
// stat when s3fs open the object).
|
||||
|
Loading…
Reference in New Issue
Block a user