dovecot-2.1: auth: If auth_cache_size is larger than process VSZ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Feb 21 11:35:27 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/242ad2a73648
changeset: 14180:242ad2a73648
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Feb 21 11:35:21 2012 +0200
description:
auth: If auth_cache_size is larger than process VSZ limit, log a warning.

diffstat:

 src/auth/passdb-cache.c |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diffs (30 lines):

diff -r 1c1c2a1c85d7 -r 242ad2a73648 src/auth/passdb-cache.c
--- a/src/auth/passdb-cache.c	Tue Feb 21 11:35:05 2012 +0200
+++ b/src/auth/passdb-cache.c	Tue Feb 21 11:35:21 2012 +0200
@@ -1,6 +1,7 @@
 /* Copyright (c) 2004-2012 Dovecot authors, see the included COPYING file */
 
 #include "auth-common.h"
+#include "restrict-process-size.h"
 #include "password-scheme.h"
 #include "passdb.h"
 #include "passdb-cache.h"
@@ -128,9 +129,18 @@
 
 void passdb_cache_init(const struct auth_settings *set)
 {
+	rlim_t limit;
+
 	if (set->cache_size == 0 || set->cache_ttl == 0)
 		return;
 
+	if (restrict_get_process_size(&limit) == 0 &&
+	    set->cache_size > limit) {
+		i_warning("auth_cache_size (%luM) is higher than "
+			  "process VSZ limit (%luM)",
+			  (unsigned long)(set->cache_size/1024/1024),
+			  (unsigned long)(limit/1024/1024));
+	}
 	passdb_cache = auth_cache_new(set->cache_size, set->cache_ttl,
 				      set->cache_negative_ttl);
 }


More information about the dovecot-cvs mailing list