[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] chroot()



Guido Flohr <gufl0000@stud.uni-sb.de> writes:

> On Thu, Mar 09, 2000 at 11:04:58PM +0100, Tomas Berndtsson wrote:
> > Frank Naumann <fnaumann@cs.uni-magdeburg.de> writes:
> > 
> > > > As far as I could tell, chroot() isn't supported by MiNT, right?
> > > 
> > > Implemented since 1.15.3 beta.
> > 
> > Oh, there you go. But there was no wrapper for a chroot() in mintlib,
> > it seems. Only a prototype for Pchroot().
> 
> In the last MiNTLib, chroot was still work in progress.  It has now been
> renamed to Dchroot.  Anyway, here is what you need:
> 
> <mintbind.h>
> ...
> #define Dchroot(dir) trap_1_wl (0x14a, (long) dir)

Ok, I put chroot into mintlib 0.53, and it compiles well. However,
there seems to be a problem when using it and absolute paths. I'm
using FreeMiNT 1.15.6b, so I'm sorry if this has been fixed in
1.15.7b.

Anyway, I compiled the shellutil chroot, to test, and this is what
happens:

bash# ./chroot /h bash       [1]
bash# cd /bin
bash# ls
bash: ls: command not found
bash# ./ls
bash  ls    sh
bash# cd /
bash# pwd
/
bash# /bin/ls                [2]
bash: /bin/ls: path not found
bash# bin/ls                 [3]
bin         dev         home       lost+found  root         tmp          var
boot        etc         lib        mnt         sbin         usr

[1] my /h/ is a root-like tree, which is seen in [3].
I have /bin in the PATH, but as seen in [2], it can't even find my ls
when I write the full path on the command line. If I write any
relative path, as in [3], it works just fine.

Ideas, anyone? Am I missing something?


Greetings,

Tomas