Newsgroup: it.comp.os.linux.sys
Titolo: chrooting apache su fedora core 4

Ciao,
sto cercando di mettere apache 2.0.54-10 in chroot(pacchetto rpm su
Fedora Core 4).
Ho messo in chroot altri apache su sercer Centos con lo stesso metodo
senza problemi e non riesco a capire dove stia l'inghippo questa volta.
Dopo aver creato la struttura delle directory ho copiato le librerie ed
i file necessari con l'ausilio di ldd e strace ma alla fine continuo ad
ottenere questo output con strace:
[root@mOrDoR ~]# strace -o /root/strace.txt chroot /chroot/httpd/
/usr/sbin/httpd
execve("/usr/sbin/chroot", ["chroot", "/chroot/httpd/",
"/usr/sbin/httpd"], [/* 29 vars */]) = 0
brk(0)                                  = 0x8ddc000
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7f71000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=98875, ...}) = 0
old_mmap(NULL, 98875, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f58000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\n\257\252"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1489572, ...}) = 0
old_mmap(0xa96000, 1219548, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa96000
old_mmap(0xbba000, 16384, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x124000) = 0xbba000
old_mmap(0xbbe000, 7132, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xbbe000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7f57000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f576c0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xbba000, 8192, PROT_READ)     = 0
mprotect(0xa92000, 4096, PROT_READ)     = 0
munmap(0xb7f58000, 98875)               = 0
brk(0)                                  = 0x8ddc000
brk(0x8dfd000)                          = 0x8dfd000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=48523200, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7d57000
close(3)                                = 0
chroot("/chroot/httpd/")                = 0
chdir("/")                              = 0
execve("/usr/sbin/httpd", ["/usr/sbin/httpd"], [/* 29 vars */]) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2528, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7d56000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2528
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0xb7d56000, 4096)                = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo",
O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=78961, ...}) = 0
mmap2(NULL, 78961, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7d43000
close(3)                                = 0
open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=22294, ...}) = 0
mmap2(NULL, 22294, PROT_READ, MAP_SHARED, 3, 0) = 0xb7d3d000
close(3)                                = 0
open("/usr/lib/gconv/EUC-KR.so", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\5\0\000"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=13528, ...}) = 0
old_mmap(NULL, 12320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
3, 0) = 0x5dd000
old_mmap(0x5df000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x5df000
close(3)                                = 0
open("/usr/lib/gconv/tls/i686/sse2/libKSC.so", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\34\5\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=46292, ...}) = 0
old_mmap(NULL, 49172, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
3, 0) = 0x405000
old_mmap(0x410000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa000) = 0x410000
close(3)                                = 0
open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=78961, ...}) = 0
mmap2(NULL, 78961, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7d29000
close(3)                                = 0
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) =
3
fstat64(3, {st_mode=S_IFREG|0644, st_size=78961, ...}) = 0
mmap2(NULL, 78961, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7d15000
close(3)                                = 0
write(2, "chroot: ", 8)                 = 8
write(2, "cannot run command `/usr/sbin/ht"..., 36) = 36
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=109642, ...}) = 0
mmap2(NULL, 109642, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7ce6000
close(3)                                = 0
write(2, ": \352\267\270\353\237\260 \355\214\214\354\235\274\354"...,
44) = 44
write(2, "\n", 1)                       = 1
exit_group(127)                         = ?
I moduli caricati sono i seguenti:
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
e php , ssl in conf.d/
Ogni suggerimento è ben accetto...
grazie
Matteo Memelli

 ottenere questo output con strace:
perche' ti sei scordato di copiare nella jail anche l'eseguibile di
apache :P
ciao,
--
oggei

[root@mOrDoR ~]# ls /chroot/httpd/usr/sbin/
httpd  httpd.worker  suexec
purtroppo l'eseguibile c'è! :(

 purtroppo l'eseguibile c'č! :(
strano perche' dallo strace non sembrerebbe... boh ? :)
ciao,
--
oggei