summaryrefslogtreecommitdiff
path: root/cli_args.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-12-15 17:09:38 +0100
committerJakob Unterwurzacher2018-12-15 17:09:38 +0100
commit295d432175292dbaef572093d784aab55f5c0b8f (patch)
treed5db468806d211d0ea5bbd589dad3a0a337de714 /cli_args.go
parentb29ee62749244d1985a71f8df37a1582d9e790c9 (diff)
passfile: directly read file instead of invoking cat
Allows better error handling, gets rid of the call to an external program, and fixes https://github.com/rfjakob/gocryptfs/issues/278 .
Diffstat (limited to 'cli_args.go')
-rw-r--r--cli_args.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/cli_args.go b/cli_args.go
index c073958..b3f2834 100644
--- a/cli_args.go
+++ b/cli_args.go
@@ -243,9 +243,13 @@ func parseCliOpts() (args argContainer) {
args.allow_other = false
args.ko = "noexec"
}
- // '-passfile FILE' is a shortcut for -extpass='/bin/cat -- FILE'
- if args.passfile != "" {
- args.extpass = "/bin/cat -- " + args.passfile
+ if args.extpass != "" && args.passfile != "" {
+ tlog.Fatal.Printf("The options -extpass and -passfile cannot be used at the same time")
+ os.Exit(exitcodes.Usage)
+ }
+ if args.passfile != "" && args.masterkey != "" {
+ tlog.Fatal.Printf("The options -passfile and -masterkey cannot be used at the same time")
+ os.Exit(exitcodes.Usage)
}
if args.extpass != "" && args.masterkey != "" {
tlog.Fatal.Printf("The options -extpass and -masterkey cannot be used at the same time")