Bug 24458 - chroot don't change root directory ?
Summary: chroot don't change root directory ?
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: sh-utils
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: bero
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-01-20 17:28 UTC by Laurent
Modified: 2007-04-18 16:30 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2001-01-20 17:28:59 UTC


Attachments (Terms of Use)

Description Laurent 2001-01-20 17:28:56 UTC
Here is an example of what I do:
# cd /some/where
# cp /bin/bash bin/
# ls -l bin/
# -rwxr-xr-x    1 root     root       512540 jan 20 16:41 bash
# chroot /some/where
# chroot: cannot execute /bin/bash: No such file or directory
#whoami
root

I don't understand, /bin/bash exist and is executable,
with FreeBSD I do that without a problem

Comment 1 Bernhard Rosenkraenzer 2001-01-20 17:50:41 UTC
This is almost certainly a user mistake:
Our shell is linked dynamically.
Make sure /lib/ld-linux.so.2, /lib/libc.so.6, /lib/libdl.so.2 and
/lib/libtermcap.so.2
are in the chroot structure. Without them, bash can't be executed.

Alternatively, recompile bash with the "-static" CFLAG. This is what the BSDs do
to their shells.



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