Merge pull request #350 from Tuupertunut/main

Fix setting attributes on file without permissions
This commit is contained in:
Giuseppe Scrivano 2022-05-27 13:50:24 +02:00 committed by GitHub
commit e07e1f09a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
main.c
View File

@ -3984,10 +3984,7 @@ ovl_setattr (fuse_req_t req, fuse_ino_t ino, struct stat *attr, int to_set, stru
case S_IFREG: case S_IFREG:
cleaned_up_fd = fd = TEMP_FAILURE_RETRY (safe_openat (dirfd, node->path, O_NOFOLLOW|O_NONBLOCK|(to_set & FUSE_SET_ATTR_SIZE ? O_WRONLY : 0), 0)); cleaned_up_fd = fd = TEMP_FAILURE_RETRY (safe_openat (dirfd, node->path, O_NOFOLLOW|O_NONBLOCK|(to_set & FUSE_SET_ATTR_SIZE ? O_WRONLY : 0), 0));
if (fd < 0) if (fd < 0)
{ strconcat3 (path, PATH_MAX, get_upper_layer (lo)->path, "/", node->path);
fuse_reply_err (req, errno);
return;
}
break; break;
case S_IFDIR: case S_IFDIR:
@ -3995,10 +3992,7 @@ ovl_setattr (fuse_req_t req, fuse_ino_t ino, struct stat *attr, int to_set, stru
if (fd < 0) if (fd < 0)
{ {
if (errno != ELOOP) if (errno != ELOOP)
{ strconcat3 (path, PATH_MAX, get_upper_layer (lo)->path, "/", node->path);
fuse_reply_err (req, errno);
return;
}
} }
break; break;