Closed dewyatt closed 4 years ago
I believe things like this should try to read from /dev/tty if avail, and stdin otherwise: https://github.com/riboseinc/rnp/blob/7bafcf181962c12075e92d64b12ca377e91c37ff/src/lib/rnp.c#L1225
/dev/tty
stdin
See rnp_getpass for an example or ttyio.c from GnuPG for a more complete solution.
rnp_getpass
ttyio.c
On the output side (https://github.com/riboseinc/rnp/issues/542), things like this should output to stderr or /dev/tty: https://github.com/riboseinc/rnp/blob/7bafcf181962c12075e92d64b12ca377e91c37ff/src/lib/rnp.c#L1224
stderr
It should warn about the overwrite and prompt for a filename, then proceed.
It prompts for a filename but the user does not get a chance to input it since it tries to read from the pipe.
@dewyatt Agree, actually we also should move all such code parts to CLI level, so input from user will be handled by CLI not library.
Description
I believe things like this should try to read from
/dev/tty
if avail, andstdin
otherwise: https://github.com/riboseinc/rnp/blob/7bafcf181962c12075e92d64b12ca377e91c37ff/src/lib/rnp.c#L1225See
rnp_getpass
for an example orttyio.c
from GnuPG for a more complete solution.On the output side (https://github.com/riboseinc/rnp/issues/542), things like this should output to
stderr
or/dev/tty
: https://github.com/riboseinc/rnp/blob/7bafcf181962c12075e92d64b12ca377e91c37ff/src/lib/rnp.c#L1224Steps to Reproduce
Expected Behavior
It should warn about the overwrite and prompt for a filename, then proceed.
Actual Behavior
It prompts for a filename but the user does not get a chance to input it since it tries to read from the pipe.