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.
This commit is contained in:
@@ -65,8 +65,9 @@ class Pinentry:
|
|||||||
|
|
||||||
def getpin(self):
|
def getpin(self):
|
||||||
codec = locale.getpreferredencoding()
|
codec = locale.getpreferredencoding()
|
||||||
|
tty = os.ttyname(sys.stdin.fileno())
|
||||||
p = subprocess.Popen(
|
p = subprocess.Popen(
|
||||||
['pinentry'],
|
['pinentry', '-T', tty],
|
||||||
stdin=subprocess.PIPE,
|
stdin=subprocess.PIPE,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user