]> the.earth.li Git - autodns.git/blobdiff - autodns.pl
cscvs to tla changeset 9
[autodns.git] / autodns.pl
index cfa9510286d8bf178dda0fe4ad94d1933107fad8..8e1e20bbfc8c105119adb0422daf14be61031db8 100755 (executable)
@@ -1,11 +1,11 @@
 #!/usr/bin/perl -Tw
-# autodns 0.0.7
-# Copyright 1999-2004 Project Purple. Written by Jonathan McDowell
+# autodns 0.0.8
+# Copyright 1999-2005 Project Purple. Written by Jonathan McDowell
 # See ACKNOWLEDGEMENTS file for full details of contributors.
 # http://www.earth.li/projectpurple/progs/autodns.html
 # Released under the GPL.
 #
-# $Id: autodns.pl,v 1.7 2005/04/08 11:45:12 noodles Exp $
+# $Id: autodns.pl,v 1.9 2005/04/13 17:24:40 noodles Exp $
 #
 
 use strict;
@@ -21,7 +21,7 @@ my ($user, $server, $inprocess, $delcount, $addcount, $reload_command);
 my ($domain, @MAIL, @GPGERROR, @COMMANDS, %zones);
 my ($me, $ccreply, $conffile, $domainlistroot, @cfgfiles, $VERSION);
 
-$VERSION="0.0.7";
+$VERSION="0.0.8";
 
 #
 # Load our config
@@ -230,7 +230,8 @@ if ($entity->parts) {
        }
 
        if ($got_sig && $got_text) {
-               open3(\*GPGIN, \*GPGOUT, \*GPGERR, "gpg --batch --verify ".
+               my $pid = open3(\*GPGIN, \*GPGOUT, \*GPGERR,
+                       "gpg --batch --verify ".
                        $sig_name." ".$text_name);
 
                close GPGIN;
@@ -239,6 +240,7 @@ if ($entity->parts) {
                my @GPGOUTPUT=<GPGOUT>;
                close GPGERR;
                close GPGOUT;
+               waitpid $pid, 0;
 
                unlink($text_name);
                unlink($sig_name);
@@ -246,7 +248,7 @@ if ($entity->parts) {
 } else {
        # Clear text.
 
-       open3(\*GPGIN, \*GPGOUT, \*GPGERR, "gpg --batch");
+       my $pid = open3(\*GPGIN, \*GPGOUT, \*GPGERR, "gpg --batch");
 
        # Feed it the mail.
        print GPGIN @MAIL;
@@ -257,6 +259,7 @@ if ($entity->parts) {
        @COMMANDS=<GPGOUT>;
        close GPGERR;
        close GPGOUT;
+       waitpid $pid, 0;
 }
 
 # Check who it's from and if the signature was a good one.