dovecot-1.1: Don't apply mail_max_userip_connections limit to ma...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Aug 21 02:20:19 EEST 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/63919bf6dfc5
changeset: 7822:63919bf6dfc5
user: Timo Sirainen <tss at iki.fi>
date: Thu Aug 21 02:20:15 2008 +0300
description:
Don't apply mail_max_userip_connections limit to master user logins.
diffstat:
1 file changed, 20 insertions(+), 13 deletions(-)
src/master/mail-process.c | 33 ++++++++++++++++++++-------------
diffs (63 lines):
diff -r 5d0406541434 -r 63919bf6dfc5 src/master/mail-process.c
--- a/src/master/mail-process.c Thu Aug 14 03:10:34 2008 -0400
+++ b/src/master/mail-process.c Thu Aug 21 02:20:15 2008 +0300
@@ -526,7 +526,7 @@ create_mail_process(enum process_type pr
{
const struct var_expand_table *var_expand_table;
const char *p, *addr, *mail, *chroot_dir, *home_dir, *full_home_dir;
- const char *system_user;
+ const char *system_user, *master_user;
struct mail_process_group *process_group;
char title[1024];
struct log_io *log;
@@ -547,17 +547,8 @@ create_mail_process(enum process_type pr
return MASTER_LOGIN_STATUS_INTERNAL_ERROR;
}
- /* check process limit for this user */
- process_group = dump_capability ? NULL :
- mail_process_group_lookup(process_type, user, remote_ip);
- process_count = process_group == NULL ? 0 :
- array_count(&process_group->processes);
- if (process_count >= set->mail_max_userip_connections &&
- set->mail_max_userip_connections != 0)
- return MASTER_LOGIN_STATUS_MAX_CONNECTIONS;
-
t_array_init(&extra_args, 16);
- mail = home_dir = chroot_dir = system_user = "";
+ mail = home_dir = chroot_dir = system_user = ""; master_user = NULL;
uid = (uid_t)-1; gid = (gid_t)-1; nice_value = 0;
home_given = FALSE;
for (; *args != NULL; args++) {
@@ -579,13 +570,29 @@ create_mail_process(enum process_type pr
return MASTER_LOGIN_STATUS_INTERNAL_ERROR;
}
uid = (uid_t)strtoul(*args + 4, NULL, 10);
- } else if (strncmp(*args, "gid=", 4) == 0)
+ } else if (strncmp(*args, "gid=", 4) == 0) {
gid = (gid_t)strtoul(*args + 4, NULL, 10);
- else {
+ } else if (strncmp(*args, "master_user=", 12) == 0) {
+ const char *arg = *args;
+
+ master_user = arg + 12;
+ array_append(&extra_args, &arg, 1);
+ } else {
const char *arg = *args;
array_append(&extra_args, &arg, 1);
}
}
+
+ /* check process limit for this user, but not if this is a master
+ user login. */
+ process_group = dump_capability ? NULL :
+ mail_process_group_lookup(process_type, user, remote_ip);
+ process_count = process_group == NULL ? 0 :
+ array_count(&process_group->processes);
+ if (process_count >= set->mail_max_userip_connections &&
+ set->mail_max_userip_connections != 0 &&
+ master_user == NULL)
+ return MASTER_LOGIN_STATUS_MAX_CONNECTIONS;
/* if uid/gid wasn't returned, use the defaults */
if (uid == (uid_t)-1) {
More information about the dovecot-cvs
mailing list