From 9cf514009a1912f277bd22fb184393f20e1c988d Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Thu, 29 Aug 2019 19:50:42 -0500 Subject: [PATCH] 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. --- src/bwpass.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bwpass.py b/src/bwpass.py index 01adfcf..fbc922c 100644 --- a/src/bwpass.py +++ b/src/bwpass.py @@ -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, )