From f1d6a7ced5f84adf750234f09da635ef54a53624 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Tue, 7 Jan 2014 16:15:12 +0100 Subject: [PATCH] set group and supplementary groups before chroot --- pdns/common_startup.cc | 7 +++++-- pdns/pdns_recursor.cc | 4 +++- pdns/unix_utility.cc | 9 +++++++-- pdns/utility.hh | 7 +++++-- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 80d1c7fe89..82d1bbf6c7 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -347,16 +347,19 @@ void mainthread() if(!::arg()["chroot"].empty()) { if(::arg().mustDo("master") || ::arg().mustDo("slave")) gethostbyname("a.root-servers.net"); // this forces all lookup libraries to be loaded + Utility::dropGroupPrivs(newuid, newgid); if(chroot(::arg()["chroot"].c_str())<0 || chdir("/")<0) { L<