Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Commit

Permalink
partly fixes #1. Check path of pinentry.
Browse files Browse the repository at this point in the history
Up until now pinentry_others returned the path of pinentry
as it is returned by gpgconf. Unfortunately this is hard-coded
and sometimes not correct. This commit adds a check for the path
and falls back to the old behviour (return pinentry from PATH).

Signed-off-by: florian on nixos (Florian Brandes) <[email protected]>
  • Loading branch information
gador committed Nov 11, 2021
1 parent 189fee7 commit 13c651c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pinentry_others.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 13c651c

Please sign in to comment.