aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse/rfs.go
diff options
context:
space:
mode:
authorCharles Duffy2017-05-30 16:01:06 -0500
committerrfjakob2017-06-01 00:26:17 +0200
commitcf1ded5236157e2f9ec06eeea26023b67b40f16d (patch)
tree48c9926efd8c10a76b6f28943397f8b1ae5cc3da /internal/fusefrontend_reverse/rfs.go
parentfc2a5f5ab0149d48b5d45a9af96799b07d802ae6 (diff)
Implement force_owner option to display ownership as a specific user.
Diffstat (limited to 'internal/fusefrontend_reverse/rfs.go')
-rw-r--r--internal/fusefrontend_reverse/rfs.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go
index 63384ac..3c84e15 100644
--- a/internal/fusefrontend_reverse/rfs.go
+++ b/internal/fusefrontend_reverse/rfs.go
@@ -115,6 +115,9 @@ func (rfs *ReverseFS) GetAttr(relPath string, context *fuse.Context) (*fuse.Attr
}
var a fuse.Attr
a.FromStat(&st)
+ if rfs.args.ForceOwner != nil {
+ a.Owner = *rfs.args.ForceOwner
+ }
return &a, fuse.OK
}
// Handle virtual files (gocryptfs.diriv, *.name)
@@ -136,6 +139,9 @@ func (rfs *ReverseFS) GetAttr(relPath string, context *fuse.Context) (*fuse.Attr
}
var a fuse.Attr
status = f.GetAttr(&a)
+ if rfs.args.ForceOwner != nil {
+ a.Owner = *rfs.args.ForceOwner
+ }
return &a, status
}
// Decrypt path to "plaintext relative path"
@@ -177,6 +183,9 @@ func (rfs *ReverseFS) GetAttr(relPath string, context *fuse.Context) (*fuse.Attr
a.Size = uint64(len(linkTarget))
}
+ if rfs.args.ForceOwner != nil {
+ a.Owner = *rfs.args.ForceOwner
+ }
return &a, fuse.OK
}