chiark / gitweb /
debian/: groupmanage: Prep for move (nfc)
[userv-utils.git] / dyndns / service
index 37bf62374d82920c5225e41c03bafb10f6da62d9..031931bc1737624a1cf52e7c31bb46e5e54be632 100755 (executable)
@@ -7,12 +7,31 @@
 #    to <subdomain>.<zone>, and so must not have a trailing `.';
 #    where the owner is to be <subdomain>.<zone>, `@' must be used.
 
+# Copyright 1996-2013 Ian Jackson <ijackson@chiark.greenend.org.uk>
+# Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk>
+# Copyright 1999,2003
+#    Chancellor Masters and Scholars of the University of Cambridge
+# Copyright 2010 Tony Finch <fanf@dotat.at>
+#
+# This is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with userv-utils; if not, see http://www.gnu.org/licenses/.
+
 use POSIX;
 
 BEGIN {
     $vardir= "/var/lib/userv/dyndns";
     $defconf= "/etc/userv/dyndns-domains";
-    $libdir= "/usr/local/lib/userv/dyndns";
+    $libdir= "/usr/share/userv/dyndns";
 }
 END {
     remove "$vardir/tmp/$$" or $! == ENOENT or
@@ -22,6 +41,7 @@ END {
 use FileHandle;
 use IO::File;
 use Socket;
+use Socket6;
 
 @ARGV==2 or die "need <zone> and <domain> arguments\n";
 ($zone,$subdomain) = @ARGV;
@@ -121,6 +141,10 @@ for (;;) {
        defined($addr= inet_aton $_) or
            die "input:$.:$owner:invalid IP address\n";
        $data= inet_ntoa($addr);
+    } elsif ($type eq 'AAAA') {
+       defined($addr= inet_pton(AF_INET6, $_)) or
+           die "input:$.:$owner:invalid IPv6 address\n";
+       $data = inet_ntop(AF_INET6, $addr);
     } elsif ($type eq 'CNAME') {
        $data= domainsyntax_rel("input:$.:$owner:canonical name",$_).".";
     } elsif ($type eq 'MX') {