Since perl 503 set close-on-exec on pipe() call, turn it back
This commit is contained in:
parent
f3bb3ed744
commit
39578c8f2d
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=18835
@ -1,5 +1,14 @@
|
||||
--- premail.orig Sat Oct 25 02:19:07 1997
|
||||
+++ premail Wed Jan 13 14:49:50 1999
|
||||
+++ premail Mon May 17 03:07:52 1999
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# premail, an e-mail privacy package
|
||||
#
|
||||
-
|
||||
+use Fcntl;
|
||||
$version = '0.46';
|
||||
|
||||
# Copyright 1996,1997 Raph Levien <raph@acm.org>
|
||||
@@ -85,8 +85,11 @@
|
||||
|
||||
$config{'rlist-valid'} = 300;
|
||||
@ -335,7 +344,15 @@
|
||||
$invoc .= ' '.$pgp_file;
|
||||
$invoc .= ' '.$signed_file;
|
||||
$invoc .= ' > '.$errfile.' 2>&1';
|
||||
@@ -3390,7 +3428,7 @@
|
||||
@@ -3344,6 +3382,7 @@
|
||||
$ENV{'TMP'} = $pgp_tmpdir;
|
||||
if ($pass) {
|
||||
pipe (READER, WRITER);
|
||||
+ fcntl (READER, F_SETFD, 0);
|
||||
$ENV{'PGPPASSFD'} = fileno(READER);
|
||||
}
|
||||
$status = open (PGP, $invoc);
|
||||
@@ -3390,7 +3429,7 @@
|
||||
$chars_needed = 2 + sprintf ("%d", $bits / 8);
|
||||
&pdv ($config{'pgp'}." +makerandom=$chars_needed $outf"
|
||||
." >/dev/null 2>&1\n");
|
||||
@ -344,7 +361,15 @@
|
||||
." >/dev/null 2>&1";
|
||||
&pdv ($status."\n");
|
||||
if (!$status) {
|
||||
@@ -3626,11 +3664,14 @@
|
||||
@@ -3592,6 +3631,7 @@
|
||||
if ($x) {
|
||||
if ($ENV{'DISPLAY'}) {
|
||||
pipe (READER, WRITER);
|
||||
+ fcntl (WRITER, F_SETFD, 0);
|
||||
system 'xterm -geometry 42x4-5-5 -e perl -e \''
|
||||
.'system "stty -echo";print "\n";'
|
||||
.'print " Remember to logout when done.\n";'
|
||||
@@ -3626,11 +3666,14 @@
|
||||
|
||||
$errfile = &tmp_filename ();
|
||||
$invoc = &tilde_expand ($config{'pgp'});
|
||||
@ -360,7 +385,7 @@
|
||||
$status = &open_pgp ($invoc, $pass, '');
|
||||
$err = &read_and_delete ($errfile);
|
||||
&pdv ($err);
|
||||
@@ -3647,7 +3688,7 @@
|
||||
@@ -3647,7 +3690,7 @@
|
||||
unlink $ps_pgp;
|
||||
}
|
||||
$invoc = &tilde_expand ($config{'pgp'});
|
||||
@ -369,7 +394,7 @@
|
||||
$invoc .= ' < '.$ps;
|
||||
$invoc .= ' > '.$ps_pgp;
|
||||
$invoc .= ' 2> '.$errfile;
|
||||
@@ -3910,7 +3951,8 @@
|
||||
@@ -3910,7 +3953,8 @@
|
||||
&replace_field ('Content-Type: text/plain; charset='
|
||||
.$config{'charset'}."\n",
|
||||
@deliver_headers);
|
||||
@ -379,7 +404,7 @@
|
||||
# Should we detect other charsets which are supersets of us-ascii?
|
||||
if (!$mv_present) {
|
||||
push (@deliver_headers, 'MIME-Version: 1.0'."\n");
|
||||
@@ -3923,7 +3965,8 @@
|
||||
@@ -3923,7 +3967,8 @@
|
||||
}
|
||||
}
|
||||
# must deal with existing cte, charset, etc.
|
||||
@ -389,7 +414,7 @@
|
||||
# Do the QP
|
||||
&pdv ("Doing QP encoding!\n");
|
||||
if (!$mv_present) {
|
||||
@@ -4336,6 +4379,8 @@
|
||||
@@ -4336,6 +4381,8 @@
|
||||
exit 0;
|
||||
}
|
||||
|
||||
@ -398,7 +423,7 @@
|
||||
sub decode_msg {
|
||||
# &decode_msg ($msg)
|
||||
# This is possibly the ugliest function in all of premail. Most of it is
|
||||
@@ -5129,7 +5174,7 @@
|
||||
@@ -5129,7 +5176,7 @@
|
||||
&load_secrets ();
|
||||
foreach (keys %pgpring) {
|
||||
my ($tpr, $tsr) = &makerings ($pgpring{$_});
|
||||
@ -407,7 +432,7 @@
|
||||
#filecat ($tpr, $pr);
|
||||
filecat ($tsr, $sr);
|
||||
&delete_tmpfile ($tpr);
|
||||
@@ -5157,12 +5202,12 @@
|
||||
@@ -5157,12 +5204,12 @@
|
||||
# &pdv ('&makerings ("'.join ('", "', @_)."\")\n");
|
||||
foreach ([$pr, $pk], [$sr, $sk]) {
|
||||
open TMP, ">$$_[0]";
|
||||
@ -422,7 +447,7 @@
|
||||
. "$id $pr $pubring 2>&1";
|
||||
&pdv ("$invoc > /dev/null\n");
|
||||
system "$invoc > /dev/null";
|
||||
@@ -5189,7 +5234,7 @@
|
||||
@@ -5189,7 +5236,7 @@
|
||||
$outfile = &tmp_filename ();
|
||||
$errfile = &tmp_filename ();
|
||||
$invoc = &tilde_expand ($config{'pgp'});
|
||||
@ -431,7 +456,7 @@
|
||||
$invoc .= " +pubring=$pr +secring=$sr ";
|
||||
$invoc .= $cmd;
|
||||
$invoc .= ' < ' . $infile if $infile;
|
||||
@@ -5248,7 +5293,7 @@
|
||||
@@ -5248,7 +5295,7 @@
|
||||
EOF
|
||||
<STDIN>;
|
||||
|
||||
@ -440,7 +465,7 @@
|
||||
print STDERR "\nKey generation failed.\n";
|
||||
&killbaks ($pr, $sr);
|
||||
&delete_open_tmpfiles ();
|
||||
@@ -5272,7 +5317,7 @@
|
||||
@@ -5272,7 +5319,7 @@
|
||||
foreach $a ("$kid $pr",
|
||||
"$remid $pr " . &tilde_expand ($config{'pubring'}),
|
||||
"$kid $sr $defsr") {
|
||||
@ -449,7 +474,7 @@
|
||||
# print STDERR "+ $invoc\n";
|
||||
my $result = `$invoc`;
|
||||
unless ($result =~ /^Key extracted/m) {
|
||||
@@ -5300,7 +5345,7 @@
|
||||
@@ -5300,7 +5347,7 @@
|
||||
EOF
|
||||
<STDIN>;
|
||||
|
||||
@ -458,7 +483,7 @@
|
||||
# print STDERR "+ $invoc\n";
|
||||
if (system ($invoc)) {
|
||||
print STDERR "Edit failed.\n";
|
||||
@@ -5495,6 +5540,7 @@
|
||||
@@ -5495,6 +5542,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -466,7 +491,7 @@
|
||||
if ($#args >= 1) {
|
||||
$to = $args[1];
|
||||
} elsif ($#args < 0) {
|
||||
@@ -5609,7 +5655,6 @@
|
||||
@@ -5609,7 +5657,6 @@
|
||||
$fullname = &query ('Full name of pseudonym (not just '
|
||||
. 'E-mail address)', $fullname);
|
||||
$fullname =~ s/[\'\^\n]//g; # kludge for secrets file
|
||||
@ -474,7 +499,7 @@
|
||||
$signsend = &query ('Sign mail with (R)emailer key, '
|
||||
. '(P)seudonym key or (N)o key?',
|
||||
$signsend);
|
||||
@@ -5652,7 +5697,7 @@
|
||||
@@ -5652,7 +5699,7 @@
|
||||
}
|
||||
# print "Here's the encrypted block:\n";
|
||||
# system "cat $replyblock_fn";
|
||||
@ -483,7 +508,7 @@
|
||||
if (&member ('newnym', @options)) {
|
||||
$secret = "\$nym\{\'$time\,$remailer\=$nym\'\} \= ".
|
||||
"\'chain=$chain\^to=$to^"
|
||||
@@ -5771,6 +5816,7 @@
|
||||
@@ -5771,6 +5818,7 @@
|
||||
if (!open (IN, $body)) {
|
||||
&error ("Internal error opening replyblock\n");
|
||||
}
|
||||
@ -491,7 +516,7 @@
|
||||
@in_headers = ("To: $to\n");
|
||||
push (@in_headers, "Chain: $chain\n") if $chain;
|
||||
$header_sep = "\n";
|
||||
@@ -5784,6 +5830,7 @@
|
||||
@@ -5784,6 +5832,7 @@
|
||||
}
|
||||
&send_group ($groups[0]);
|
||||
close (IN);
|
||||
@ -499,7 +524,7 @@
|
||||
}
|
||||
|
||||
sub find_nym {
|
||||
@@ -5997,7 +6044,7 @@
|
||||
@@ -5997,7 +6046,7 @@
|
||||
|
||||
# The main loop
|
||||
$quit = 0;
|
||||
@ -508,7 +533,7 @@
|
||||
while (!$quit) {
|
||||
$rin = $win = $ein = '';
|
||||
vec ($rin, fileno(STDIN), 1) = 1 unless $ineof;
|
||||
@@ -6315,7 +6362,7 @@
|
||||
@@ -6315,7 +6364,7 @@
|
||||
# Open a Web connection for the file as file handle WWW.
|
||||
my ($url) = @_;
|
||||
my ($host, $port, $suf);
|
||||
@ -517,7 +542,7 @@
|
||||
my ($name, $proto);
|
||||
my ($that);
|
||||
my ($savesel, $gotsep);
|
||||
@@ -6330,7 +6377,7 @@
|
||||
@@ -6330,7 +6379,7 @@
|
||||
$host = $1;
|
||||
$port = $2;
|
||||
$suf = $3;
|
||||
@ -526,7 +551,7 @@
|
||||
else { $port = 80; }
|
||||
($fqdn, $aliases, $type, $len, $thataddr) = gethostbyname ($host);
|
||||
return &pdv ("Host not found: $host\n") if ($thataddr eq '');
|
||||
@@ -6345,7 +6392,7 @@
|
||||
@@ -6345,7 +6394,7 @@
|
||||
unpack ('C4', $thataddr), $port));
|
||||
eval {
|
||||
$SIG{'ALRM'} = sub { die "Timeout error on $url\n" };
|
||||
@ -535,7 +560,7 @@
|
||||
# bind(WWW, $this) || &die_disarm ("bind: $!\n");
|
||||
# &pdv ("bound the socket...\n");
|
||||
connect(WWW, $that) || &die_disarm ("connect: $!\n");
|
||||
@@ -6368,6 +6415,21 @@
|
||||
@@ -6368,6 +6417,21 @@
|
||||
};
|
||||
if ($@) { return &pdv ($@); }
|
||||
return &pdv ("No response from server\n") unless $gotsep;
|
||||
|
Loading…
Reference in New Issue
Block a user