--- netcat-4.0.20061122/usr.bin/nc/socks.c +++ netcat-4.0.20061122/usr.bin/nc/socks.c @@ -38,7 +38,9 @@ #include #include #include +#if defined(HAVE_READPASSPHRASE) #include +#endif #include "atomicio.h" #define SOCKS_PORT "1080" @@ -113,11 +115,19 @@ static const char * getproxypass(const char *proxyuser, const char *proxyhost) { char prompt[512]; +#if defined(HAVE_READPASSPHRASE) static char pw[256]; +#else + char *pw; +#endif snprintf(prompt, sizeof(prompt), "Proxy password for %s@%s: ", proxyuser, proxyhost); +#if defined(HAVE_READPASSPHRASE) if (readpassphrase(prompt, pw, sizeof(pw), RPP_REQUIRE_TTY) == NULL) +#else + if ((pw = getpass(prompt)) == NULL) +#endif errx(1, "Unable to read proxy passphrase"); return (pw); }