From fb5e7023eef0b78de4b27dedfa1cc1c56c71a8cc Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 26 Jun 2016 19:23:33 +0200 Subject: [PATCH] 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. --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index c87cc87..8b2f41a 100644 --- a/main.go +++ b/main.go @@ -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)