Perl version of chroot (was Re: [comp.sys.tahoe] Re: Need "chroot(8)" Sources)

Randal Schwartz merlyn at iwarp.intel.com
Wed Feb 7 09:55:17 AEST 1990


In article <10783 at stag.math.lsa.umich.edu>, bostic at 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 at math.lsa.umich.edu 
| (Edward Vielmetti).]
| 
| 
| In article <1990Jan22.172627.16417 at uncecs.edu>, khj at 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 at iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/



More information about the Alt.sources mailing list