Bug 10264 - chroot not working properly
chroot not working properly
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: wu-ftpd (Show other bugs)
6.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-03-20 11:14 EST by ray
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-04-07 16:12:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description ray 2000-03-20 11:14:40 EST
I am runnning RedHat 6.0 but I have upgraded wu-ftpd to 2.6.0-1.  I have
set up a guest account.  To troubleshoot problems with ls -l I moved the
~guest/bin/ls to ~guest/bin/ls_bak.  If, from the console, I do a
"chroot ~guest ls" I get "cannot execute ls: no such file or directory".

Yet from the client if I do an ls of the same directory I get a listing of
the contents that can be retrieved through "mget".  But I know the chroot
is occuring because I am unable to back out of the guest user's home
directory.
Comment 1 ray 2000-03-20 11:30:59 EST
#more ~guest/etc/passwd
root:*:0:0:::
bin:*:1:1:::
operator:*:11:0:::
nobody:*:99:99:::
guest:*:500:500::/home/guest/./:/bin/true

#more ~guest/etc/group
root::0:
bin::1:
daemon::2:
sys::3:
adm::4:
guest:x:500:

 #more shells
/bin/bash
/bin/sh
/bin/ash
/bin/bsh
/bin/tcsh
/bin/csh
/bin/true

#more /etc/passwd
guest:x:500:500::/home/guest/./:/bin/true

#more /etc/group
guest:x:500:

#ls -l ~guest
total 8112
d--x--x--x   2 root     root         1024 Mar 17 16:51 bin
-rw-rw-rw-   1 guest    guest        1654 Jan 18 16:24 boot.log
-rw-rw-rw-   1 guest    guest        2699 Feb 21 08:57 dmesg
d--x--x--x   2 root     root         1024 Feb 23 15:17 etc
drwxrwxrwx   2 guest    guest        1024 Mar 16 15:10 incoming
dr--r--r--   3 root     root         3072 Mar 13 16:33 lib
drwxr-x---   2 guest    guest        1024 Feb 28 14:23 outgoing
-rw-r--r--   1 guest    guest     6453292 Mar 16 11:50 phillips.zip
drwxrwxrwx   4 root     ftp          1024 Feb 21 08:21 pub

# ls -l ~guest/bin
total 343
---x--x--x   1 root     root        15204 Mar 21  1999 compress
---x--x--x   1 root     root        52388 Mar 21  1999 cpio
---x--x--x   1 root     root        50384 Mar 21  1999 gzip
-rwxr-xr-x   1 root     root        50148 Mar  2 11:19 ls_bak
---x--x--x   1 root     root        62660 Mar 21  1999 sh
---x--x--x   1 root     root       110668 Mar 21  1999 tar
lrwxrwxrwx   1 root     root            4 Jan 18 14:54 zcat -> gzip

# chroot ~guest ls
chroot: cannot execute ls: No such file or directory

NOW FROM CLIENT
230 User guest logged in.  Access restrictions apply.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
boot.log
dmesg
phillips.zip
ug15_step203_rs.tar.Z
226 Transfer complete.
54 bytes received in 0.15 seconds (0.36 Kbytes/sec)

ftp> ls -l
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
Comment 2 Bernhard Rosenkraenzer 2000-04-07 16:12:59 EDT
Starting with version 2.6.0, wu-ftpd (optionally) implements ls internally, so
you don't need the ls command in the chroot structure anymore.
If you don't like this behavior, recompile wu-ftpd with
./configure --disable-ls

Note You need to log in before you can comment on or make changes to this bug.