summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-10-16 16:44:27 +0200
committerJakob Unterwurzacher2016-10-16 16:44:27 +0200
commitb2d33028a6121f2b2a53d3ffe96dd235d59249f1 (patch)
treed9e0ceeb1958d668eaa8dfb7318ec85f2c21991f
parent540f125f18d14f4aa55a2c88dfc3d17d8e7dcc1d (diff)
readpassword: check extpass return code
...and exit if it is not zero.
-rw-r--r--internal/readpassword/read.go6
1 files changed, 5 insertions, 1 deletions
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)