diff options
author | Jakob Unterwurzacher | 2016-06-26 19:23:33 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-06-26 19:23:33 +0200 |
commit | fb5e7023eef0b78de4b27dedfa1cc1c56c71a8cc (patch) | |
tree | b3b0cd88bf470cd99dea5351e3460c6354ca4a23 /main.go | |
parent | 23cc0657f43c21a4f249594a5dcc660b2d5fb77a (diff) |
main: enable device files when running as root
FUSE filesystems are mounted with "nodev" by default. If we run as root,
we can use device files by passing the opposite mount option, "dev".
Fixes xfstests generic/184.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -402,6 +402,11 @@ func initFuseFrontend(key []byte, args argContainer, confFile *configfile.ConfFi // Make the kernel check the file permissions for us mOpts.Options = append(mOpts.Options, "default_permissions") } + if os.Getuid() == 0 { + // FUSE filesystems are mounted with "nodev" by default. If we run as root, + // we can use device files by passing the opposite mount option, "dev". + mOpts.Options = append(mOpts.Options, "dev") + } // Set values shown in "df -T" and friends // First column, "Filesystem" mOpts.Options = append(mOpts.Options, "fsname="+args.cipherdir) |