From b2d33028a6121f2b2a53d3ffe96dd235d59249f1 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 16 Oct 2016 16:44:27 +0200 Subject: readpassword: check extpass return code ...and exit if it is not zero. --- internal/readpassword/read.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'internal/readpassword') diff --git a/internal/readpassword/read.go b/internal/readpassword/read.go index c1fc3de..6945f0a 100644 --- a/internal/readpassword/read.go +++ b/internal/readpassword/read.go @@ -98,7 +98,11 @@ func readPasswordExtpass(extpass string) string { } p := readLineUnbuffered(pipe) pipe.Close() - cmd.Wait() + err = cmd.Wait() + if err != nil { + tlog.Fatal.Printf("extpass program returned an error: %v", err) + os.Exit(exitCode) + } if len(p) == 0 { tlog.Fatal.Println("extpass: password is empty") os.Exit(exitCode) -- cgit v1.2.3