]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
restrict-access: If running as root, don't give "couldn't drop root group privileges...
authorTimo Sirainen <tss@iki.fi>
Fri, 10 Apr 2009 00:18:18 +0000 (20:18 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 10 Apr 2009 00:18:18 +0000 (20:18 -0400)
--HG--
branch : HEAD

src/lib/restrict-access.c

index d5ef3fbc4ea7308899824ee418cd9f3485d99279..b7700666e6b8f8fbd30a019d507f18fd3380faaf 100644 (file)
@@ -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");