Merge pull request #120 from giuseppe/setattr-no-require-wronly

set_attrs: don't require write to S_IFREG
This commit is contained in:
Giuseppe Scrivano 2019-09-18 13:27:51 +02:00 committed by GitHub
commit b0a9bdaa64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
main.c
View File

@ -3484,7 +3484,7 @@ ovl_setattr (fuse_req_t req, fuse_ino_t ino, struct stat *attr, int to_set, stru
switch (mode & S_IFMT)
{
case S_IFREG:
cleaned_up_fd = fd = TEMP_FAILURE_RETRY (openat (dirfd, node->path, O_NOFOLLOW|O_NONBLOCK|O_WRONLY));
cleaned_up_fd = fd = TEMP_FAILURE_RETRY (openat (dirfd, node->path, O_NOFOLLOW|O_NONBLOCK|(to_set & FUSE_SET_ATTR_SIZE ? O_WRONLY : 0)));
if (fd < 0)
{
fuse_reply_err (req, errno);