From: Timo Sirainen Date: Thu, 9 Apr 2009 22:31:53 +0000 (-0400) Subject: restrict-access: Another fix to allow running processes as root. X-Git-Tag: 2.0.alpha1~1001 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1ca9a5cafb8b10ee71abc0d28cca0926f468ccbc;p=thirdparty%2Fdovecot%2Fcore.git restrict-access: Another fix to allow running processes as root. --HG-- branch : HEAD --- diff --git a/src/lib/restrict-access.c b/src/lib/restrict-access.c index 041e1afaab..d8183bac8c 100644 --- a/src/lib/restrict-access.c +++ b/src/lib/restrict-access.c @@ -297,12 +297,9 @@ void restrict_access(const struct restrict_access_settings *set, } /* verify that we actually dropped the privileges */ - if (set->uid != (uid_t)-1) { - if (setuid(0) == 0) { - if (set->uid == 0) - i_fatal("This process must not be run as root"); + if (set->uid != (uid_t)-1 && set->uid != 0) { + if (setuid(0) == 0) i_fatal("We couldn't drop root privileges"); - } } if (set->first_valid_gid != 0)