Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Feb 1996 19:04:02 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        julian@TFS.COM (Julian Elischer)
Cc:        phk@critter.tfs.com, julian@TFS.COM, hackers@FreeBSD.ORG
Subject:   Re: CHROOT changes to login.
Message-ID:  <199602090204.TAA09246@phaeton.artisoft.com>
In-Reply-To: <m0tkgLY-0003xJC@TFS.COM> from "Julian Elischer" at Feb 8, 96 04:05:51 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> not a bad idea, but if you ever type your name wrong, you've had it..
> you'll be redirected to the chroot area.. And the nature if that is that you
> can't get back. Actually I DO have a way of doing this I think 
> chroot("../../../../../../..");
> should chroot you back to /, as at
> this time the CWD has not been changed yet..

Open the "/" dir and use fchdir on the fd.  Then chroot( ".") (relative).

Actually, there are some bogons in the vfs_lookup code relative to
the chrooted directory.  The namei really wants a relative root in
the structure instead of pulling the thing from the proc structure
directly.  Specifically, if you lookup a / path for a traversed
mountpoint from /... it's grungy code.

But the above should work, for now at least.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602090204.TAA09246>