From fc5a1f79f66ee8e95d87a6e629920a91e5a2a107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 2 Mar 2024 17:11:17 +0100 Subject: [PATCH] Properly forward missing pinentry errors Before running the following command without pinentry in PATH resulted in: Login failed: Could not sync vault: decrypt: MAC mismatch With this change the error is properly forwarded and displayed $ ./goldwarden vault login --email me@example.com Login failed: exec: "pinentry": executable file not found in $PATH --- agent/systemauth/pinentry/pinentry.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/agent/systemauth/pinentry/pinentry.go b/agent/systemauth/pinentry/pinentry.go index 24c3ec1..0fe87c2 100644 --- a/agent/systemauth/pinentry/pinentry.go +++ b/agent/systemauth/pinentry/pinentry.go @@ -42,8 +42,7 @@ func GetPassword(title string, description string) (string, error) { return externalPinentry.GetPassword(title, description) } - // return "", errors.New("Not implemented") - return password, nil + return password, err } func GetApproval(title string, description string) (bool, error) { @@ -56,6 +55,5 @@ func GetApproval(title string, description string) (bool, error) { return externalPinentry.GetApproval(title, description) } - // return true, errors.New("Not implemented") - return approval, nil + return approval, err }