summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mount.go5
-rw-r--r--tests/cli/cli_test.go17
2 files changed, 22 insertions, 0 deletions
diff --git a/mount.go b/mount.go
index d050c60..f473e1e 100644
--- a/mount.go
+++ b/mount.go
@@ -309,6 +309,11 @@ func initGoFuse(fs pathfs.FileSystem, args *argContainer) *fuse.Server {
if args.fsname != "" {
fsname = args.fsname
}
+ fsname2 := strings.Replace(fsname, ",", "_", -1)
+ if fsname2 != fsname {
+ tlog.Warn.Printf("Warning: %q will be displayed as %q in \"df -T\"", fsname, fsname2)
+ fsname = fsname2
+ }
mOpts.Options = append(mOpts.Options, "fsname="+fsname)
// Second column, "Type", will be shown as "fuse." + Name
mOpts.Name = "gocryptfs"
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go
index bd22a43..51b52c6 100644
--- a/tests/cli/cli_test.go
+++ b/tests/cli/cli_test.go
@@ -518,3 +518,20 @@ func TestConfigPipe(t *testing.T) {
}
test_helpers.UnmountPanic(mnt)
}
+
+// Ciphertext dir and mountpoint contains a comma
+// https://github.com/rfjakob/gocryptfs/issues/262
+func TestComma(t *testing.T) {
+ dir0 := test_helpers.InitFS(t)
+ dir := dir0 + ",foo,bar"
+ err := os.Rename(dir0, dir)
+ if err != nil {
+ t.Fatal(err)
+ }
+ mnt := dir + ".mnt"
+ err = test_helpers.Mount(dir, mnt, false, "-extpass", "echo test", "-wpanic=0")
+ if err != nil {
+ t.Fatalf("Failed to mount %q on %q: %v", dir, mnt, err)
+ }
+ test_helpers.UnmountPanic(mnt)
+}