summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.go b/main.go
index e5b2366..c71e289 100644
--- a/main.go
+++ b/main.go
@@ -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)