diff options
author | Jakob Unterwurzacher | 2016-10-06 22:41:13 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-10-06 22:41:13 +0200 |
commit | 434ce50db38e78f7e2a67af07cb92d8829fdfdf6 (patch) | |
tree | 33315121c236268e4c10b7df9ccf98d931d5f606 /main.go | |
parent | ff48dc1aab1c551dcaaa0f46b32dbc5f35e90e2e (diff) |
main: add "-nonempty" option
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -236,7 +236,11 @@ func main() { tlog.Fatal.Printf("Invalid mountpoint: %v", err) os.Exit(ErrExitMountPoint) } - err = checkDirEmpty(args.mountpoint) + if args.nonempty { + err = checkDir(args.mountpoint) + } else { + err = checkDirEmpty(args.mountpoint) + } if err != nil { tlog.Fatal.Printf("Invalid mountpoint: %v", err) os.Exit(ErrExitMountPoint) @@ -348,6 +352,9 @@ 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 args.nonempty { + mOpts.Options = append(mOpts.Options, "nonempty") + } // Set values shown in "df -T" and friends // First column, "Filesystem" mOpts.Options = append(mOpts.Options, "fsname="+args.cipherdir) |