Fix a bug introduced by commit 6e9373c84639382c16d9eb8f1f78f60079bb89df

Signed-off-by: Selva Nair <[email protected]>
---
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(-)

diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c
index b6c8854..1ff4e1a 100644
--- a/src/openvpn/misc.c
+++ b/src/openvpn/misc.c
@@ -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? */
-- 
1.7.10.4


Reply via email to