getpass(3) is not supported on Android.
authorTobias Brunner <tobias@strongswan.org>
Tue, 11 Oct 2011 14:10:21 +0000 (16:10 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 11 Oct 2011 14:30:20 +0000 (16:30 +0200)
No replacement yet.

configure.in
src/stroke/stroke.c
src/whack/whack.c

index f45fe8f..99cec7c 100644 (file)
@@ -375,9 +375,7 @@ dnl check if native rwlocks are available
 AC_CHECK_FUNCS(pthread_rwlock_init)
 LIBS=$saved_LIBS
 
 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)
 
 AC_CHECK_HEADERS(sys/sockio.h glob.h)
 AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h)
index 2d2ebe8..2abbd7b 100644 (file)
@@ -101,7 +101,11 @@ static int send_stroke_msg (stroke_msg_t *msg)
                        {
                                *pass = ' ';
                        }
                        {
                                *pass = ' ';
                        }
+#ifdef HAVE_GETPASS
                        pass = getpass(buffer);
                        pass = getpass(buffer);
+#else
+                       pass = "";
+#endif
                        if (pass)
                        {
                                ignore_result(write(sock, pass, strlen(pass)));
                        if (pass)
                        {
                                ignore_result(write(sock, pass, strlen(pass)));
index 5b2dc47..b277a68 100644 (file)
@@ -797,12 +797,14 @@ static void check_end(whack_end_t *this, whack_end_t *that,
 
 static void get_secret(int sock)
 {
 
 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 */
        int len;
 
        fflush(stdout);
        usleep(20000); /* give fflush time for flushing */
+#ifdef HAVE_GETPASS
        buf = getpass("Enter: ");
        buf = getpass("Enter: ");
+#endif
        secret = (buf == NULL)? "" : buf;
 
        /* send the secret to pluto */
        secret = (buf == NULL)? "" : buf;
 
        /* send the secret to pluto */