#!/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.10 2005/05/16 17:24:10 noodles Exp $
#
use strict;
my ($domain, @MAIL, @GPGERROR, @COMMANDS, %zones);
my ($me, $ccreply, $conffile, $domainlistroot, @cfgfiles, $VERSION);
-$VERSION="0.0.7";
+$VERSION="0.0.8";
#
# Load our config
}
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;
my @GPGOUTPUT=<GPGOUT>;
close GPGERR;
close GPGOUT;
+ waitpid $pid, 0;
unlink($text_name);
unlink($sig_name);
} else {
# Clear text.
- open3(\*GPGIN, \*GPGOUT, \*GPGERR, "gpg --batch");
+ my $pid = open3(\*GPGIN, \*GPGOUT, \*GPGERR, "gpg --batch");
# Feed it the mail.
print GPGIN @MAIL;
@COMMANDS=<GPGOUT>;
close GPGERR;
close GPGOUT;
+ waitpid $pid, 0;
}
# Check who it's from and if the signature was a good one.
} else {
print REPLY "Couldn't open $domainlistroot$user: $!\n";
}
+ } elsif ($inprocess && /^MASTER\s(.*)$/) {
+ if (($priv & 1) != 1) {
+ print REPLY "You're not authorised to use the MASTER ",
+ "command.\n";
+ } elsif ($1 =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/) {
+ $server = $1;
+ print REPLY "Set master IP address to $1\n";
+ } else {
+ print REPLY "$1 doesn't look like a valid IPv4 ",
+ "address to me.\n";
+ }
} elsif ($inprocess && /^HELP$/) {
print REPLY "In order to use the service, you will need to send GPG signed\n";
print REPLY "messages.\n\n";