[alt.sources] Perl version of chroot

merlyn@iwarp.intel.com (Randal Schwartz) (02/07/90)

In article <10783@stag.math.lsa.umich.edu>, bostic@ucbvax (Keith Bostic) writes:
| 
| [This is an experimental alt.sources re-posting from the newsgroup(s)
| comp.sys.tahoe. Comments on this service to emv@math.lsa.umich.edu 
| (Edward Vielmetti).]
| 
| 
| In article <1990Jan22.172627.16417@uncecs.edu>, khj@uncecs.edu (Kenneth H. Jacker) writes:
| > I have looked through the entire /tahoe/* tree, as well as the archives
| > on uunet and ucbvax, but still have been unable to locate machine
| > readable copies of
| > 
| > 	Makefile, chroot.8, chroot.c, pathnames.h and strerror.c
| 
| Here's chroot and strerror.c.
| 
| --keith
[source deleted]

Here's the Perl version:

#!/usr/bin/perl
die "Missing new root" unless $#ARGV > -1;
$newroot = shift;
@ARGV = ($ENV{'SHELL'} || '/bin/sh') unless $#ARGV > -1;
chroot $newroot || die "Cannot chroot $newroot ($!)";
exec @ARGV || die "Cannot exec @ARGV ($!)";

Just another Perl hacker,
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III      |
| merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/