ldd doesn't always return in lib => lib format
Brought to you by:
assman
This is what ldd returns for ls on a linux box using
glibc version
GNU C Library 20041102 release version 2.3.4.
linux-gate.so.1 => (0xffffe000)
librt.so.1 => /lib/librt.so.1 (0xb7fc8000)
libncurses.so.5 => /lib/libncurses.so.5
(0xb7f87000)
libacl.so.1 => /lib/libacl.so.1 (0xb7f80000)
libc.so.6 => /lib/libc.so.6 (0xb7e66000)
libpthread.so.0 => /lib/libpthread.so.0
(0xb7e53000)
/lib/ld-linux.so.2 (0xb7feb000)
libattr.so.1 => /lib/libattr.so.1 (0xb7e4f000)
the problem is that the /lib/ld-linux.so.2 is not in
the format required by the parsing function, so this
file is not copied to the chroot environment.
Logged In: YES
user_id=343119
The output of ldd keeps changing, with Fedora Core 4 I get:
# ldd /usr/bin/getent
linux-gate.so.1 => (0x00111000)
libc.so.6 => /lib/libc.so.6 (0x00ab9000)
/lib/ld-linux.so.2 (0x00a9b000)
(Failure of getent to find it's shared libraries causes jail
iteself to fail when getent is issued after chrooting.)
I have patched lib/atch/generic/funstions as follows:
# diff lib/arch/generic/functions my/functions
682,685c682,686
< if ($line =~ /(.+)=>(.+)/) {
< local $b = zip_spaces($2);
< local @tmp = split(/ /,$b);
< $b = $tmp[1];
---
>
> if ($line =~ /(.+) \(0x.+/) { # check for (0x...
> local $b = $1; # throw away '(0x.+$'
> $b =~ s/.+=>(.+)/$1/; # throw away '^.+=>'
> $b =~ s/\s+//g; # throw away spaces
Douglas Laing, Johannesburg