From 5ca6243eeb0df43ba0387029c2d8eceffa3172e2 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 18 Sep 2018 19:35:31 +0200 Subject: main: sanitize commas from fsname The cipherdir path is used as the fsname, as displayed in "df -T". Now, having a comma in fsname triggers a sanity check in go-fuse, aborting the mount with: /bin/fusermount: mount failed: Invalid argument fuse.NewServer failed: fusermount exited with code 256 Sanitize fsname by replacing any commas with underscores. https://github.com/rfjakob/gocryptfs/issues/262 --- tests/cli/cli_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') 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) +} -- cgit v1.2.3