From: Timo Sirainen Date: Fri, 10 Apr 2009 00:18:18 +0000 (-0400) Subject: restrict-access: If running as root, don't give "couldn't drop root group privileges... X-Git-Tag: 2.0.alpha1~994 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=40ade5c175324fe86711b671f3f5c808c9eb00a0;p=thirdparty%2Fdovecot%2Fcore.git restrict-access: If running as root, don't give "couldn't drop root group privileges" error. --HG-- branch : HEAD --- diff --git a/src/lib/restrict-access.c b/src/lib/restrict-access.c index d5ef3fbc4e..b7700666e6 100644 --- a/src/lib/restrict-access.c +++ b/src/lib/restrict-access.c @@ -312,7 +312,8 @@ void restrict_access(const struct restrict_access_settings *set, 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");