]> 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, 29 Apr 2010 20:22:48 +0000 (22:22 +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 cb6478e20078cdda03eda9b0b67202cdb1b94254..123ff48f8bf7656298f7eac0e94bda2ed9ad8d8d 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1588,14 +1588,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;
     }
 }