]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-program-client: Try drop setuid root by default
authorAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 19 Oct 2016 16:02:22 +0000 (19:02 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 19 Oct 2016 17:23:38 +0000 (20:23 +0300)
But not if root privileges are asked for.

src/lib-program-client/program-client-local.c

index c5037139d9326b04e0b0c8e69b399f8f909d13eb..bfb7433714a3633467a86e2291427199c96d9c25 100644 (file)
@@ -244,6 +244,11 @@ int program_client_local_connect(struct program_client *pclient)
                        }
                }
 
+               /* if we want to allow root, then we will not drop
+                  root privileges */
+               pclient->set.restrict_set.drop_setuid_root =
+                       !pclient->set.allow_root;
+
                restrict_access(&pclient->set.restrict_set, pclient->set.home,
                                !pclient->set.allow_root);