]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Potential fix for #1907, we now try to trigger libgcc_s.so.1 to load before we chroot...
authorbert hubert <bert.hubert@netherlabs.nl>
Sat, 6 Dec 2014 19:34:01 +0000 (20:34 +0100)
committermind04 <mind04@monshouwer.org>
Mon, 22 Dec 2014 22:00:38 +0000 (23:00 +0100)
but this "should" help. Seriously.

pdns/common_startup.cc

index 656efe615d351fe0bd0bc868197668f0fb3f22a2..8605cdabb61b97481ec7ca2563180523afd25095 100644 (file)
@@ -350,6 +350,20 @@ void *qthread(void *number)
   return 0;
 }
 
+static void* dummyThread(void *)
+{
+  void* ignore=0;
+  pthread_exit(ignore);
+}
+
+static void triggerLoadOfLibraries()
+{
+  pthread_t tid;
+  pthread_create(&tid, 0, dummyThread, 0);
+  void* res;
+  pthread_join(tid, &res);
+}
+
 void mainthread()
 {
   Utility::srandom(time(0));
@@ -369,6 +383,7 @@ void mainthread()
    doSecPoll(true); // this must be BEFORE chroot
 
    if(!::arg()["chroot"].empty()) {  
+     triggerLoadOfLibraries();
      if(::arg().mustDo("master") || ::arg().mustDo("slave"))
         gethostbyname("a.root-servers.net"); // this forces all lookup libraries to be loaded
      Utility::dropGroupPrivs(newuid, newgid);