From: Timo Sirainen Date: Thu, 9 Apr 2009 23:14:06 +0000 (-0400) Subject: restrict-access: One more root dropping fix. X-Git-Tag: 2.0.alpha1~998 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=628e629d60a3fb1d9320fe0d38489450bd2cd8cc;p=thirdparty%2Fdovecot%2Fcore.git restrict-access: One more root dropping fix. --HG-- branch : HEAD --- diff --git a/src/lib/restrict-access.c b/src/lib/restrict-access.c index 0246c6630a..cbb80ad0cb 100644 --- a/src/lib/restrict-access.c +++ b/src/lib/restrict-access.c @@ -297,7 +297,7 @@ void restrict_access(const struct restrict_access_settings *set, } /* verify that we actually dropped the privileges */ - if (set->uid != 0 || disallow_root) { + if ((set->uid != (uid_t)-1 && set->uid != 0) || disallow_root) { if (setuid(0) == 0) { if (disallow_root && (set->uid == 0 || set->uid == (uid_t)-1))