aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-09-19 10:47:16 +0200
committerJakob Unterwurzacher2015-09-19 10:47:16 +0200
commit7d666bd87d9ccfebfdb61639982ccbbb0cd73f17 (patch)
treebbe091d34cd2280e7d15a99f03db3b682238ad05
parentc4ec7a4295da9701d21e2c98bc2816e4a2be8f16 (diff)
Set Fileystem and Type values shown in "df -T" and friends
Filesystem is set to CIPHERDIR, Type is set to fuse.gocryptfs
-rw-r--r--main.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/main.go b/main.go
index 4ee9080..5f85084 100644
--- a/main.go
+++ b/main.go
@@ -246,10 +246,15 @@ func pathfsFrontend(key []byte, cipherdir string, mountpoint string, debug bool)
}
pathFs := pathfs.NewPathNodeFs(finalFs, nil)
conn := nodefs.NewFileSystemConnector(pathFs.Root(), opts)
- mOpts := &fuse.MountOptions{
- AllowOther: false,
- }
- state, err := fuse.NewServer(conn.RawFS(), mountpoint, mOpts)
+ var mOpts fuse.MountOptions
+ mOpts.AllowOther = false
+ // Set values shown in "df -T" and friends
+ // First column, "Filesystem"
+ mOpts.Options = append(mOpts.Options, "fsname=" + cipherdir)
+ // Second column, "Type", will be shown as "fuse." + Name
+ mOpts.Name="gocryptfs"
+
+ state, err := fuse.NewServer(conn.RawFS(), mountpoint, &mOpts)
if err != nil {
fmt.Printf("Mount fail: %v\n", err)
os.Exit(1)