summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/readpassphrase.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Avoid generate SIGTTOU when restoring the terminal mode. If we getmillert2016-10-181-1/+5
| | | | | | | | | SIGTTOU it means the process is not in the foreground process group which, in most cases, means that the shell has taken control of the tty. Requiring the user the fg the process in this case doesn't make sense and can result in both SIGTSTP and SIGTTOU being sent which can lead to the process being suspended again immediately after being brought into the foreground.
* Wrap <readpassphrase.h> so internal calls go direct and readpassphrase is weakguenther2015-09-141-1/+2
|
* most obvious unsigned char casts for ctypederaadt2013-11-241-4/+4
| | | | ok jca krw ingo
* Defer installing signal handlers until echo is disabled so that wemillert2010-05-141-39/+41
| | | | | | get suspended normally when not the foreground process. Fix potential infinite loop when restoring terminal settings if process is in the background when restore occurs. OK miod@
* If a process receives two different signals while in readpassphrase, onlydtucker2010-01-131-13/+19
| | | | | | | the most recent one will be stored for later re-delivery. When the signal handlers are restored, all except the most recent signal will be lost. Replace the single variable with an array so signals are not lost. ok deraadt@
* Use TCSAFLUSH instead of TCSANOW when turning echo back on so thatmillert2008-01-171-2/+2
| | | | | there is no chance of output that was written but still pending to be displayed. This is what the original getpass(3) did.
* If we receive SIGTTOU when turning off echo, the process is alreadymillert2007-10-301-20/+27
| | | | | | | backgrounded. Do not print the password prompt in this case since the first read will result in the process receiving SIGTTIN. Fixes an issue where the password prompt would be displayed when readpassphrase() would not be able to read anything. OK deraadt@
* (char)to{upper,lower}()deraadt2006-03-311-3/+3
|
* zap remaining rcsid.espie2005-08-081-5/+1
| | | | | | Kill old files that are no longer compiled. okay theo
* Restoration of terminal settings can be broken by a well-timed signal,millert2005-05-241-4/+7
| | | | | e.g. a terminating scp killing its ssh child so retry on EINTR. From peak@argo.troja.mff.cuni.cz via portable openssh bugzilla #905
* Sync with share/misc/license.template and add missing DARPA creditmillert2003-06-171-9/+13
| | | | where applicable.
* Use an ISC-tyle license for all my code; it is simpler and more permissive.millert2003-06-031-23/+12
|
* Add RPP_STDIN flag which acts as the converse of RPP_REQUIRE_TTY.millert2002-06-281-5/+9
| | | | Based on a patch from Brett Eldridge.
* Add SIGALRM and SIGPIPE to the list of signals we catch, turn echo back on,millert2002-05-091-10/+14
| | | | | and then re-deliver. Note that for this to work with setugid processes, the recent fix to cansignal() in kern_sig.c is required.
* Catch SIGTTIN and SIGTTOU too and treat them like SIGTSTP.millert2001-12-151-4/+12
|
* o Turn off ECHONL in addition to ECHOmillert2001-12-071-8/+10
| | | | | o Return NULL of read(2) returns -1 o Add ERRORS and STANDARDS sections
* Instead of restoring the tty mode, restoring the signal handler,millert2001-12-071-62/+25
| | | | | | | | unblocking the signal and redelivering it just make all our signal handler interupt system calls and set a flag. We can just deliver the signal at the end right before we would normally return. This solves the SIG_IGN problem nicely and causes readpassphrase() to return when someone hits ^C even if the handler is SIG_IGN.
* Use TCSAFLUSH not TCSANOW. I was only using TCSANOW during debugging...millert2001-12-061-4/+4
|
* Fix a long standing annoyance with getpass/readpassphrase. Instead ofmillert2001-12-061-20/+87
| | | | | | | blocking SIGINT and SIGTSTP, catch them (along with SIGHUP, SIGQUIT, SIGTERM). We restore the tty mode as needed and then restore the original signal handler and resend the signal. For SIGTSTP, upon return from suspend the user is re-prompted for the passphrase.
* Do the memset only if tcgetattr() fails just in case the failedmillert2001-08-071-3/+4
| | | | tcgetattr() mucked with the passed in struct termios in some way.
* Keep a verbatim copy of the old struct termios instead of usingmillert2001-08-071-29/+15
| | | | | | flags to keep track of what we changed. Print a newline if echo is off, even if we didn't turn it off ourselves. Fixes art's problem with a newline not being printed when piping to less.
* typo, spotted by Tom Holroyd <tomh@po.crl.go.jp>; ok deraadt@djm2001-06-271-2/+2
|
* Fix a char vs. u_char problem I introduced in the last commit.millert2001-06-181-2/+3
|
* Disable the STATUS character when reading passwords -- people seem tomillert2001-06-161-5/+21
| | | | expect to be able to use ^T in a password.
* Don't print an extra newline after reading passphrase if echo was notmillert2000-11-291-2/+2
| | | | turned off since we already printed one from the user.
* Add readpasasphrase(3), a more flexible getpass(3) replacement.millert2000-11-211-0/+128
getpass(3) is now implemented in terms of readpasasphrase(3).