readpassphrase.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --- a/readpassphrase.c (index)
  2. +++ b/readpassphrase.c (working tree)
  3. @@ -32,6 +32,16 @@
  4. #include <unistd.h>
  5. #include <readpassphrase.h>
  6. +#ifndef TCSASOFT
  7. +/* If we don't have TCSASOFT define it so that ORing it it below is a no-op. */
  8. +# define TCSASOFT 0
  9. +#endif
  10. +
  11. +/* SunOS 4.x which lacks _POSIX_VDISABLE, but has VDISABLE */
  12. +#if !defined(_POSIX_VDISABLE) && defined(VDISABLE)
  13. +# define _POSIX_VDISABLE VDISABLE
  14. +#endif
  15. +
  16. static volatile sig_atomic_t signo[_NSIG];
  17. static void handler(int);
  18. @@ -91,8 +91,6 @@ restart:
  19. memcpy(&term, &oterm, sizeof(term));
  20. if (!(flags & RPP_ECHO_ON))
  21. term.c_lflag &= ~(ECHO | ECHONL);
  22. - if (term.c_cc[VSTATUS] != _POSIX_VDISABLE)
  23. - term.c_cc[VSTATUS] = _POSIX_VDISABLE;
  24. (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term);
  25. } else {
  26. memset(&term, 0, sizeof(term));
  27. @@ -177,14 +187,6 @@ restart:
  28. }
  29. -char *
  30. -getpass(const char *prompt)
  31. -{
  32. - static char buf[_PASSWORD_LEN + 1];
  33. -
  34. - return(readpassphrase(prompt, buf, sizeof(buf), RPP_ECHO_OFF));
  35. -}
  36. -
  37. static void handler(int s)
  38. {