chroot()

guy at rlgvax.UUCP guy at rlgvax.UUCP
Mon Jul 11 06:34:44 AEST 1983


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



More information about the Comp.unix.wizards mailing list