summaryrefslogtreecommitdiff
path: root/eg
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1994-10-17 23:00:00 +0000
committerLarry Wall <lwall@netlabs.com>1994-10-17 23:00:00 +0000
commita0d0e21ea6ea90a22318550944fe6cb09ae10cda (patch)
treefaca1018149b736b1142f487e44d1ff2de5cc1fa /eg
parent85e6fe838fb25b257a1b363debf8691c0992ef71 (diff)
downloadperl-a0d0e21ea6ea90a22318550944fe6cb09ae10cda.tar.gz
perl 5.000perl-5.000
[editor's note: this commit combines approximate 4 months of furious releases of Andy Dougherty and Larry Wall - see pod/perlhist.pod for details. Andy notes that; Alas neither my "Irwin AccuTrack" nor my DC 600A quarter-inch cartridge backup tapes from that era seem to be readable anymore. I guess 13 years exceeds the shelf life for that backup technology :-(. ]
Diffstat (limited to 'eg')
-rw-r--r--eg/relink9
-rwxr-xr-xeg/rename9
-rw-r--r--eg/unuc.pats138
-rwxr-xr-xeg/wrapsuid104
4 files changed, 104 insertions, 156 deletions
diff --git a/eg/relink b/eg/relink
index 8c2b4c5c5d..2c5793fbe7 100644
--- a/eg/relink
+++ b/eg/relink
@@ -5,15 +5,6 @@
# $RCSfile: relink,v $$Revision: 4.1 $$Date: 92/08/07 17:20:29 $
#
# $Log: relink,v $
-# Revision 4.1 92/08/07 17:20:29 lwall
-# Stage 6 Snapshot
-#
-# Revision 4.0 91/03/20 01:11:40 lwall
-# 4.0 baseline.
-#
-# Revision 3.0.1.2 90/08/09 03:17:44 lwall
-# patch19: added man page for relink and rename
-#
($op = shift) || die "Usage: relink perlexpr [filenames]\n";
if (!@ARGV) {
diff --git a/eg/rename b/eg/rename
index 0aedbb97ad..10e97f7d9d 100755
--- a/eg/rename
+++ b/eg/rename
@@ -5,15 +5,6 @@
# $RCSfile: rename,v $$Revision: 4.1 $$Date: 92/08/07 17:20:30 $
#
# $Log: rename,v $
-# Revision 4.1 92/08/07 17:20:30 lwall
-# Stage 6 Snapshot
-#
-# Revision 4.0 91/03/20 01:11:53 lwall
-# 4.0 baseline.
-#
-# Revision 3.0.1.2 90/08/09 03:17:57 lwall
-# patch19: added man page for relink and rename
-#
($op = shift) || die "Usage: rename perlexpr [filenames]\n";
if (!@ARGV) {
diff --git a/eg/unuc.pats b/eg/unuc.pats
deleted file mode 100644
index 6924dc6a0d..0000000000
--- a/eg/unuc.pats
+++ /dev/null
@@ -1,138 +0,0 @@
-A.M.
-Air Force
-Air Force Base
-Air Force Station
-American
-Apr.
-Ariane
-Aug.
-August
-Bureau of Labor Statistics
-CIT
-Caltech
-Cape Canaveral
-Challenger
-China
-Corporation
-Crippen
-Daily News in Brief
-Daniel Quayle
-Dec.
-Discovery
-Edwards
-Endeavour
-Feb.
-Ford Aerospace
-Fri.
-General Dynamics
-George Bush
-Headline News
-HOTOL
-I
-II
-III
-IV
-IX
-Institute of Technology
-JPL
-Jan.
-Jul.
-Jun.
-Kennedy Space Center
-LDEF
-Long Duration Exposure Facility
-Long March
-Mar.
-March
-Martin
-Martin Marietta
-Mercury
-Mon.
-in May
-s/\bmay (\d)/May $1/g;
-s/\boffice of (\w)/'Office of ' . (($tmp = $1) =~ y:a-z:A-Z:,$tmp)/eg;
-National Science Foundation
-NASA Select
-New Mexico
-Nov.
-OMB
-Oct.
-Office of Management and Budget
-President
-President Bush
-Richard Truly
-Rocketdyne
-Russian
-Russians
-Sat.
-Sep.
-Soviet
-Soviet Union
-Soviets
-Space Shuttle
-Sun.
-Thu.
-Tue.
-U.S.
-Union of Soviet Socialist Republics
-United States
-VI
-VII
-VIII
-Vice President
-Vice President Quayle
-Wed.
-White Sands
-Kaman Aerospace
-Aerospace Daily
-Aviation Week
-Space Technology
-Washington Post
-Los Angeles Times
-New York Times
-Aerospace Industries Association
-president of
-Johnson Space Center
-Space Services
-Inc.
-Co.
-Hughes Aircraft
-Company
-Orbital Sciences
-Swedish Space
-Arnauld
-Nicogosian
-Magellan
-Galileo
-Mir
-Jet Propulsion Laboratory
-University
-Department of Defense
-Orbital Science
-OMS
-United Press International
-United Press
-UPI
-Associated Press
-AP
-Cable News Network
-Cape York
-Zenit
-SYNCOM
-Eastern
-Western
-Test Range
-Jcsat
-Japanese Satellite Communications
-Defence Ministry
-Defense Ministry
-Skynet
-Fixed Service Structure
-Launch Processing System
-Asiasat
-Launch Control Center
-Earth
-CNES
-Glavkosmos
-Pacific
-Atlantic
diff --git a/eg/wrapsuid b/eg/wrapsuid
new file mode 100755
index 0000000000..3b1fc6e5b8
--- /dev/null
+++ b/eg/wrapsuid
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+'di';
+'ig00';
+#
+# $Header: wrapsuid,v 1.1 90/08/11 13:51:29 lwall Locked $
+#
+# $Log: wrapsuid,v $
+# Revision 1.1 90/08/11 13:51:29 lwall
+# Initial revision
+#
+
+$xdev = '-xdev' unless -d '/dev/iop';
+
+if ($#ARGV >= 0) {
+ @list = @ARGV;
+ foreach $name (@ARGV) {
+ die "You must use absolute pathnames.\n" unless $name =~ m|^/|;
+ }
+}
+else {
+ open(DF,"/etc/mount|") || die "Can't run /etc/mount";
+
+ while (<DF>) {
+ chop;
+ $_ .= <DF> if length($_) < 50;
+ @ary = split;
+ push(@list,$ary[2]) if ($ary[0] =~ m|^/dev|);
+ }
+}
+$fslist = join(' ',@list);
+
+die "Can't find local filesystems" unless $fslist;
+
+open(FIND,
+ "find $fslist $xdev -type f \\( -perm -04000 -o -perm -02000 \\) -print|");
+
+while (<FIND>) {
+ chop;
+ next unless -T;
+ print "Fixing ", $_, "\n";
+ ($dir,$file) = m|(.*)/(.*)|;
+ chdir $dir || die "Can't chdir to $dir";
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
+ $blksize,$blocks) = stat($file);
+ die "Can't stat $_" unless $ino;
+ chmod $mode & 01777, $file; # wipe out set[ug]id bits
+ rename($file,".$file");
+ open(C,">.tmp$$.c") || die "Can't write C program for $_";
+ $real = "$dir/.$file";
+ print C '
+main(argc,argv)
+int argc;
+char **argv;
+{
+ execv("' . $real . '",argv);
+}
+';
+ close C;
+ system '/bin/cc', ".tmp$$.c", '-o', $file;
+ die "Can't compile new $_" if $?;
+ chmod $mode, $file;
+ chown $uid, $gid, $file;
+ unlink ".tmp$$.c";
+ chdir '/';
+}
+##############################################################################
+
+ # These next few lines are legal in both Perl and nroff.
+
+.00; # finish .ig
+
+'di \" finish diversion--previous line must be blank
+.nr nl 0-1 \" fake up transition to first page again
+.nr % 0 \" start at page 1
+'; __END__ ############# From here on it's a standard manual page ############
+.TH SUIDSCRIPT 1 "July 30, 1990"
+.AT 3
+.SH NAME
+wrapsuid \- puts a compiled C wrapper around a setuid or setgid script
+.SH SYNOPSIS
+.B wrapsuid [dirlist]
+.SH DESCRIPTION
+.I Wrapsuid
+creates a small C program to execute a script with setuid or setgid privileges
+without having to set the setuid or setgid bit on the script, which is
+a security problem on many machines.
+Specify the list of directories or files that you wish to process.
+The names must be absolute pathnames.
+With no arguments it will attempt to process all the local directories
+for this machine.
+The scripts to be processed must have the setuid or setgid bit set.
+The wrapsuid program will delete the bits and set them on the wrapper.
+.PP
+Non-superusers may only process their own files.
+.SH ENVIRONMENT
+No environment variables are used.
+.SH FILES
+None.
+.SH AUTHOR
+Larry Wall
+.SH "SEE ALSO"
+.SH DIAGNOSTICS
+.SH BUGS
+.ex