CURL no ambiente PHP chroot'ed

2

Como posso descobrir quais arquivos ou soquetes são necessários pelo Curl quando executado em um ambiente PHP chroot'ed no Mac OSX?

Recentemente, assegurei meu site por meio de chrooting PHP, mas agora todas as chamadas para o Amazon S3 por meio de sua API estão falhando, com a mensagem de erro:

Resource id #43; cURL error: Couldn't resolve host 's3.amazonaws.com' 

O mesmo código funciona bem quando chamado de uma linha de comando não-chroot, então presumivelmente é um conjunto de arquivos que precisam ser abertos pelo CURL que não estão sendo abertos.

Como faço para descobrir quais arquivos ele está tentando abrir para poder mapeá-los no directoy chroot'ed?

Com a sugestão de Andrei, usei strace (ou melhor, dtruss o equivalente do mac) para obter alguma saída de depuração.

Esta é uma solicitação que é chrooted e não funciona.

lstat64("/lib/amazonWS/lib
 1806/0x1dd3:    149524       5      3 open("/documents/projects/intahwebz/intahwebz/lib/amazonWS/lib/requestcore/requestcore.class.php
Resource id #43; cURL error: Couldn't resolve host 's3.amazonaws.com' 
", 0x0, 0x1B6) = 5 0 1806/0x1dd3: 149525 3 0 fstat64(0x5, 0x100A9F578, 0x8) = 0 0 1806/0x1dd3: 149527 2 0 fstat64(0x5, 0x100A9F578, 0x90) = 0 0 1806/0x1dd3: 149528 2 0 fstat64(0x5, 0x100A9F578, 0x1001B1FE4) = 0 0 1806/0x1dd3: 149531 5 2 mmap(0x0, 0x72D1, 0x1, 0x1, 0x5, 0x1F) = 0x3BF0000 0 1806/0x1dd3: 149535 4 2 stat64("/documents/projects/intahwebz/intahwebz/lib/amazonWS/lib/requestcore/requestcore.class.php
lstat64("/lib/amazonWS/lib
 1806/0x1dd3:    149524       5      3 open("/documents/projects/intahwebz/intahwebz/lib/amazonWS/lib/requestcore/requestcore.class.php%pre%", 0x0, 0x1B6)      = 5 0
 1806/0x1dd3:    149525       3      0 fstat64(0x5, 0x100A9F578, 0x8)        = 0 0
 1806/0x1dd3:    149527       2      0 fstat64(0x5, 0x100A9F578, 0x90)       = 0 0
 1806/0x1dd3:    149528       2      0 fstat64(0x5, 0x100A9F578, 0x1001B1FE4)        = 0 0
 1806/0x1dd3:    149531       5      2 mmap(0x0, 0x72D1, 0x1, 0x1, 0x5, 0x1F)        = 0x3BF0000 0
 1806/0x1dd3:    149535       4      2 stat64("/documents/projects/intahwebz/intahwebz/lib/amazonWS/lib/requestcore/requestcore.class.php%pre%", 0x1061966D0, 0x106196057)      = 0 0
 1806/0x1dd3:    149565       6      3 munmap(0x103BF0000, 0x72D1)       = 0 0
 1806/0x1dd3:    149568       4      2 close(0x5)        = 0 0
 1806/0x1dd3:    149661       4      1 setitimer(0x2, 0x7FFF5FBFBCE0, 0x0)       = 0 0
 1806/0x1dd3:    149767      90      2 kqueue(0x7FFF5FBFB000, 0x0, 0x50)         = 5 0
 1806/0x1dd3:    149770       4      1 kevent(0x5, 0x7FFF5FBFB000, 0x1)      = 0 0
 1806/0x1dd3:    149782      12      8 socketpair(0x1, 0x1, 0x0)         = 0 0
 1806/0x1dd3:    149792      12      9 sendto_nocancel(0x6, 0x105D8FCF0, 0x3A)       = 58 0
 1806/0x1dd3:    149796       7      3 sendmsg_nocancel(0x6, 0x7FFF5FBFAD30, 0x0)        = 1 0
 1806/0x1dd3:    149797       4      0 close_nocancel(0x9)       = 0 0
 1806/0x1dd3:    149802      45      4 recvfrom_nocancel(0x7, 0x7FFF5FBFAD7C, 0x4)       = 4 0
 1806/0x1dd3:    149806       5      2 close_nocancel(0x7)       = 0 0
 1806/0x1dd3:    149814       6      3 socketpair(0x1, 0x1, 0x0)         = 0 0
 1806/0x1dd3:    149816       4      1 sendto_nocancel(0x6, 0x105D8FCF0, 0x3A)       = 58 0
 1806/0x1dd3:    149818       5      2 sendmsg_nocancel(0x6, 0x7FFF5FBFAD30, 0x0)        = 1 0
 1806/0x1dd3:    149819       3      0 close_nocancel(0x9)       = 0 0
 1806/0x1dd3:    149822     215      2 recvfrom_nocancel(0x7, 0x7FFF5FBFAD7C, 0x4)       = 4 0
 1806/0x1dd3:    149840      20     17 close_nocancel(0x7)       = 0 0
 1806/0x1dd3:    149843       4      1 kevent(0x5, 0x7FFF5FBFB000, 0x1)      = 0 0
 1806/0x1dd3:    149844       3      1 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149846       2      0 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149848       5      2 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C)      = 28 0
 1806/0x1dd3:    149851       5      1 recvfrom_nocancel(0x6, 0x105D8FCF0, 0x40)         = 64 0
 1806/0x1dd3:    149856       8      3 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0)         = 1 0
 1806/0x1dd3:    149861       3      1 kevent(0x5, 0x7FFF5FBFA860, 0x1)      = 0 0
 1806/0x1dd3:    149863       4      1 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C)      = 28 0
 1806/0x1dd3:    149864       3      1 recvfrom_nocancel(0x6, 0x105D85990, 0x42)         = 66 0
 1806/0x1dd3:    149867       4      1 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0)         = 0 0
 1806/0x1dd3:    149869       2      0 kevent(0x5, 0x7FFF5FBFA860, 0x1)      = 0 0
 1806/0x1dd3:    149871       3      1 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149872       2      0 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149873       2      0 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149874       2      0 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149876       4      1 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C)      = 28 0
 1806/0x1dd3:    149877       4      0 recvfrom_nocancel(0x6, 0x105D859E0, 0x40)         = 64 0
 1806/0x1dd3:    149879       3      1 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0)         = 1 0
 1806/0x1dd3:    149881       2      0 kevent(0x5, 0x7FFF5FBFA860, 0x1)      = 0 0
 1806/0x1dd3:    149883       3      0 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C)      = 28 0
 1806/0x1dd3:    149884       3      0 recvfrom_nocancel(0x6, 0x105D85A20, 0x42)         = 66 0
 1806/0x1dd3:    149886       3      1 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0)         = 0 0
 1806/0x1dd3:    149888       2      0 kevent(0x5, 0x7FFF5FBFA860, 0x1)      = 0 0
 1806/0x1dd3:    149889       2      0 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149890       2      0 kevent(0x5, 0x0, 0x0)         = 0 0
 1806/0x1dd3:    149900  389953      9 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149904      60      1 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149909       7      3 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C)      = 28 0
 1806/0x1dd3:    149913       7      2 recvfrom_nocancel(0x6, 0x105D8FD10, 0x2E)         = 46 0
 1806/0x1dd3:    149921       9      4 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0)         = 0 0
 1806/0x1dd3:    149928       5      1 kevent(0x5, 0x7FFF5FBFA860, 0x1)      = 0 0
 1806/0x1dd3:    149932       3      1 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149932       2      0 kevent(0x5, 0x0, 0x0)         = 0 0
 1806/0x1dd3:    149945  439745     12 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149952      13      3 kevent(0x5, 0x0, 0x0)         = 1 0
 1806/0x1dd3:    149961      15      6 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C)      = 28 0
 1806/0x1dd3:    149969      11      4 recvfrom_nocancel(0x6, 0x105D8FD10, 0x2A)         = 42 0
 1806/0x1dd3:    149981      16      8 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0)         = 0 0
 1806/0x1dd3:    149987       9      3 kevent(0x5, 0x7FFF5FBFA860, 0x1)      = 0 0
 1806/0x1dd3:    150002      19      9 sendto_nocancel(0x6, 0x105D8FCF0, 0x1C)       = 28 0
 1806/0x1dd3:    150011      12      5 sendto_nocancel(0x6, 0x105D8FCF0, 0x1C)       = 28 0
 1806/0x1dd3:    150025      22     10 close_nocancel(0x5)       = 0 0
 1806/0x1dd3:    150095      26     18 socket(0x2, 0x1, 0x6)         = 5 0
 1806/0x1dd3:    150109      12      4 setsockopt(0x5, 0xFFFF, 0x1022)       = 0 0
 1806/0x1dd3:    150113       9      2 fcntl(0x5, 0x3, 0x0)      = 2 0
 1806/0x1dd3:    150117       7      2 fcntl(0x5, 0x4, 0x6)      = 0 0
 1806/0x1dd3:    150191      81     73 connect(0x5, 0x7FFF5FBFB9F0, 0x10)        = -1 Err#36
 1806/0x1dd3:    150217  689426     21 select(0x6, 0x7FFF5FBFB730, 0x7FFF5FBFB6B0, 0x7FFF5FBFB630, 0x7FFF5FBFB7D0)       = 1 0
 1806/0x1dd3:    150226      72      2 getsockopt(0x5, 0xFFFF, 0x1007)       = 0 0
 1806/0x1dd3:    150230       6      2 getpeername(0x5, 0x7FFF5FBFB780, 0x7FFF5FBFB6FC)      = 0 0
 1806/0x1dd3:    150232       4      1 getsockname(0x5, 0x7FFF5FBFB700, 0x7FFF5FBFB6FC)      = 0 0
 1806/0x1dd3:    150332      23     17 open_nocancel("/opt/local/share/curl/curl-ca-bundle.crt%pre%", 0x0, 0x1B6)       = 7 0
 1806/0x1dd3:    150339       6      2 fstat64(0x7, 0x7FFF5FBFB440, 0x7FFF5FBFB50C)      = 0 0
 1806/0x1dd3:    150350      14      9 read_nocancel(0x7, "##\n## lib/ca-bundle.crt -- Bundle of CA Root Certificates\n##\n## Certificate data from Mozilla as of: Thu Nov 22 00:12:21 2012\n##\n## This is a bundle of X.509 certificates of public Certificate Authorities\n## (CA). These were automatically extracted from Mo", 0x1000)      = 4096 0
", 0x7FFF5FBF97D0, 0x26) = 0 0 lstat64("/lib/amazonWS%pre%", 0x7FFF5FBF9630, 0x182) = 0 0 open("/lib/amazonWS/lib/requestcore/requestcore.class.php%pre%", 0x0, 0x1B6) = 5 0 fstat64(0x5, 0x100A9F448, 0x8) = 0 0 fstat64(0x5, 0x100A9F448, 0x90) = 0 0 fstat64(0x5, 0x100A9F448, 0x1001B1FE4) = 0 0 mmap(0x0, 0x72D1, 0x1, 0x1, 0x5, 0xFFFFFF8016E89160) = 0x3BF0000 0 stat64("/lib/amazonWS/lib/requestcore/requestcore.class.php%pre%", 0x10621CD68, 0x10621C847) = 0 0 munmap(0x103BF0000, 0x72D1) = 0 0 close(0x5) = 0 0 setitimer(0x2, 0x7FFF5FBFBCE0, 0x0) = 0 0 kqueue(0x7FFF5FBFB000, 0x0, 0x50) = 5 0 kevent(0x5, 0x7FFF5FBFB000, 0x1) = 0 0 socket(0x1, 0x1, 0x0) = 6 0 setsockopt(0x6, 0xFFFF, 0x1022) = 0 0 connect_nocancel(0x6, 0x7FFF5FBFADD0, 0x6A) = -1 Err#2 close_nocancel(0x6) = 0 0 close_nocancel(0x5) = 0 0 kqueue(0x7FFF5FBFB000, 0x0, 0x50) = 5 0 kevent(0x5, 0x7FFF5FBFB000, 0x1) = 0 0 socket(0x1, 0x1, 0x0) = 6 0 setsockopt(0x6, 0xFFFF, 0x1022) = 0 0 connect_nocancel(0x6, 0x7FFF5FBFADD0, 0x6A) = -1 Err#2 close_nocancel(0x6) = 0 0 close_nocancel(0x5) = 0 0 open_nocancel(".%pre%", 0x0, 0x0) = 5 0 fstat64(0x5, 0x7FFF5FBFBA80, 0x0) = 0 0 fcntl_nocancel(0x5, 0x32, 0x7FFF5FBFBCB0) = 0 0 close_nocancel(0x5) = 0 0 stat64("/basereality%pre%", 0x7FFF5FBFB9F0, 0x0) = 0 0 lstat64("/basereality/../BaseReality/html/50x.html%pre%", 0x7FFF5FBFB730, 0x23D) = 0 0
", 0x1061966D0, 0x106196057) = 0 0 1806/0x1dd3: 149565 6 3 munmap(0x103BF0000, 0x72D1) = 0 0 1806/0x1dd3: 149568 4 2 close(0x5) = 0 0 1806/0x1dd3: 149661 4 1 setitimer(0x2, 0x7FFF5FBFBCE0, 0x0) = 0 0 1806/0x1dd3: 149767 90 2 kqueue(0x7FFF5FBFB000, 0x0, 0x50) = 5 0 1806/0x1dd3: 149770 4 1 kevent(0x5, 0x7FFF5FBFB000, 0x1) = 0 0 1806/0x1dd3: 149782 12 8 socketpair(0x1, 0x1, 0x0) = 0 0 1806/0x1dd3: 149792 12 9 sendto_nocancel(0x6, 0x105D8FCF0, 0x3A) = 58 0 1806/0x1dd3: 149796 7 3 sendmsg_nocancel(0x6, 0x7FFF5FBFAD30, 0x0) = 1 0 1806/0x1dd3: 149797 4 0 close_nocancel(0x9) = 0 0 1806/0x1dd3: 149802 45 4 recvfrom_nocancel(0x7, 0x7FFF5FBFAD7C, 0x4) = 4 0 1806/0x1dd3: 149806 5 2 close_nocancel(0x7) = 0 0 1806/0x1dd3: 149814 6 3 socketpair(0x1, 0x1, 0x0) = 0 0 1806/0x1dd3: 149816 4 1 sendto_nocancel(0x6, 0x105D8FCF0, 0x3A) = 58 0 1806/0x1dd3: 149818 5 2 sendmsg_nocancel(0x6, 0x7FFF5FBFAD30, 0x0) = 1 0 1806/0x1dd3: 149819 3 0 close_nocancel(0x9) = 0 0 1806/0x1dd3: 149822 215 2 recvfrom_nocancel(0x7, 0x7FFF5FBFAD7C, 0x4) = 4 0 1806/0x1dd3: 149840 20 17 close_nocancel(0x7) = 0 0 1806/0x1dd3: 149843 4 1 kevent(0x5, 0x7FFF5FBFB000, 0x1) = 0 0 1806/0x1dd3: 149844 3 1 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149846 2 0 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149848 5 2 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C) = 28 0 1806/0x1dd3: 149851 5 1 recvfrom_nocancel(0x6, 0x105D8FCF0, 0x40) = 64 0 1806/0x1dd3: 149856 8 3 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0) = 1 0 1806/0x1dd3: 149861 3 1 kevent(0x5, 0x7FFF5FBFA860, 0x1) = 0 0 1806/0x1dd3: 149863 4 1 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C) = 28 0 1806/0x1dd3: 149864 3 1 recvfrom_nocancel(0x6, 0x105D85990, 0x42) = 66 0 1806/0x1dd3: 149867 4 1 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0) = 0 0 1806/0x1dd3: 149869 2 0 kevent(0x5, 0x7FFF5FBFA860, 0x1) = 0 0 1806/0x1dd3: 149871 3 1 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149872 2 0 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149873 2 0 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149874 2 0 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149876 4 1 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C) = 28 0 1806/0x1dd3: 149877 4 0 recvfrom_nocancel(0x6, 0x105D859E0, 0x40) = 64 0 1806/0x1dd3: 149879 3 1 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0) = 1 0 1806/0x1dd3: 149881 2 0 kevent(0x5, 0x7FFF5FBFA860, 0x1) = 0 0 1806/0x1dd3: 149883 3 0 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C) = 28 0 1806/0x1dd3: 149884 3 0 recvfrom_nocancel(0x6, 0x105D85A20, 0x42) = 66 0 1806/0x1dd3: 149886 3 1 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0) = 0 0 1806/0x1dd3: 149888 2 0 kevent(0x5, 0x7FFF5FBFA860, 0x1) = 0 0 1806/0x1dd3: 149889 2 0 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149890 2 0 kevent(0x5, 0x0, 0x0) = 0 0 1806/0x1dd3: 149900 389953 9 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149904 60 1 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149909 7 3 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C) = 28 0 1806/0x1dd3: 149913 7 2 recvfrom_nocancel(0x6, 0x105D8FD10, 0x2E) = 46 0 1806/0x1dd3: 149921 9 4 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0) = 0 0 1806/0x1dd3: 149928 5 1 kevent(0x5, 0x7FFF5FBFA860, 0x1) = 0 0 1806/0x1dd3: 149932 3 1 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149932 2 0 kevent(0x5, 0x0, 0x0) = 0 0 1806/0x1dd3: 149945 439745 12 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149952 13 3 kevent(0x5, 0x0, 0x0) = 1 0 1806/0x1dd3: 149961 15 6 recvfrom_nocancel(0x6, 0x7FFF5FBFAE30, 0x1C) = 28 0 1806/0x1dd3: 149969 11 4 recvfrom_nocancel(0x6, 0x105D8FD10, 0x2A) = 42 0 1806/0x1dd3: 149981 16 8 select_nocancel(0x7, 0x7FFF5FBFADB0, 0x0) = 0 0 1806/0x1dd3: 149987 9 3 kevent(0x5, 0x7FFF5FBFA860, 0x1) = 0 0 1806/0x1dd3: 150002 19 9 sendto_nocancel(0x6, 0x105D8FCF0, 0x1C) = 28 0 1806/0x1dd3: 150011 12 5 sendto_nocancel(0x6, 0x105D8FCF0, 0x1C) = 28 0 1806/0x1dd3: 150025 22 10 close_nocancel(0x5) = 0 0 1806/0x1dd3: 150095 26 18 socket(0x2, 0x1, 0x6) = 5 0 1806/0x1dd3: 150109 12 4 setsockopt(0x5, 0xFFFF, 0x1022) = 0 0 1806/0x1dd3: 150113 9 2 fcntl(0x5, 0x3, 0x0) = 2 0 1806/0x1dd3: 150117 7 2 fcntl(0x5, 0x4, 0x6) = 0 0 1806/0x1dd3: 150191 81 73 connect(0x5, 0x7FFF5FBFB9F0, 0x10) = -1 Err#36 1806/0x1dd3: 150217 689426 21 select(0x6, 0x7FFF5FBFB730, 0x7FFF5FBFB6B0, 0x7FFF5FBFB630, 0x7FFF5FBFB7D0) = 1 0 1806/0x1dd3: 150226 72 2 getsockopt(0x5, 0xFFFF, 0x1007) = 0 0 1806/0x1dd3: 150230 6 2 getpeername(0x5, 0x7FFF5FBFB780, 0x7FFF5FBFB6FC) = 0 0 1806/0x1dd3: 150232 4 1 getsockname(0x5, 0x7FFF5FBFB700, 0x7FFF5FBFB6FC) = 0 0 1806/0x1dd3: 150332 23 17 open_nocancel("/opt/local/share/curl/curl-ca-bundle.crt%pre%", 0x0, 0x1B6) = 7 0 1806/0x1dd3: 150339 6 2 fstat64(0x7, 0x7FFF5FBFB440, 0x7FFF5FBFB50C) = 0 0 1806/0x1dd3: 150350 14 9 read_nocancel(0x7, "##\n## lib/ca-bundle.crt -- Bundle of CA Root Certificates\n##\n## Certificate data from Mozilla as of: Thu Nov 22 00:12:21 2012\n##\n## This is a bundle of X.509 certificates of public Certificate Authorities\n## (CA). These were automatically extracted from Mo", 0x1000) = 4096 0
", 0x7FFF5FBF97D0, 0x26) = 0 0 lstat64("/lib/amazonWS%pre%", 0x7FFF5FBF9630, 0x182) = 0 0 open("/lib/amazonWS/lib/requestcore/requestcore.class.php%pre%", 0x0, 0x1B6) = 5 0 fstat64(0x5, 0x100A9F448, 0x8) = 0 0 fstat64(0x5, 0x100A9F448, 0x90) = 0 0 fstat64(0x5, 0x100A9F448, 0x1001B1FE4) = 0 0 mmap(0x0, 0x72D1, 0x1, 0x1, 0x5, 0xFFFFFF8016E89160) = 0x3BF0000 0 stat64("/lib/amazonWS/lib/requestcore/requestcore.class.php%pre%", 0x10621CD68, 0x10621C847) = 0 0 munmap(0x103BF0000, 0x72D1) = 0 0 close(0x5) = 0 0 setitimer(0x2, 0x7FFF5FBFBCE0, 0x0) = 0 0 kqueue(0x7FFF5FBFB000, 0x0, 0x50) = 5 0 kevent(0x5, 0x7FFF5FBFB000, 0x1) = 0 0 socket(0x1, 0x1, 0x0) = 6 0 setsockopt(0x6, 0xFFFF, 0x1022) = 0 0 connect_nocancel(0x6, 0x7FFF5FBFADD0, 0x6A) = -1 Err#2 close_nocancel(0x6) = 0 0 close_nocancel(0x5) = 0 0 kqueue(0x7FFF5FBFB000, 0x0, 0x50) = 5 0 kevent(0x5, 0x7FFF5FBFB000, 0x1) = 0 0 socket(0x1, 0x1, 0x0) = 6 0 setsockopt(0x6, 0xFFFF, 0x1022) = 0 0 connect_nocancel(0x6, 0x7FFF5FBFADD0, 0x6A) = -1 Err#2 close_nocancel(0x6) = 0 0 close_nocancel(0x5) = 0 0 open_nocancel(".%pre%", 0x0, 0x0) = 5 0 fstat64(0x5, 0x7FFF5FBFBA80, 0x0) = 0 0 fcntl_nocancel(0x5, 0x32, 0x7FFF5FBFBCB0) = 0 0 close_nocancel(0x5) = 0 0 stat64("/basereality%pre%", 0x7FFF5FBFB9F0, 0x0) = 0 0 lstat64("/basereality/../BaseReality/html/50x.html%pre%", 0x7FFF5FBFB730, 0x23D) = 0 0

Esta é uma solicitação que não é chrooted e funciona:

%pre%

Portanto, parece que não é um acesso direto a arquivos que está falhando no processo, mas sim o envio de soquete. Estou seguindo algumas instruções para tentar configurar o / dev / urandom e outros caminhos não-arquivo para o ambiente chrooted, mas, novamente, existe alguma maneira de saber qual soquete socketpair(0x1, 0x1, 0x0) é, em vez de apenas trabalhar no escuro?

Atualização 2

É um problema conhecido no OSX fazer uma pesquisa de DNS dentro de um chroot: link

Aparentemente, preciso executar um serviço mDNSResponder em / path / to / chroot / var / run / mDNSResponder

    
por Danack 06.03.2013 / 14:30

2 respostas

0

Portanto, aparentemente no OSX todas as chamadas de sistema para gethostbyname são direcionadas através do serviço mDNSResponder que está sendo executado como um soquete em / var / run / mDNSResponder que é diferente das plataformas Linux onde as requisições DNS são enviadas através de arquivos como resolv.conf.

O mDNSResponder não está disponível no ambiente chroot e, portanto, todas as pesquisas de DNS falharão.

Teoricamente, é possível criar um serviço mDNSResponder duplicado que esteja escutando em um soquete em / chroot / var / run / mDNSResponder. No entanto, ninguém parece ter realmente feito isso.

O que é muito mais fácil fazer é configurar um serviço de proxy, por ex. com Squidman rodando no localhost e então fazendo todas as requisições HTTP através dele.

Note também que criar seu próprio dev / random e dev / urandom dentro do chroot, com mknod , parece não funcionar, já que eles ficam sem aleatoriedade, e os pedidos de proxy falharão. Em vez disso, você deve vinculá-los com sudo ln -s /dev/urandom /chroot/dev/urandom

    
por 10.03.2013 / 06:46
2

Provavelmente, há um problema no DNS, verifique se há resolv.conf correto em seu ambiente chroot.

    
por 06.03.2013 / 16:09

Tags