Skip to content

Commit

Permalink
fusefrontend: honor ForceOwner for LOOKUP and CREATE operations
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-dyfis-net authored and rfjakob committed Oct 15, 2021
1 parent 3b881b0 commit 8ec872e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/fusefrontend/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func (n *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (ch
n.translateSize(dirfd, cName, &out.Attr)

rn := n.rootNode()
if rn.args.ForceOwner != nil {
out.Owner = *rn.args.ForceOwner
}

if rn.args.SharedStorage {
// If we already have a child node that matches what we found on disk*
// (as reflected in `ch`), return it here.
Expand Down
6 changes: 6 additions & 0 deletions internal/fusefrontend/node_open_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ func (n *Node) Create(ctx context.Context, name string, flags uint32, mode uint3
if errno != 0 {
return
}

inode = n.newChild(ctx, st, out)

if rn.args.ForceOwner != nil {
out.Owner = *rn.args.ForceOwner
}

return inode, fh, fuseFlags, errno
}

0 comments on commit 8ec872e

Please sign in to comment.