Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!bloom-beacon!eru!luth!sunic!mcsun!unido!marco!leo From: leo@marco.UUCP (Matthias Pfaller) Newsgroups: comp.os.minix Subject: bug in chroot(2)? Message-ID: <441@alice.marco.UUCP> Date: 27 Jul 90 09:24:51 GMT Organization: marco GmbH, 8047 Karlsfeld, West-Germany Lines: 22 Yesterday I tried to use chroot(2). my program looked like this main() { chroot("/mnt"); execl("/bin/sh", "sh", (char *)0); } The program worked, and I had a sh with a changed root-directory. but: 1. I could do a "cd /; cd .." and I was in the former root-directory is this behaviour correct? 2. The shell could no longer find commands. For example I could do 'ls -l /bin/ls' and ls is found and displays /bin/ls. The displayed ls is that from /mnt/bin/ls, but the loaded one is that from the former /bin/ls. If I tried to start a program from /usr/bin (actually /mnt/usr/bin) the exec failed. I think the problem is, that mm only changes to the exec'ing process workingdirectory, but does not also change it's rootdirectory. Has anyone fixed this allready? Matthias Pfaller (leo@verw.marco.de)