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.
This commit is contained in:
Jakob Unterwurzacher 2016-06-26 19:23:33 +02:00
parent 23cc0657f4
commit fb5e7023ee
1 changed files with 5 additions and 0 deletions

View File

@ -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)