Only use gpgconf result if the file exists
RELEASE_NOTES=n/a
@@ -6,6 +6,7 @@ import (
"os/exec"
"github.com/gopasspw/gopass/pkg/debug"
+ "github.com/gopasspw/gopass/pkg/fsutil"
"github.com/gopasspw/pinentry/gpgconf"
)
@@ -16,8 +17,8 @@ func detectBinary(name string) (string, error) {
}
// try to get the proper binary from gpgconf(1)
p, err := gpgconf.Path("gpg")
- if err != nil || p == "" {
- debug.Log("gpgconf failed, falling back to path lookup: %q", err)
+ if err != nil || p == "" || !fsutil.IsFile(p) {
+ debug.Log("gpgconf failed (%q), falling back to path lookup: %q", p, err)
// otherwise fall back to the default and try
// to look up "gpg"
return exec.LookPath("gpg")
