Add -B option to ring the bell before the password prompt.

This commit is contained in:
Todd C. Miller
2019-05-27 08:49:43 -06:00
parent dae484213e
commit 19c548fd57
6 changed files with 41 additions and 18 deletions

View File

@@ -204,6 +204,11 @@ restart:
(void) sigaction(SIGTTIN, &sa, &savettin);
(void) sigaction(SIGTTOU, &sa, &savettou);
if (ISSET(flags, TGP_BELL) && output != STDERR_FILENO) {
/* Ring the bell if requested and there is a tty. */
if (write(output, "\a", 1) == -1)
goto restore;
}
if (prompt) {
if (write(output, prompt, strlen(prompt)) == -1)
goto restore;