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 --- mount.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mount.go') 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" -- cgit v1.2.3