From d59e7da6a6ee9883d61958ccd3ed3acb7c6ba8dc Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 28 May 2017 17:43:09 +0200 Subject: gocryptfs-xray: dumpmasterkey: disable "Reading password from stdin" ...and also exit with the proper exit code when we get an error. --- gocryptfs-xray/xray_main.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gocryptfs-xray') diff --git a/gocryptfs-xray/xray_main.go b/gocryptfs-xray/xray_main.go index 6cce1c6..85470ec 100644 --- a/gocryptfs-xray/xray_main.go +++ b/gocryptfs-xray/xray_main.go @@ -10,7 +10,9 @@ import ( "github.com/rfjakob/gocryptfs/internal/configfile" "github.com/rfjakob/gocryptfs/internal/contentenc" "github.com/rfjakob/gocryptfs/internal/cryptocore" + "github.com/rfjakob/gocryptfs/internal/exitcodes" "github.com/rfjakob/gocryptfs/internal/readpassword" + "github.com/rfjakob/gocryptfs/internal/tlog" ) const ( @@ -57,10 +59,12 @@ func main() { } func dumpMasterKey(fn string) { + tlog.Info.Enabled = false pw := readpassword.Once("") masterkey, _, err := configfile.LoadConfFile(fn, pw) if err != nil { fmt.Fprintln(os.Stderr, err) + exitcodes.Exit(err) } fmt.Println(hex.EncodeToString(masterkey)) } -- cgit v1.2.3