Skip to contentSkip to conversation

Unbreak reading username-password from management

PATCH New Selva Nair 1 participant 1 message Nov 25, 2015

lore
Share & tools
lore

Selva Nair

author
#0 lore raw

PATCH 1/1 Unbreak reading username-password from management

Fix a bug introduced by commit 6e9373c84639382c16d9eb8f1f78f60079bb89df

---
Without this, management-query-passwords is broken. After successfully taking the username and password from management the code falls to the if block where it is prompted from stdin.
As authfile defaults stdin, the read-from-stdin block should be in an else clause as in the previous version. Oh boy, those if-else blocks are too long and far too many..

 src/openvpn/misc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/misc.c +1 -1
index b6c8854..1ff4e1a 100644
@@ -1106,7 +1106,7 @@ get_user_pass_cr (struct user_pass *up,
       /*
        * Get username/password from standard input?
        */
-      if (username_from_stdin || password_from_stdin)
+      else if (username_from_stdin || password_from_stdin)
 	{
 #ifndef WIN32
 	  /* did we --daemon'ize before asking for passwords? */
Signature · 1 line
1.7.10.4