From: David Sommerseth Date: Mon, 26 Apr 2010 07:50:30 +0000 (+0200) Subject: Avoid repetition of "this config may cache passwords in memory" (v2) X-Git-Tag: v2.2-beta4~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f94529f31cfab709c07d5e012ecc16cc9228d3c;p=thirdparty%2Fopenvpn.git 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 Acked-by: James Yonan --- diff --git a/misc.c b/misc.c index 0ceeb2d09..1f7f616c6 100644 --- 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; } }