main: add "-passfile" option
Make it easier to read the password from a file. Internally this is equivalent to "-extpass /bin/cat FILE".
This commit is contained in:
parent
03c8b13371
commit
e1c5e71b09
@ -108,6 +108,10 @@ built-in crypto is 4x slower unless your CPU has AES instructions and
|
|||||||
you are using Go 1.6+. In mode "auto", gocrypts chooses the faster
|
you are using Go 1.6+. In mode "auto", gocrypts chooses the faster
|
||||||
option.
|
option.
|
||||||
|
|
||||||
|
**-passfile string**
|
||||||
|
: Read password from the specified file. This is a shortcut for
|
||||||
|
specifying "-extpass /bin/cat FILE".
|
||||||
|
|
||||||
**-passwd**
|
**-passwd**
|
||||||
: Change password
|
: Change password
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ type argContainer struct {
|
|||||||
plaintextnames, quiet, nosyslog, wpanic,
|
plaintextnames, quiet, nosyslog, wpanic,
|
||||||
longnames, allow_other, ro, reverse, aessiv, nonempty bool
|
longnames, allow_other, ro, reverse, aessiv, nonempty bool
|
||||||
masterkey, mountpoint, cipherdir, cpuprofile, extpass,
|
masterkey, mountpoint, cipherdir, cpuprofile, extpass,
|
||||||
memprofile, ko string
|
memprofile, ko, passfile string
|
||||||
// Configuration file name override
|
// Configuration file name override
|
||||||
config string
|
config string
|
||||||
notifypid, scryptn int
|
notifypid, scryptn int
|
||||||
@ -86,6 +86,7 @@ func parseCliOpts() (args argContainer) {
|
|||||||
flagSet.StringVar(&args.memprofile, "memprofile", "", "Write memory profile to specified file")
|
flagSet.StringVar(&args.memprofile, "memprofile", "", "Write memory profile to specified file")
|
||||||
flagSet.StringVar(&args.config, "config", "", "Use specified config file instead of CIPHERDIR/gocryptfs.conf")
|
flagSet.StringVar(&args.config, "config", "", "Use specified config file instead of CIPHERDIR/gocryptfs.conf")
|
||||||
flagSet.StringVar(&args.extpass, "extpass", "", "Use external program for the password prompt")
|
flagSet.StringVar(&args.extpass, "extpass", "", "Use external program for the password prompt")
|
||||||
|
flagSet.StringVar(&args.passfile, "passfile", "", "Read password from file")
|
||||||
flagSet.StringVar(&args.ko, "ko", "", "Pass additional options directly to the kernel, comma-separated list")
|
flagSet.StringVar(&args.ko, "ko", "", "Pass additional options directly to the kernel, comma-separated list")
|
||||||
flagSet.IntVar(&args.notifypid, "notifypid", 0, "Send USR1 to the specified process after "+
|
flagSet.IntVar(&args.notifypid, "notifypid", 0, "Send USR1 to the specified process after "+
|
||||||
"successful mount - used internally for daemonization")
|
"successful mount - used internally for daemonization")
|
||||||
@ -110,6 +111,9 @@ func parseCliOpts() (args argContainer) {
|
|||||||
os.Exit(ErrExitUsage)
|
os.Exit(ErrExitUsage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// "-passfile FILE" is a shortcut for "-extpass=/bin/cat FILE"
|
||||||
|
if args.passfile != "" {
|
||||||
|
args.extpass = "/bin/cat " + args.passfile
|
||||||
|
}
|
||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user