summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-10-08 23:50:19 +0200
committerJakob Unterwurzacher2016-10-08 23:50:19 +0200
commitdc4fdd8f44a9c54f20a13e576eeb140a636e9ee2 (patch)
tree1dff4c6f2c4b96b960972e2bec501274c3f07ebb
parent12f8ba85c21d24300dbcc62d7445b6b7de9ed0bf (diff)
main: fix shadow detection logic
This fired incorrectly: Mountpoint "/home/testuser" would shadow cipherdir "/home/testuser.cipher", this is not supported
-rw-r--r--mount.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/mount.go b/mount.go
index 000d632..3157332 100644
--- a/mount.go
+++ b/mount.go
@@ -38,7 +38,7 @@ func doMount(args *argContainer) int {
}
// We cannot mount "/home/user/.cipher" at "/home/user" because the mount
// will hide ".cipher" also for us.
- if strings.HasPrefix(args.cipherdir, args.mountpoint) {
+ if args.cipherdir == args.mountpoint || strings.HasPrefix(args.cipherdir, args.mountpoint+"/") {
tlog.Fatal.Printf("Mountpoint %q would shadow cipherdir %q, this is not supported",
args.mountpoint, args.cipherdir)
os.Exit(ErrExitMountPoint)