Skip to content

Commit 9f8e19b

Browse files
jekriskerfjakob
authored andcommitted
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.
1 parent b6bda01 commit 9f8e19b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mount.go

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"os/exec"
1010
"os/signal"
11+
"path"
1112
"path/filepath"
1213
"runtime"
1314
"strings"
@@ -314,6 +315,13 @@ func initFuseFrontend(key []byte, args *argContainer, confFile *configfile.ConfF
314315
if args.reverse {
315316
mOpts.Name += "-reverse"
316317
}
318+
319+
// Add a volume name if running osxfuse. Otherwise the Finder will show it as
320+
// something like "osxfuse Volume 0 (gocryptfs)".
321+
if runtime.GOOS == "darwin" {
322+
mOpts.Options = append(mOpts.Options, "volname="+path.Base(args.mountpoint))
323+
}
324+
317325
// The kernel enforces read-only operation, we just have to pass "ro".
318326
// Reverse mounts are always read-only.
319327
if args.ro || args.reverse {

0 commit comments

Comments
 (0)