diff options
author | Jeff Kriske | 2017-03-26 15:09:54 -0400 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-07-10 23:19:11 +0200 |
commit | 9f8e19b8565ba49922aaddd3935b846feb6dc5a3 (patch) | |
tree | 7097fa35ceeadf6c0dd84a96ce0011ea6450c5e5 /mount.go | |
parent | b6bda01c33d27afa1df6bdc2dc9f3e352cc8d16d (diff) |
Specify a volname for osxfuse
If I use gocryptfs cypher plain then the resulting volume
should be named 'plain' just as it would be on Linux.
Diffstat (limited to 'mount.go')
-rw-r--r-- | mount.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -8,6 +8,7 @@ import ( "os" "os/exec" "os/signal" + "path" "path/filepath" "runtime" "strings" @@ -314,6 +315,13 @@ func initFuseFrontend(key []byte, args *argContainer, confFile *configfile.ConfF if args.reverse { mOpts.Name += "-reverse" } + + // Add a volume name if running osxfuse. Otherwise the Finder will show it as + // something like "osxfuse Volume 0 (gocryptfs)". + if runtime.GOOS == "darwin" { + mOpts.Options = append(mOpts.Options, "volname="+path.Base(args.mountpoint)) + } + // The kernel enforces read-only operation, we just have to pass "ro". // Reverse mounts are always read-only. if args.ro || args.reverse { |