Set Fileystem and Type values shown in "df -T" and friends
Filesystem is set to CIPHERDIR, Type is set to fuse.gocryptfs
This commit is contained in:
parent
c4ec7a4295
commit
7d666bd87d
13
main.go
13
main.go
|
@ -246,10 +246,15 @@ func pathfsFrontend(key []byte, cipherdir string, mountpoint string, debug bool)
|
||||||
}
|
}
|
||||||
pathFs := pathfs.NewPathNodeFs(finalFs, nil)
|
pathFs := pathfs.NewPathNodeFs(finalFs, nil)
|
||||||
conn := nodefs.NewFileSystemConnector(pathFs.Root(), opts)
|
conn := nodefs.NewFileSystemConnector(pathFs.Root(), opts)
|
||||||
mOpts := &fuse.MountOptions{
|
var mOpts fuse.MountOptions
|
||||||
AllowOther: false,
|
mOpts.AllowOther = false
|
||||||
}
|
// Set values shown in "df -T" and friends
|
||||||
state, err := fuse.NewServer(conn.RawFS(), mountpoint, mOpts)
|
// 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 {
|
if err != nil {
|
||||||
fmt.Printf("Mount fail: %v\n", err)
|
fmt.Printf("Mount fail: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
Loading…
Reference in New Issue