main: fix shadow detection logic
This fired incorrectly: Mountpoint "/home/testuser" would shadow cipherdir "/home/testuser.cipher", this is not supported
This commit is contained in:
parent
12f8ba85c2
commit
dc4fdd8f44
2
mount.go
2
mount.go
@ -38,7 +38,7 @@ func doMount(args *argContainer) int {
|
|||||||
}
|
}
|
||||||
// We cannot mount "/home/user/.cipher" at "/home/user" because the mount
|
// We cannot mount "/home/user/.cipher" at "/home/user" because the mount
|
||||||
// will hide ".cipher" also for us.
|
// 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",
|
tlog.Fatal.Printf("Mountpoint %q would shadow cipherdir %q, this is not supported",
|
||||||
args.mountpoint, args.cipherdir)
|
args.mountpoint, args.cipherdir)
|
||||||
os.Exit(ErrExitMountPoint)
|
os.Exit(ErrExitMountPoint)
|
||||||
|
Loading…
Reference in New Issue
Block a user