File:  [PGP] / pgp / contrib / elm_nn / morepgp
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:39:03 2018 UTC (8 years, 1 month ago) by root
Branches: phill, MAIN
CVS tags: pgp23a, pgp22, HEAD
PGP 2.2

#!/usr/bin/perl

# written by jason steiner, [email protected], Jan 1993
#
# if you use or make improvements to this program i would appreciate
# copies of your modifications & your PGP public key.

$|=1;
$topgp=0;
$logname = $ENV{'LOGNAME'};
$pager='/usr/local/bin/less -i -n -s -S -c -M';
$pager = $ENV{'PAGER'} if ($ENV{'PAGER'});
umask 077;
open (PAGER, "|$pager") || die "Cannot open pipe to $pager.\n";
print PAGER "\n";
while (<>) {
	if (!$topgp && m/^-----BEGIN PGP .*-----/) {
		$topgp = 1;
		$tmpfile = "/tmp/.pgp.$logname.$$";
		unlink($tmpfile);
		open (TMPFILE, ">$tmpfile") || die "Cannot open $tmpfile for output.\n";
	}
	if (!$topgp) {
		print PAGER;
	} else {
		print TMPFILE $_;
		if (m/^-----END PGP .*-----/) {
			$topgp = 0;
			close TMPFILE;
			open (CLEAR, "pgp -f < $tmpfile |") || die "Cannot open pipe to PGP.\n";
			print PAGER "-----BEGIN PGP DECRYPTED BLOCK-----\n";
			while (<CLEAR>) {
				print PAGER;
			}
			close CLEAR;
			unlink($tmpfile);
			print PAGER "-----END PGP DECRYPTED BLOCK-----\n";
		}
	}
}
close PAGER;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.