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/5466601 to your computer and use it in GitHub Desktop.
Save Habbie/5466601 to your computer and use it in GitHub Desktop.
Patch for recursor
--- pdns-2.9.19/pdns/pdns_recursor.cc.old Wed Nov 22 17:26:30 2006
+++ pdns-2.9.19/pdns/pdns_recursor.cc Wed Nov 22 17:26:05 2006
@@ -684,7 +684,7 @@
if (!arg()["chroot"].empty()) {
- 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