Skip to content

Commit

Permalink
Specify a volname for osxfuse
Browse files Browse the repository at this point in the history
If I use gocryptfs cypher plain then the resulting volume
should be named 'plain' just as it would be on Linux.
  • Loading branch information
jekriske authored and rfjakob committed Jul 10, 2017
1 parent b6bda01 commit 9f8e19b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"os/exec"
"os/signal"
"path"
"path/filepath"
"runtime"
"strings"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9f8e19b

Please sign in to comment.