Changeset 944

Show
Ignore:
Timestamp:
01/14/07 14:21:46 (2 years ago)
Author:
ahu
Message:

close ticket #110 and improve chroot efficacy by chdir("/"), thanks "somebody", no name was attached to the ticket.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pdns/pdns/common_startup.cc

    r763 r944  
    279279     if(arg().mustDo("master") || arg().mustDo("slave")) 
    280280        gethostbyname("a.root-servers.net"); // this forces all lookup libraries to be loaded 
    281      if(chroot(arg()["chroot"].c_str())<0) { 
     281     if(chroot(arg()["chroot"].c_str())<0 || chdir("/")<0) { 
    282282       L<<Logger::Error<<"Unable to chroot to '"+arg()["chroot"]+"': "<<strerror(errno)<<", exiting"<<endl;  
    283283       exit(1); 
  • trunk/pdns/pdns/docs/pdns.sgml

    r942 r944  
    1039910399      </para> 
    1040010400      <para> 
    10401         SQLite exists in two incompatible versions, numbered 2 and 3, and PowerDNS supports both. It is recommended to go with version 3 as is is newer, has better performance and is 
    10402         actively maintained. 
     10401        SQLite exists in two incompatible versions, numbered 2 and 3, and from 2.9.21 onwards, PowerDNS supports both. It is recommended to go with version 3  
     10402        as it is newer, has better performance and is actively maintained. 
    1040310403      </para> 
    1040410404      <sect2> 
  • trunk/pdns/pdns/pdns_recursor.cc

    r935 r944  
    16561656#ifndef WIN32 
    16571657  if (!::arg()["chroot"].empty()) { 
    1658     if (chroot(::arg()["chroot"].c_str())<0) { 
     1658    if (chroot(::arg()["chroot"].c_str())<0 || chdir("/") < 0) { 
    16591659      L<<Logger::Error<<"Unable to chroot to '"+::arg()["chroot"]+"': "<<strerror (errno)<<", exiting"<<endl; 
    16601660      exit(1);