12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- Index: netcat-openbsd-1.89/openbsd-compat/readpassphrase.c
- ===================================================================
- --- netcat-openbsd-1.89.orig/openbsd-compat/readpassphrase.c 2008-01-22 18:21:56.000000000 -0500
- +++ netcat-openbsd-1.89/openbsd-compat/readpassphrase.c 2008-01-22 18:22:58.000000000 -0500
- @@ -31,6 +31,12 @@
- #include <unistd.h>
- #include <readpassphrase.h>
-
- +#ifdef TCSASOFT
- +# define _T_FLUSH (TCSAFLUSH|TCSASOFT)
- +#else
- +# define _T_FLUSH (TCSAFLUSH)
- +#endif
- +
- static volatile sig_atomic_t signo;
-
- static void handler(int);
- @@ -92,9 +98,11 @@
- memcpy(&term, &oterm, sizeof(term));
- if (!(flags & RPP_ECHO_ON))
- term.c_lflag &= ~(ECHO | ECHONL);
- +#ifdef VSTATUS
- if (term.c_cc[VSTATUS] != _POSIX_VDISABLE)
- term.c_cc[VSTATUS] = _POSIX_VDISABLE;
- - (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term);
- +#endif
- + (void)tcsetattr(input, _T_FLUSH, &term);
- } else {
- memset(&term, 0, sizeof(term));
- term.c_lflag |= ECHO;
- @@ -129,7 +137,7 @@
-
- /* Restore old terminal settings and signals. */
- if (memcmp(&term, &oterm, sizeof(term)) != 0) {
- - while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 &&
- + while (tcsetattr(input, _T_FLUSH, &oterm) == -1 &&
- errno == EINTR)
- continue;
- }
- @@ -164,14 +172,6 @@
- return(nr == -1 ? NULL : buf);
- }
-
- -char *
- -getpass(const char *prompt)
- -{
- - static char buf[_PASSWORD_LEN + 1];
- -
- - return(readpassphrase(prompt, buf, sizeof(buf), RPP_ECHO_OFF));
- -}
- -
- static void handler(int s)
- {
-
|