]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Avoid repetition of "this config may cache passwords in memory" (v2)
authorDavid Sommerseth <dazo@users.sourceforge.net>
Mon, 26 Apr 2010 07:50:30 +0000 (09:50 +0200)
committerDavid Sommerseth <dazo@users.sourceforge.net>
Thu, 21 Oct 2010 09:40:21 +0000 (11:40 +0200)
For OpenVPN clients with long living connections, this message is repeated
everytime the connection is renegotiated.  This patch removes this behaviour
and will only show this warning once.

Patch ACKed on the developers meeting 2009-04-29.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
misc.c

diff --git a/misc.c b/misc.c
index 0ceeb2d09dec335a93f3fe1e8c361ba2525407b9..1f7f616c67fcc1a3719fcf970fd518810e04043f 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1594,14 +1594,16 @@ void
 purge_user_pass (struct user_pass *up, const bool force)
 {
   const bool nocache = up->nocache;
+  static bool warn_shown = false;
   if (nocache || force)
     {
       CLEAR (*up);
       up->nocache = nocache;
     }
-  else
+  else if (!warn_shown)
     {
       msg (M_WARN, "WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this");
+      warn_shown = true;
     }
 }