[Openvpn-devel,v1] Fixup: prompting password from management

Message ID 20260424161840.5767-1-gert@greenie.muc.de
State New
Headers show
Series [Openvpn-devel,v1] Fixup: prompting password from management | expand

Commit Message

Gert Doering April 24, 2026, 4:18 p.m. UTC
From: Selva Nair <selva.nair@gmail.com>

Commit b450414 added logic for reading password from management
when not in file or inline, but it was made conditional on
`response_from_stdin` which is always true! Fix by explicitly
checking for `password_from_stdin`.

Change-Id: I4d46c3672691b159cbd98a17020c4f30782bc202
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1638
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1638
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>

Comments

Gert Doering April 25, 2026, 8:30 p.m. UTC | #1
I have verified the original problem in GH #1021 (as soon as
--management-query-passwords is active, username+password passed in via
file or inline is ignored and the mgmt interface is queried instead
- which can actually be tested from t_client.rc, so I have proper
regression tests for this now).

I have *also* tested (this time) that with the patch, all the "credentials
on file" functionality still works, and also that querying from the
management interface *also* still works.  We should really stop breaking
these...

Your patch has been applied to the master and release/2.7 branch.

commit 9ac9a41b82aecdb5cb17a3746a7fa50878ec7ee0 (master)
commit 8d512db3fcfceed73cd302f27c2c7849764c33f6 (release/2.7)
Author: Selva Nair
Date:   Fri Apr 24 18:18:33 2026 +0200

     Fixup: prompting password from management

     Signed-off-by: Selva Nair <selva.nair@gmail.com>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1638
     Message-Id: <20260424161840.5767-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36739.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c
index 979293f..10bfc35 100644
--- a/src/openvpn/misc.c
+++ b/src/openvpn/misc.c
@@ -336,6 +336,7 @@ 
              */
             if (management && (flags & GET_USER_PASS_MANAGEMENT)
                 && management_query_user_pass_enabled(management)
+                && password_from_stdin
                 && !(flags & GET_USER_PASS_USERNAME_ONLY))
             {
                 msg(D_LOW,