Add option to use root as owner of files/dirs

This commit is contained in:
Alexander Neumann
2015-07-26 20:41:29 +02:00
parent bdcb2175c5
commit dde0fd8421
6 changed files with 59 additions and 36 deletions

View File

@@ -13,6 +13,8 @@ import (
)
type CmdMount struct {
Root bool `long:"owner-root" description:"use 'root' as the owner of files and dirs" default:"false"`
global *GlobalOptions
ready chan struct{}
done chan struct{}
@@ -69,7 +71,7 @@ func (cmd CmdMount) Execute(args []string) error {
}
root := fs.Tree{}
root.Add("snapshots", fuse.NewSnapshotsDir(repo))
root.Add("snapshots", fuse.NewSnapshotsDir(repo, cmd.Root))
cmd.global.Printf("Now serving %s at %s\n", repo.Backend().Location(), mountpoint)
cmd.global.Printf("Don't forget to umount after quitting!\n")