TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:11090] 'Static binaries' or 'Guest accounts'



On Sun, 12 Dec 1999, Christopher Reid Palmer wrote:

 
> Remember the good old days when basic utils were statically linked? No, me
> niether.
> 
> You wouldn't want to put the libs in /lib, you'd want to put them in a
> place that 'ftpd' can see them from when 'chroot'ed. Guessing.
 
Actually, they are.  Under the root directory of the server
(/vweb/<domain>/ftp) I have a this:

d--x--x--x   2 root     daemon       1024 Dec 12 13:41 bin
d--x--x--x   2 root     daemon       1024 Jun  2  1999 etc
d--x--x--x   2 root     daemon       1024 Dec 12 13:42 lib
drwxrwxr-x   2 aerosim  ftp          1024 Dec 10 00:28 pub

If I switch in to the bin directory and run 'ldd ./ls' I get this:

        libc.so.6 => /lib/libc.so.6 (0x40002000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)

So I copied libc.so.6 and ld-linux.so.2 into <ftproot>/lib.  I have
verified that this SHOULD work by running:

/usr/sbin/chroot <ftproot> /bin/ls

and the ls command executes.  If I remove the libraries I put in
<ftproot>/lib, the ls command does NOT execute.  So it's definitely using
those libraries as opposed to the general system libraries.

As it stands right now, if I ftp into the server, the chroot executes but
I can't actually perform an 'ls' command.  No error messages... Just no
results.

Ben


-- 
"There is no spoon"
	-- The Matrix