diff options
author | Jakob Unterwurzacher | 2016-10-16 16:44:27 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-10-16 16:44:27 +0200 |
commit | b2d33028a6121f2b2a53d3ffe96dd235d59249f1 (patch) | |
tree | d9e0ceeb1958d668eaa8dfb7318ec85f2c21991f /internal/readpassword/read.go | |
parent | 540f125f18d14f4aa55a2c88dfc3d17d8e7dcc1d (diff) |
readpassword: check extpass return code
...and exit if it is not zero.
Diffstat (limited to 'internal/readpassword/read.go')
-rw-r--r-- | internal/readpassword/read.go | 6 |
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) |