From: Tobias Brunner Date: Tue, 11 Oct 2011 14:10:21 +0000 (+0200) Subject: getpass(3) is not supported on Android. X-Git-Tag: 4.6.0~223 X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=commitdiff_plain;h=2421ac9e98bd2e34ac62ff1941254120f930269a getpass(3) is not supported on Android. No replacement yet. --- diff --git a/configure.in b/configure.in index f45fe8f..99cec7c 100644 --- a/configure.in +++ b/configure.in @@ -375,9 +375,7 @@ dnl check if native rwlocks are available AC_CHECK_FUNCS(pthread_rwlock_init) LIBS=$saved_LIBS -AC_CHECK_FUNCS(prctl) - -AC_CHECK_FUNCS(mallinfo) +AC_CHECK_FUNCS(prctl mallinfo getpass) AC_CHECK_HEADERS(sys/sockio.h glob.h) AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h) diff --git a/src/stroke/stroke.c b/src/stroke/stroke.c index 2d2ebe8..2abbd7b 100644 --- a/src/stroke/stroke.c +++ b/src/stroke/stroke.c @@ -101,7 +101,11 @@ static int send_stroke_msg (stroke_msg_t *msg) { *pass = ' '; } +#ifdef HAVE_GETPASS pass = getpass(buffer); +#else + pass = ""; +#endif if (pass) { ignore_result(write(sock, pass, strlen(pass))); diff --git a/src/whack/whack.c b/src/whack/whack.c index 5b2dc47..b277a68 100644 --- a/src/whack/whack.c +++ b/src/whack/whack.c @@ -797,12 +797,14 @@ static void check_end(whack_end_t *this, whack_end_t *that, static void get_secret(int sock) { - const char *buf, *secret; + const char *buf = NULL, *secret; int len; fflush(stdout); usleep(20000); /* give fflush time for flushing */ +#ifdef HAVE_GETPASS buf = getpass("Enter: "); +#endif secret = (buf == NULL)? "" : buf; /* send the secret to pluto */