[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] chroot()
- To: mint@fishpool.com (MiNT mailing list)
- Subject: Re: [MiNT] chroot()
- From: Tomas Berndtsson <tomas@nocrew.org>
- Date: 10 Apr 2000 18:56:50 +0200
- In-reply-to: Guido Flohr's message of "Fri, 10 Mar 2000 02:35:07 +0100"
- References: <Pine.MNT.4.10.10003092222370.113-100000@FreeMiNT.st.uni-magdeburg.de> <80put3ol4l.fsf@junk.nocrew.org> <20000310023506.E520@wowee>
- Sender: owner-mint@fishpool.com
- User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5
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