]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Flip disallow_root in drop_privileges()
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Fri, 29 Sep 2017 10:47:22 +0000 (13:47 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 12 Feb 2018 15:00:14 +0000 (17:00 +0200)
src/master/service-process.c

index cdcc46520ef4fad2f9a86bd4abe18c938ea5d78c..6de8cbb77ba263a5f0d10ff951af0aac66c0e7cd 100644 (file)
@@ -170,7 +170,7 @@ static void
 drop_privileges(struct service *service)
 {
        struct restrict_access_settings rset;
-       bool disallow_root;
+       bool allow_root;
        size_t len;
 
        if (service->vsz_limit != 0)
@@ -192,9 +192,9 @@ drop_privileges(struct service *service)
 
        restrict_access_set_env(&rset);
        if (service->set->drop_priv_before_exec) {
-               disallow_root = service->type == SERVICE_TYPE_LOGIN;
+               allow_root = service->type != SERVICE_TYPE_LOGIN;
                restrict_access(&rset,
-                               disallow_root ? 0 : RESTRICT_ACCESS_FLAG_ALLOW_ROOT,
+                               allow_root ? RESTRICT_ACCESS_FLAG_ALLOW_ROOT : 0,
                                NULL);
        }
 }