]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
restrict-access: One more root dropping fix.
authorTimo Sirainen <tss@iki.fi>
Thu, 9 Apr 2009 23:14:06 +0000 (19:14 -0400)
committerTimo Sirainen <tss@iki.fi>
Thu, 9 Apr 2009 23:14:06 +0000 (19:14 -0400)
--HG--
branch : HEAD

src/lib/restrict-access.c

index 0246c6630afb6ac3dfd621ce7cb45ce5fd4d1124..cbb80ad0cb231de1c699bee720ee05b70a7d5f1e 100644 (file)
@@ -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))