=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/readpass.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/usr.bin/ssh/readpass.c 1999/09/26 20:53:37 1.1 +++ src/usr.bin/ssh/readpass.c 1999/09/30 05:03:05 1.2 @@ -14,18 +14,13 @@ */ #include "includes.h" -RCSID("$Id: readpass.c,v 1.1 1999/09/26 20:53:37 deraadt Exp $"); +RCSID("$Id: readpass.c,v 1.2 1999/09/30 05:03:05 deraadt Exp $"); #include "xmalloc.h" #include "ssh.h" /* Saved old terminal mode for read_passphrase. */ -#ifdef USING_TERMIOS static struct termios saved_tio; -#endif -#ifdef USING_SGTTY -static struct sgttyb saved_tio; -#endif /* Old interrupt signal handler for read_passphrase. */ static RETSIGTYPE (*old_handler)(int sig) = NULL; @@ -35,12 +30,7 @@ RETSIGTYPE intr_handler(int sig) { /* Restore terminal modes. */ -#ifdef USING_TERMIOS tcsetattr(fileno(stdin), TCSANOW, &saved_tio); -#endif -#ifdef USING_SGTTY - ioctl(fileno(stdin), TIOCSETP, &saved_tio); -#endif /* Restore the old signal handler. */ signal(sig, old_handler); /* Resend the signal, with the old handler. */ @@ -55,12 +45,7 @@ char *read_passphrase(const char *prompt, int from_stdin) { char buf[1024], *cp; -#ifdef USING_TERMIOS struct termios tio; -#endif -#ifdef USING_SGTTY - struct sgttyb tio; -#endif FILE *f; if (from_stdin) @@ -105,37 +90,21 @@ fflush(stderr); /* Get terminal modes. */ -#ifdef USING_TERMIOS tcgetattr(fileno(f), &tio); -#endif -#ifdef USING_SGTTY - ioctl(fileno(f), TIOCGETP, &tio); -#endif saved_tio = tio; /* Save signal handler and set the new handler. */ old_handler = signal(SIGINT, intr_handler); /* Set new terminal modes disabling all echo. */ -#ifdef USING_TERMIOS tio.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL); tcsetattr(fileno(f), TCSANOW, &tio); -#endif -#ifdef USING_SGTTY - tio.sg_flags &= ~(ECHO); - ioctl(fileno(f), TIOCSETP, &tio); -#endif /* Read the passphrase from the terminal. */ if (fgets(buf, sizeof(buf), f) == NULL) { /* Got EOF. Just exit. */ /* Restore terminal modes. */ -#ifdef USING_TERMIOS tcsetattr(fileno(f), TCSANOW, &saved_tio); -#endif -#ifdef USING_SGTTY - ioctl(fileno(f), TIOCSETP, &saved_tio); -#endif /* Restore the signal handler. */ signal(SIGINT, old_handler); /* Print a newline (the prompt probably didn\'t have one). */ @@ -146,12 +115,7 @@ exit(1); } /* Restore terminal modes. */ -#ifdef USING_TERMIOS tcsetattr(fileno(f), TCSANOW, &saved_tio); -#endif -#ifdef USING_SGTTY - ioctl(fileno(f), TIOCSETP, &saved_tio); -#endif /* Restore the signal handler. */ (void)signal(SIGINT, old_handler); /* Remove newline from the passphrase. */