dovecot-1.2: master: If process uid/gid is too high, refer to la...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Sep 1 02:45:02 EEST 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/8bf54859b19b
changeset: 9352:8bf54859b19b
user: Timo Sirainen <tss at iki.fi>
date: Mon Aug 31 19:44:39 2009 -0400
description:
master: If process uid/gid is too high, refer to last_valid_* settings instead of first_valid_*.
Based on patch by Pascal Volk.
diffstat:
1 file changed, 10 insertions(+), 8 deletions(-)
src/master/mail-process.c | 18 ++++++++++--------
diffs (42 lines):
diff -r 170c03680738 -r 8bf54859b19b src/master/mail-process.c
--- a/src/master/mail-process.c Mon Aug 31 19:31:49 2009 -0400
+++ b/src/master/mail-process.c Mon Aug 31 19:44:39 2009 -0400
@@ -138,28 +138,30 @@ static bool validate_uid_gid(struct sett
if (uid < (uid_t)set->first_valid_uid ||
(set->last_valid_uid != 0 && uid > (uid_t)set->last_valid_uid)) {
struct passwd *pw;
+ bool low = uid < (uid_t)set->first_valid_uid;
pw = getpwuid(uid);
i_error("User %s not allowed to log in using too %s "
- "UNIX UID %s%s (see first_valid_uid in config file)",
- user,
- uid < (uid_t)set->first_valid_uid ? "low" : "high",
+ "UNIX UID %s%s (see %s in config file)",
+ user, low ? "low" : "high",
dec2str(uid), pw == NULL ? "" :
- t_strdup_printf("(%s)", pw->pw_name));
+ t_strdup_printf("(%s)", pw->pw_name),
+ low ? "first_valid_uid" : "last_valid_uid");
return FALSE;
}
if (gid < (gid_t)set->first_valid_gid ||
(set->last_valid_gid != 0 && gid > (gid_t)set->last_valid_gid)) {
struct group *gr;
+ bool low = gid < (gid_t)set->first_valid_gid;
gr = getgrgid(gid);
i_error("User %s not allowed to log in using too %s primary "
- "UNIX group ID %s%s (see first_valid_gid in config file)",
- user,
- gid < (gid_t)set->first_valid_gid ? "low" : "high",
+ "UNIX group ID %s%s (see %s in config file)",
+ user, low ? "low" : "high",
dec2str(gid), gr == NULL ? "" :
- t_strdup_printf("(%s)", gr->gr_name));
+ t_strdup_printf("(%s)", gr->gr_name),
+ low ? "first_valid_gid" : "last_valid_gid");
return FALSE;
}
More information about the dovecot-cvs
mailing list