getpass() is traditional Unix, but has been withdrawn from POSIX. We
still use it when it's available, and fall back to portable code only
when it's not.
The portable code behaves differently: it reads stdin instead of
/dev/tty, and in noncanonical mode.
Simplify things: always use the replacement.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
# configure.ac: Autoconf input file
#
# Known contributors to this file:
-# Markus Armbruster, 2005-2016
+# Markus Armbruster, 2005-2020
#
# Process this file with autoconf to produce a configure script.
### Checks for library functions
-AC_CHECK_FUNCS(getaddrinfo getpass)
+AC_CHECK_FUNCS(getaddrinfo)
MY_FUNC_MAKECONTEXT
# configure.ac: Autoconf input file
#
# Known contributors to this file:
-# Markus Armbruster, 2005-2016
+# Markus Armbruster, 2005-2020
#
# Process this file with autoconf to produce a configure script.
### Checks for library functions.
-AC_CHECK_FUNCS(getaddrinfo getpass)
+AC_CHECK_FUNCS(getaddrinfo)
### Site configuration
#include <config.h>
-#ifdef HAVE_GETPASS
-#include <unistd.h>
-#else
#include <string.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <termios.h>
#endif
-#endif
#include "misc.h"
-#ifndef HAVE_GETPASS
static int
set_echo_if_tty(int on)
{
return 1;
#endif
}
-#endif /* !HAVE_GETPASS */
char *
get_password(const char *prompt)
{
-#ifdef HAVE_GETPASS
- return getpass(prompt);
-#else
static char buf[128];
char *p;
size_t len;
if (p[len - 1] == '\n')
p[len - 1] = 0;
return p;
-#endif /* !HAVE_GETPASS */
}