bwpass: Pass TTY name to pinentry

The curses-based pinentry defaults to using its standard input stream to
display the prompt, but this fails when stdin is a pipe.  It does
provide a command-line argument to specify a specific file name, though.
master
Dustin C. Hatch 2019-08-29 19:50:42 -05:00
parent 1c80f5bd73
commit 9cf514009a
1 changed files with 2 additions and 1 deletions

View File

@ -65,8 +65,9 @@ class Pinentry:
def getpin(self):
codec = locale.getpreferredencoding()
tty = os.ttyname(sys.stdin.fileno())
p = subprocess.Popen(
['pinentry'],
['pinentry', '-T', tty],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
)