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

Commit

Permalink
Merge pull request #2 from gador/main
Browse files Browse the repository at this point in the history
partly fixes #1. Check path of pinentry.
  • Loading branch information
dominikschulz authored Nov 11, 2021
2 parents 189fee7 + f49735e commit f73e4f2
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 f73e4f2

Please sign in to comment.