diff --git a/pinentry_others.go b/pinentry_others.go index 4a60e38..a0380f8 100644 --- a/pinentry_others.go +++ b/pinentry_others.go @@ -2,12 +2,18 @@ package pinentry -import "github.com/gopasspw/pinentry/gpgconf" +import ( + "github.com/gopasspw/pinentry/gpgconf" + "os/exec" +) // GetBinary returns the binary name func GetBinary() string { if p, err := gpgconf.Path("pinentry"); err == nil && p != "" { - return p + // check, whether the returned path acutally exists + if _, err := exec.LookPath(p); err == nil { + return p + } } return "pinentry" }