summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGert Doering <gert@greenie.muc.de>2015-08-04 14:53:16 +0200
committerGert Doering <gert@greenie.muc.de>2015-08-04 17:43:54 +0200
commit0ffd744332f51878c4df430ab14aca3126bdfc8a (patch)
treef7aa2d4e5870e0e6403973b633232e6f051c907c
parentcc377dec820f9e6e7e72981013eb3857aa6ea5ce (diff)
downloadopenvpn-0ffd744332f51878c4df430ab14aca3126bdfc8a.zip
openvpn-0ffd744332f51878c4df430ab14aca3126bdfc8a.tar.gz
openvpn-0ffd744332f51878c4df430ab14aca3126bdfc8a.tar.xz
Un-break --auth-user-pass on windows
Commit b131c7b974d9d4d3f0 introduced a check to create a meaningful warning if we try to read a password after daemon()izing (by checking whether stdin or stderr is connected to a tty). For some reason this breaks on Windows builds if run under GUI control - but since Windows doesn't have this particular daemon() issue anyway, just #ifndef WIN32 the offending code. Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Steffan Karger <steffan.karger@fox-it.com> Message-Id: <1438692796-14663-1-git-send-email-gert@greenie.muc.de> URL: http://article.gmane.org/gmane.network.openvpn.devel/10000
-rw-r--r--src/openvpn/misc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c
index c4438b6..895e9fa 100644
--- a/src/openvpn/misc.c
+++ b/src/openvpn/misc.c
@@ -1056,9 +1056,11 @@ get_user_pass_cr (struct user_pass *up,
*/
else if (from_stdin)
{
+#ifndef WIN32
/* did we --daemon'ize before asking for passwords? */
if ( !isatty(0) && !isatty(2) )
{ msg(M_FATAL, "neither stdin nor stderr are a tty device, can't ask for %s password. If you used --daemon, you need to use --askpass to make passphrase-protected keys work, and you can not use --auth-nocache.", prefix ); }
+#endif
#ifdef ENABLE_CLIENT_CR
if (auth_challenge && (flags & GET_USER_PASS_DYNAMIC_CHALLENGE))