зеркало из https://github.com/mozilla/mig.git
[minor] update pgp getPINNaïve so stty -echo is successful
See #316 for additional details
This commit is contained in:
Родитель
fb040623d8
Коммит
f29d7a480f
|
@ -118,10 +118,12 @@ func (r *Request) GetPIN() (pin string, outerr error) {
|
|||
return "", fmt.Errorf("GETPIN response didn't start with D; got %q", line)
|
||||
}
|
||||
|
||||
func runPass(bin string, args ...string) {
|
||||
func runPass(bin string, args ...string) error {
|
||||
cmd := exec.Command(bin, args...)
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Run()
|
||||
cmd.Stderr = os.Stderr
|
||||
return cmd.Run()
|
||||
}
|
||||
|
||||
func (r *Request) getPINNaïve() (string, error) {
|
||||
|
@ -129,7 +131,10 @@ func (r *Request) getPINNaïve() (string, error) {
|
|||
if err != nil {
|
||||
return "", errors.New("no pinentry or stty found")
|
||||
}
|
||||
runPass(stty, "-echo")
|
||||
err = runPass(stty, "-echo")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error running stty: %v", err)
|
||||
}
|
||||
defer runPass(stty, "echo")
|
||||
|
||||
if r.Desc != "" {
|
||||
|
|
Загрузка…
Ссылка в новой задаче