-
Notifications
You must be signed in to change notification settings - Fork 284
Closed
Description
Right now running gocryptfs encdir /Volumes/encdir
errors out. However, osxfuse automatically creates the encdir
if mounted to /Volumes
because this would require root
permissions which the user might not have.
I guess mount.go
needs to be modified to not check the directory existence when the mount path matches /Volumes/*
on macOS.
I'm willing to write a PR myself but I'm a total Go newbie. Not sure that these are the only critical references in the source:
Lines 38 to 65 in a4dff6a
args.mountpoint, err = filepath.Abs(flagSet.Arg(1)) | |
if err != nil { | |
tlog.Fatal.Printf("Invalid mountpoint: %v", err) | |
os.Exit(exitcodes.MountPoint) | |
} | |
// We cannot mount "/home/user/.cipher" at "/home/user" because the mount | |
// will hide ".cipher" also for us. | |
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(exitcodes.MountPoint) | |
} | |
// Reverse-mounting "/foo" at "/foo/mnt" means we would be recursively | |
// encrypting ourselves. | |
if strings.HasPrefix(args.mountpoint, args.cipherdir+"/") { | |
tlog.Fatal.Printf("Mountpoint %q is contained in cipherdir %q, this is not supported", | |
args.mountpoint, args.cipherdir) | |
os.Exit(exitcodes.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(exitcodes.MountPoint) | |
} |
Metadata
Metadata
Assignees
Labels
No labels