Scott Howard wrote:
>
> On Thu, Mar 29, 2001 at 04:07:51PM +1000, Matthew Dalton wrote:
I didn't, actually. I was forwarding a message I received via the
debian-user mailing list. That information was in my original post.
> > Because root can break out of a chroot().
>
> Yes, but _only_ root can break out of it, which is why it still has
> it's uses.
The question I was answering was "How can root break out of a chroot?".
> > mkdir( MY_JAIL_PATH "/escape" ); /* did I mention I love ANSI C's
> > string concatenation? */
> > chroot( MY_JAIL_PATH "/escape" );
>
> I'd say you like C's string concatenations just a little too much...
>
> This should read :
> mkdir( "/escape" );
> chroot( "/escape" );
I don't personally have an opinion about C's string concatenation. You
may be correct about the code though.
> > /* let's go up a bit.... */
> >
> > chdir ("../../../../../../../../../.." ); /* should be plenty, if not
> > we can just repeat it... */
> > chroot ( "." );
>
> chroot("../../../../../../"); will have the same result (well, it will
> give you a different pwd, but thats all)
I'm sure that TMTOWTDI.
Matthew
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug