Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7112:bffc8788eb94 HEAD
If RESTRICT_* environments aren't set, don't try to enable group -1.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 06 Jan 2008 00:19:10 +0200 |
parents | 3b61ff127127 |
children | d5dd0841b2db |
files | src/lib/restrict-access.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/restrict-access.c Sat Jan 05 02:29:24 2008 +0200 +++ b/src/lib/restrict-access.c Sun Jan 06 00:19:10 2008 +0200 @@ -112,10 +112,14 @@ return; } } else { + if (egid == (gid_t)-1 && *tmp == NULL) { + /* nothing to do */ + return; + } /* Some OSes don't like an empty groups list, so use the effective GID as the only one. */ gid_list = t_new(gid_t, 2); - gid_list[0] = egid; + gid_list[0] = egid != (gid_t)-1 ? egid : getegid(); gid_count = 1; }