Skip to content

Instantly share code, notes, and snippets.

@Habbie
Created April 26, 2013 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Habbie/5466600 to your computer and use it in GitHub Desktop.
Save Habbie/5466600 to your computer and use it in GitHub Desktop.
Corrected patch for pdns
--- pdns-2.9.19/pdns/common_startup.cc.old Sun Oct 16 15:26:00 2005
+++ pdns-2.9.19/pdns/common_startup.cc Wed Nov 22 17:16:15 2006
@@ -273,7 +273,7 @@
if(!arg()["chroot"].empty()) {
if(arg().mustDo("master") || arg().mustDo("slave"))
gethostbyname("a.root-servers.net"); // this forces all lookup libraries to be loaded
- if(chroot(arg()["chroot"].c_str())<0) {
+ if(chroot(arg()["chroot"].c_str())<0 || chdir("/")<0) {
L<<Logger::Error<<"Unable to chroot to '"+arg()["chroot"]+"': "<<strerror(errno)<<", exiting"<<endl;
exit(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment