Skip to content

Commit

Permalink
Merge pull request #350 from Tuupertunut/main
Browse files Browse the repository at this point in the history
Fix setting attributes on file without permissions
  • Loading branch information
giuseppe authored May 27, 2022
2 parents dedd841 + 01f49e9 commit e07e1f0
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3984,21 +3984,15 @@ ovl_setattr (fuse_req_t req, fuse_ino_t ino, struct stat *attr, int to_set, stru
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));
if (fd < 0)
{
fuse_reply_err (req, errno);
return;
}
strconcat3 (path, PATH_MAX, get_upper_layer (lo)->path, "/", node->path);
break;

case S_IFDIR:
cleaned_up_fd = fd = TEMP_FAILURE_RETRY (safe_openat (dirfd, node->path, O_NOFOLLOW|O_NONBLOCK, 0));
if (fd < 0)
{
if (errno != ELOOP)
{
fuse_reply_err (req, errno);
return;
}
strconcat3 (path, PATH_MAX, get_upper_layer (lo)->path, "/", node->path);
}
break;

Expand Down

0 comments on commit e07e1f0

Please sign in to comment.