Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 7/7/83; site rlgvax.UUCP Path: utzoo!linus!philabs!seismo!rlgvax!guy From: guy@rlgvax.UUCP Newsgroups: net.unix-wizards Subject: Re: chroot() Message-ID: <811@rlgvax.UUCP> Date: Sun, 10-Jul-83 16:34:44 EDT Article-I.D.: rlgvax.811 Posted: Sun Jul 10 16:34:44 1983 Date-Received: Mon, 11-Jul-83 10:43:40 EDT References: <2849@sri-arpa.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 15 The fix to namei() is fairly simple (3-5 lines of code, depending on whether you format it the way Berkeley did or the way Bell did) and has been posted to net.unix-wizards and net.bugs.v7. A "pwd" in "/usr/guest" after chroot("/usr/guest") and chdir("/") prints "/" on 4.1BSD. The only significant difference between the 4.1BSD "pwd" command and the System III "pwd" command is that the 4.1BSD command does a stat("/") and saves the dev/inumber pair of "/", and it stops backing up the directory tree whenever it finds a directory with that dev/inumber pair. Both versions stop when they find a directory in which a chdir("..") leaves you in the same directory. I suspect the System III version will also print "/" after the chroot(). Guy Harris {seismo,mcnc,we13,brl-bmd,allegra}!rlgvax!guy