|
|
1.1 root 1: #!/usr/bin/perl
2:
3: # written by jason steiner, [email protected], Jan 1993
4: #
5: # if you use or make improvements to this program i would appreciate
6: # copies of your modifications & your PGP public key.
7:
8: $|=1;
9: $topgp=0;
10: $logname = $ENV{'LOGNAME'};
11: $pager='/usr/local/bin/less -i -n -s -S -c -M';
12: $pager = $ENV{'PAGER'} if ($ENV{'PAGER'});
13: umask 077;
14: open (PAGER, "|$pager") || die "Cannot open pipe to $pager.\n";
15: print PAGER "\n";
16: while (<>) {
17: if (!$topgp && m/^-----BEGIN PGP .*-----/) {
18: $topgp = 1;
19: $tmpfile = "/tmp/.pgp.$logname.$$";
20: unlink($tmpfile);
21: open (TMPFILE, ">$tmpfile") || die "Cannot open $tmpfile for output.\n";
22: }
23: if (!$topgp) {
24: print PAGER;
25: } else {
26: print TMPFILE $_;
27: if (m/^-----END PGP .*-----/) {
28: $topgp = 0;
29: close TMPFILE;
30: open (CLEAR, "pgp -f < $tmpfile |") || die "Cannot open pipe to PGP.\n";
31: print PAGER "-----BEGIN PGP DECRYPTED BLOCK-----\n";
32: while (<CLEAR>) {
33: print PAGER;
34: }
35: close CLEAR;
36: unlink($tmpfile);
37: print PAGER "-----END PGP DECRYPTED BLOCK-----\n";
38: }
39: }
40: }
41: close PAGER;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.