]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
restrict-access: Another fix to allow running processes as root.
authorTimo Sirainen <tss@iki.fi>
Thu, 9 Apr 2009 22:31:53 +0000 (18:31 -0400)
committerTimo Sirainen <tss@iki.fi>
Thu, 9 Apr 2009 22:31:53 +0000 (18:31 -0400)
--HG--
branch : HEAD

src/lib/restrict-access.c

index 041e1afaab1019ef6693b97d0bd945555d567ff5..d8183bac8c6a9f75be430c00a78f0328dfdabb85 100644 (file)
@@ -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)