summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-10-06 22:41:13 +0200
committerJakob Unterwurzacher2016-10-06 22:41:13 +0200
commit434ce50db38e78f7e2a67af07cb92d8829fdfdf6 (patch)
tree33315121c236268e4c10b7df9ccf98d931d5f606 /main.go
parentff48dc1aab1c551dcaaa0f46b32dbc5f35e90e2e (diff)
main: add "-nonempty" option
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)