Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fusefrontend: honor ForceOwner for LOOKUP and CREATE operations #610

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}