Mercurial > dovecot > core-2.2
changeset 9058:ace05d7b6da0 HEAD
restrict-access: If running as root, don't give "couldn't drop root group privileges" error.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 09 Apr 2009 20:18:18 -0400 |
parents | c1b201243d52 |
children | 94ecf8a8ed68 |
files | src/lib/restrict-access.c |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/restrict-access.c Thu Apr 09 20:13:41 2009 -0400 +++ b/src/lib/restrict-access.c Thu Apr 09 20:18:18 2009 -0400 @@ -312,7 +312,8 @@ else allow_root_gid = FALSE; - if (!allow_root_gid && set->uid != 0) { + if (!allow_root_gid && set->uid != 0 && + (set->uid != (uid_t)-1 || !is_root)) { if (getgid() == 0 || getegid() == 0 || setgid(0) == 0) { if (process_primary_gid == 0) i_fatal("GID 0 isn't permitted");