Browse code

Avoid repetition of "this config may cache passwords in memory" (v2)

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>

David Sommerseth authored on 2010/04/26 16:50:30
Showing 1 changed files
... ...
@@ -1594,14 +1594,16 @@ void
1594 1594
 purge_user_pass (struct user_pass *up, const bool force)
1595 1595
 {
1596 1596
   const bool nocache = up->nocache;
1597
+  static bool warn_shown = false;
1597 1598
   if (nocache || force)
1598 1599
     {
1599 1600
       CLEAR (*up);
1600 1601
       up->nocache = nocache;
1601 1602
     }
1602
-  else
1603
+  else if (!warn_shown)
1603 1604
     {
1604 1605
       msg (M_WARN, "WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this");
1606
+      warn_shown = true;
1605 1607
     }
1606 1608
 }
1607 1609