[Openvpn-devel] Management: warn about password only when the option is in use

Message ID 1520263680-1260-1-git-send-email-selva.nair@gmail.com
State Accepted
Headers show
Series
  • [Openvpn-devel] Management: warn about password only when the option is in use
Related show

Commit Message

Selva Nair March 5, 2018, 3:28 p.m.
From: Selva Nair <selva.nair@gmail.com>

Signed-off-by: Selva Nair <selva.nair@gmail.com>
---
 src/openvpn/options.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Gert Doering March 5, 2018, 3:47 p.m. | #1
"Oops, stupid us..." - how fortunate that Jonathan stopped us before
integrating this into 2.4.5 :-)

Acked-by: Gert Doering <gert@greenie.muc.de>

(Stared at code, and actually tested all cases)

Your patch has been applied to the master branch.

commit 5961250e776194a411a8dfc1670c5c0c73107bf8 (master)
commit 0533bd715bc3865019a718fbe512f86e0a907103 (release/2.4)
Author: Selva Nair
Date:   Mon Mar 5 10:28:00 2018 -0500

     Management: warn about password only when the option is in use

     Signed-off-by: Selva Nair <selva.nair@gmail.com>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <1520263680-1260-1-git-send-email-selva.nair@gmail.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg16631.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

Patch

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index f7995c6..c5bce9f 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -2171,7 +2171,8 @@  options_postprocess_verify_ce(const struct options *options, const struct connec
         msg(M_USAGE, "--management-client-(user|group) can only be used on unix domain sockets");
     }
 
-    if (!(options->management_flags & MF_UNIX_SOCK)
+    if (options->management_addr
+        && !(options->management_flags & MF_UNIX_SOCK)
         && (!options->management_user_pass))
     {
         msg(M_WARN, "WARNING: Using --management on a TCP port WITHOUT "