Hello community,
here is the log from the commit of package ddclient for openSUSE:Factory checked in at 2012-01-17 11:32:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ddclient (Old)
and /work/SRC/openSUSE:Factory/.ddclient.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ddclient", Maintainer is "ro@suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ddclient/ddclient.changes 2011-10-21 16:28:11.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ddclient.new/ddclient.changes 2012-01-17 16:04:57.000000000 +0100
@@ -1,0 +2,11 @@
+Mon Jan 9 15:25:09 UTC 2012 - chris@computersalat.de
+
+- update to 3.8.1
+ * Fixing #28: FreeDNS.afraid.org changed api slightly
+ * Added dtdns-support
+ * Added support for longer password
+ * Added cisco-asa patch
+ * Added support for LoopiaDNS
+- rebase patches
+
+-------------------------------------------------------------------
Old:
----
ddclient-3.8.0-config.patch
ddclient-3.8.0-update_nic.patch
ddclient-3.8.0.tar.bz2
New:
----
ddclient-3.8.1-config.patch
ddclient-3.8.1-update_nic.patch
ddclient-3.8.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ddclient.spec ++++++
--- /var/tmp/diff_new_pack.YfefcZ/_old 2012-01-17 16:04:58.000000000 +0100
+++ /var/tmp/diff_new_pack.YfefcZ/_new 2012-01-17 16:04:58.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ddclient
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,19 +16,18 @@
#
-
Name: ddclient
Summary: A Perl Client to Update Dynamic DNS Entries
-Version: 3.8.0
-Release: 15
License: GPL-2.0+
Group: Productivity/Networking/DNS/Utilities
+Version: 3.8.1
+Release: 0
Url: http://ddclient.sourceforge.net/
Source0: http://switch.dl.sourceforge.net/sourceforge/ddclient/%{name}-%{version}.tar.bz2
Source1: rc.ddclient
Source2: %{name}.sysconfig
-Patch0: %{name}-3.8.0-config.patch
-Patch1: %{name}-3.8.0-update_nic.patch
+Patch0: %{name}-3.8.1-config.patch
+Patch1: %{name}-3.8.1-update_nic.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %fillup_prereq
Requires: perl >= 5.004
@@ -48,8 +47,8 @@
%prep
%setup
-%patch0 -p1
-%patch1 -p1
+%patch0
+%patch1
rm -f sample-etc_ddclient.conf.orig
chmod a-x sample-etc*
mkdir examples
++++++ ddclient-3.8.0-config.patch -> ddclient-3.8.1-config.patch ++++++
--- /work/SRC/openSUSE:Factory/ddclient/ddclient-3.8.0-config.patch 2011-09-23 01:54:54.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ddclient.new/ddclient-3.8.1-config.patch 2012-01-17 16:04:57.000000000 +0100
@@ -1,18 +1,7 @@
-diff -ruN ddclient-3.8.0-orig/ddclient ddclient-3.8.0/ddclient
---- ddclient-3.8.0-orig/ddclient 2009-01-27 19:14:02.000000000 +0000
-+++ ddclient-3.8.0/ddclient 2009-04-29 21:37:27.690282779 +0000
-@@ -27,7 +27,7 @@
- $program =~ s/d$//;
- my $now = time;
- my $hostname = hostname();
--my $etc = ($program =~ /test/i) ? './' : '/etc/ddclient/';
-+my $etc = ($program =~ /test/i) ? './' : '/etc/';
- my $cachedir = ($program =~ /test/i) ? './' : '/var/cache/ddclient/';
- my $savedir = ($program =~ /test/i) ? 'URL/' : '/tmp/';
- my $msgs = '';
-diff -ruN ddclient-3.8.0-orig/sample-etc_ddclient.conf ddclient-3.8.0/sample-etc_ddclient.conf
---- ddclient-3.8.0-orig/sample-etc_ddclient.conf 2008-11-19 20:20:34.000000000 +0000
-+++ ddclient-3.8.0/sample-etc_ddclient.conf 2009-04-30 14:14:47.793725557 +0000
+Index: sample-etc_ddclient.conf
+===================================================================
+--- sample-etc_ddclient.conf.orig
++++ sample-etc_ddclient.conf
@@ -18,12 +18,16 @@
## are mentioned here.
##
@@ -32,8 +21,8 @@
# ssl-library
# postscript=script # run script after updating. The
# new IP is added as argument.
-@@ -52,10 +56,17 @@
- ## To obtain an IP address from Web status page (using the proxy if defined)
+@@ -56,10 +60,17 @@ ssl=yes # use ssl-support. Works wi
+ ## get banned from their service.
#use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address
#
+######################################################################
++++++ ddclient-3.8.0-update_nic.patch -> ddclient-3.8.1-update_nic.patch ++++++
--- /work/SRC/openSUSE:Factory/ddclient/ddclient-3.8.0-update_nic.patch 2011-09-23 01:54:54.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ddclient.new/ddclient-3.8.1-update_nic.patch 2012-01-17 16:04:57.000000000 +0100
@@ -1,12 +1,19 @@
-diff -ruN ddclient-3.8.0-orig/ddclient ddclient-3.8.0/ddclient
---- ddclient-3.8.0-orig/ddclient 2009-01-27 19:14:02.000000000 +0000
-+++ ddclient-3.8.0/ddclient 2009-05-01 20:55:20.386630124 +0000
-@@ -726,7 +726,7 @@
- foreach my $h (sort keys %config) {
- next if $config{$h}{'protocol'} ne lc($s);
- $examined{$h} = 1;
-- my $use = $config{$h}{'use'} || opt('use');
-+ my $use = $opt{'use'} || $config{$h}{'use'};
- local $opt{$use} = $config{$h}{$use} if $config{$h}{$use};
- my $ip = get_ip($use);
- if (!defined $ip || !$ip) {
+Index: ddclient
+===================================================================
+--- ddclient.orig
++++ ddclient
+@@ -1,5 +1,4 @@
+ #!/usr/bin/perl -w
+-#!/usr/local/bin/perl -w
+ ######################################################################
+ # $Id: ddclient 130 2011-07-11 21:02:07Z wimpunk $
+ #
+@@ -773,7 +772,7 @@ sub update_nics {
+ foreach my $h (sort keys %config) {
+ next if $config{$h}{'protocol'} ne lc($s);
+ $examined{$h} = 1;
+- my $use = $config{$h}{'use'} || opt('use');
++ my $use = opt('use') || $config{$h}{'use'};
+ local $opt{$use} = $config{$h}{$use} if $config{$h}{$use};
+ # bug #13: we should only do this once
+ # use isn't enough, we have to save the origin to.
++++++ ddclient-3.8.0.tar.bz2 -> ddclient-3.8.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddclient-3.8.0/Changelog new/ddclient-3.8.1/Changelog
--- old/ddclient-3.8.0/Changelog 2008-06-13 22:26:59.000000000 +0200
+++ new/ddclient-3.8.1/Changelog 2011-07-11 23:04:21.000000000 +0200
@@ -300,5 +300,5 @@
network connectivity problems or a DynDNS server outage
-------------------------------------------------------------------------------
-$Id: Changelog 98 2008-06-13 20:26:56Z wimpunk $
+$Id: Changelog 96 2008-06-13 20:24:24Z wimpunk $
------------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddclient-3.8.0/README new/ddclient-3.8.1/README
--- old/ddclient-3.8.0/README 2008-06-13 22:26:59.000000000 +0200
+++ new/ddclient-3.8.1/README 2011-07-11 23:04:21.000000000 +0200
@@ -27,6 +27,7 @@
DnsPark - See http://www.dnspark.com for details
DslReports - See http://www.dslreports.com for details
Sitelutions - see http://www.sitelutions.com for details
+Loopia - See http://www.loopia.se for details
DDclient now supports many of cable/dsl broadband routers.
@@ -172,4 +173,4 @@
and monitor your ethernet interface.
-------------------------------------------------------------------------------
-$Id: README 98 2008-06-13 20:26:56Z wimpunk $
+$Id: README 112 2009-09-10 10:21:19Z wimpunk $
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddclient-3.8.0/README.cisco new/ddclient-3.8.1/README.cisco
--- old/ddclient-3.8.0/README.cisco 2008-06-13 22:26:59.000000000 +0200
+++ new/ddclient-3.8.1/README.cisco 2011-07-11 23:04:21.000000000 +0200
@@ -1,4 +1,4 @@
-$Id: README.cisco 98 2008-06-13 20:26:56Z wimpunk $
+$Id: README.cisco 96 2008-06-13 20:24:24Z wimpunk $
Method 1 ------------------------------------------------------
The following config will allow the Linux machine (10.1.1.2) to read
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddclient-3.8.0/README.ssl new/ddclient-3.8.1/README.ssl
--- old/ddclient-3.8.0/README.ssl 2008-06-13 22:26:59.000000000 +0200
+++ new/ddclient-3.8.1/README.ssl 2011-07-11 23:04:21.000000000 +0200
@@ -1,4 +1,4 @@
-$Id: README.ssl 98 2008-06-13 20:26:56Z wimpunk $
+$Id: README.ssl 96 2008-06-13 20:24:24Z wimpunk $
Since 3.7.0, ddclient support ssl-updates
To use ssl, put "ssl=yes" in your configuration and make sure
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddclient-3.8.0/RELEASENOTE new/ddclient-3.8.1/RELEASENOTE
--- old/ddclient-3.8.0/RELEASENOTE 2009-01-27 20:33:14.000000000 +0100
+++ new/ddclient-3.8.1/RELEASENOTE 2011-07-11 23:13:44.000000000 +0200
@@ -1,11 +1,10 @@
-It's been a while but here is new release of ddclient. There are some important
-changes and some documentation is modified. A detailed overview can be found
-in ChangeLog but here's a quick overview:
-
- * Added ddclient-noip.patch send by Kurt Bussche.
- * Added and applied default timeout patch from
- https://bugs.launchpad.net/ubuntu/+source/ddclient/+bug/116066
- * Sending mail when killed, not after TERM-signal
- * Added support for multiple IP adresses.
+Once again it has been to before releasing a new version of ddclient. This
+version has some minor changes which are all logged in the ChangeLog file.
+ * Fixing #28: FreeDNS.afraid.org changed api slightly
+ * Added dtdns-support
+ * Added support for longer password
+ * Added cisco-asa patch
+ * Added support for LoopiaDNS
+Hopefully we will be able to release the next version of ddclient much sooner.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddclient-3.8.0/ddclient new/ddclient-3.8.1/ddclient
--- old/ddclient-3.8.0/ddclient 2009-01-27 20:14:02.000000000 +0100
+++ new/ddclient-3.8.1/ddclient 2011-07-11 23:04:21.000000000 +0200
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
#!/usr/local/bin/perl -w
######################################################################
-# $Id: ddclient 106 2008-12-04 18:05:23Z wimpunk $
+# $Id: ddclient 130 2011-07-11 21:02:07Z wimpunk $
#
# DDCLIENT - a Perl client for updating DynDNS information
#
@@ -20,7 +20,9 @@
use Sys::Hostname;
use IO::Socket;
-my $version = "3.8.0";
+my ($VERSION) = q$Revision: 130 $ =~ /(\d+)/;
+
+my $version = "3.8.1";
my $programd = $0;
$programd =~ s%^.*/%%;
my $program = $programd;
@@ -63,6 +65,7 @@
'dyndns' => { 'url' => 'http://checkip.dyndns.org/', 'skip' =>
'Current IP Address:', },
'dnspark' => { 'url' => 'http://ipdetect.dnspark.com/', 'skip' => 'Current Address:', },
+ 'loopia' => { 'url' => 'http://dns.loopia.se/checkip/checkip.php', 'skip' => 'Current Address:', },
);
my %builtinfw = (
'watchguard-soho' => {
@@ -80,6 +83,11 @@
'url' => '/status.htm',
'skip' => 'IP Address',
},
+ 'smc-barricade-alt' => {
+ 'name' => 'SMC Barricade FW (alternate config)',
+ 'url' => '/status.HTM',
+ 'skip' => 'WAN IP',
+ },
'smc-barricade-7401bra' => {
'name' => 'SMC Barricade 7401BRA FW',
'url' => '/admin/wan1.htm',
@@ -283,6 +291,7 @@
'if' => ": obtain IP from the -if {interface}",
'cmd' => ": obtain IP from the -cmd {external-command}",
'cisco' => ": obtain IP from Cisco FW at the -fw {address}",
+ 'cisco-asa' => ": obtain IP from Cisco ASA at the -fw {address}",
map { $_ => sprintf ": obtain IP from %s at the -fw {address}", $builtinfw{$_}->{'name'} } keys %builtinfw,
);
sub ip_strategies_usage {
@@ -292,6 +301,7 @@
my %web_strategies = (
'dyndns'=> 1,
'dnspark'=> 1,
+ 'loopia'=> 1,
);
sub setv {
@@ -307,6 +317,7 @@
my %variables = (
'global-defaults' => {
'daemon' => setv(T_DELAY, 0, 0, 1, 0, interval('60s')),
+ 'foreground' => setv(T_BOOL, 0, 0, 1, 0, undef),
'file' => setv(T_FILE, 0, 0, 1, "$etc$program.conf", undef),
'cache' => setv(T_FILE, 0, 0, 1, "$cachedir$program.cache", undef),
'pid' => setv(T_FILE, 0, 0, 1, "", undef),
@@ -411,6 +422,13 @@
'warned-min-interval' => setv(T_ANY, 0, 1, 0, 0, undef),
'warned-min-error-interval' => setv(T_ANY, 0, 1, 0, 0, undef),
},
+ 'zoneedit-service-common-defaults' => {
+ 'zone' => setv(T_OFQDN, 0, 0, 1, undef, undef),
+ },
+ 'dtdns-common-defaults' => {
+ 'login' => setv(T_LOGIN, 0, 0, 0, 'unused', undef),
+ 'client' => setv(T_STRING, 0, 1, 1, $program, undef),
+ },
);
my %services = (
'dyndns1' => {
@@ -428,6 +446,7 @@
'examples' => \&nic_dyndns2_examples,
'variables' => merge(
{ 'custom' => setv(T_BOOL, 0, 1, 1, 0, undef), },
+ { 'script' => setv(T_STRING, 1, 1, 1, '/nic/update', undef), },
# { 'offline' => setv(T_BOOL, 0, 1, 1, 0, undef), },
$variables{'dyndns-common-defaults'},
$variables{'service-common-defaults'},
@@ -480,6 +499,7 @@
{ 'server' => setv(T_FQDNP, 1, 0, 1, 'dynamic.zoneedit.com', undef) },
{ 'min-interval' => setv(T_DELAY, 0, 0, 1, interval('5m'), 0),},
$variables{'service-common-defaults'},
+ $variables{'zoneedit-service-common-defaults'},
),
},
'easydns' => {
@@ -524,6 +544,25 @@
$variables{'service-common-defaults'},
),
},
+ 'freedns' => {
+ 'updateable' => undef,
+ 'update' => \&nic_freedns_update,
+ 'examples' => \&nic_freedns_examples,
+ 'variables' => merge(
+ { 'server' => setv(T_FQDNP, 1, 0, 1, 'freedns.afraid.org', undef) },
+ { 'min-interval' => setv(T_DELAY, 0, 0, 1, 0, interval('5m')),},
+ $variables{'service-common-defaults'},
+ ),
+ },
+ 'dtdns' => {
+ 'updateable' => undef,
+ 'update' => \&nic_dtdns_update,
+ 'examples' => \&nic_dtdns_examples,
+ 'variables' => merge(
+ $variables{'dtdns-common-defaults'},
+ $variables{'service-common-defaults'},
+ ),
+ },
);
$variables{'merged'} = merge($variables{'global-defaults'},
$variables{'service-common-defaults'},
@@ -535,6 +574,7 @@
"usage: ${program} [options]",
"options are:",
[ "daemon", "=s", "-daemon delay : run as a daemon, specify delay as an interval." ],
++ [ "foreground", "!", "-foreground : do not fork" ],
[ "proxy", "=s", "-proxy host : use 'host' as the HTTP proxy" ],
[ "server", "=s", "-server host : update DNS information on 'host'" ],
[ "protocol", "=s", "-protocol type : update protocol used" ],
@@ -623,7 +663,10 @@
$SIG{'HUP'} = sub { $caught_hup = 1; };
$SIG{'TERM'} = sub { $caught_term = 1; };
$SIG{'KILL'} = sub { $caught_kill = 1; };
-if (opt('daemon') && !opt('force')) {
+# don't fork() if foreground or force is on
+if (opt('foreground') || opt('force')) {
+ ;
+} elsif (opt('daemon')) {
$SIG{'CHLD'} = 'IGNORE';
my $pid = fork;
if ($pid < 0) {
@@ -633,12 +676,15 @@
exit 0;
}
$SIG{'CHLD'} = 'DEFAULT';
- $opt{'syslog'} = 1;
open(STDOUT, ">/dev/null");
open(STDERR, ">/dev/null");
open(STDIN, "{$h}) {
foreach (qw(atime mtime wtime ip status)) {
- $config{$h}{$_} = $cache{$h}{$_} if exists $cache{$h}{$_};
+ $config->{$h}{$_} = $cache{$h}{$_} if exists $cache{$h}{$_};
}
}
}
@@ -1055,7 +1112,7 @@
$opt{'use'} = 'web' if !define($opt{'use'}) && defined($opt{'web'});
## sanity check
- $opt{'max-interval'} = max(interval(opt('max-interval')), interval(default('max-interval')));
+ $opt{'max-interval'} = min(interval(opt('max-interval')), interval(default('max-interval')));
$opt{'min-interval'} = max(interval(opt('min-interval')), interval(default('min-interval')));
$opt{'min-error-interval'} = max(interval(opt('min-error-interval')), interval(default('min-error-interval')));
@@ -1093,7 +1150,7 @@
## merge options into host definitions or globals
if (@hosts) {
foreach my $h (@hosts) {
- $config{$h} = %{ merge(\%options, $config{$h}) };
+ $config{$h} = merge(\%options, $config{$h});
}
$opt{'host'} = join(',', @hosts);
} else {
@@ -1157,6 +1214,8 @@
$proto = $config{$h}{'protocol'};
$proto = opt('protocol') if !defined($proto);
+ load_sha1_support() if ($proto eq "freedns");
+
if (!exists($services{$proto})) {
warning("skipping host: %s: unrecognized protocol '%s'", $h, $proto);
delete $config{$h};
@@ -1481,6 +1540,8 @@
}
sub opt {
my $v = shift;
+ my $h = shift;
+ return $config{$h}{$v} if defined($h && $config{$h}{$v});
return $opt{$v} if defined $opt{$v};
return $globals{$v} if defined $globals{$v};
return default($v) if defined default($v);
@@ -1696,11 +1757,6 @@
# fix padding at the end
my $padding = (3 - length($_[0]) % 3) % 3;
$res =~ s/.{$padding}$/'=' x $padding/e if $padding;
-
- # break encoded string into lines of no more than 76 characters each
- if (length $eol) {
- $res =~ s/(.{1,76})/$1$eol/g;
- }
$res;
}
######################################################################
@@ -1712,12 +1768,26 @@
fatal(<<"EOM");
Error loading the Perl module IO::Socket::SSL needed for SSL connect.
On Debian, the package libio-socket-ssl-perl must be installed.
+On Red Hat, the package perl-IO-Socket-SSL must be installed.
EOM
}
import IO::Socket::SSL;
{ no warnings; $IO::Socket::SSL::DEBUG = 0; }
}
######################################################################
+## load_sha1_support
+######################################################################
+sub load_sha1_support {
+ my $sha1_loaded = eval {require Digest::SHA1};
+ unless ($sha1_loaded) {
+ fatal(<<"EOM");
+Error loading the Perl module Digest::SHA1 needed for freedns update.
+On Debian, the package libdigest-sha1-perl must be installed.
+EOM
+ }
+ import Digest::SHA1 (qw/sha1_hex/);
+}
+######################################################################
## geturl
######################################################################
sub geturl {
@@ -1729,8 +1799,10 @@
my ($sd, $rq, $request, $reply);
debug("proxy = $proxy");
- debug("url = $url");
+ debug("url = %s", $url);
## canonify proxy and url
+ my $force_ssl;
+ $force_ssl = 1 if ($url =~ /^https:/);
$proxy =~ s%^https?://%%i;
$url =~ s%^https?://%%i;
$server = $url;
@@ -1743,7 +1815,7 @@
$globals{'fw'} && debug("glo fw = $globals{'fw'}");
#if ( $globals{'ssl'} and $server ne $globals{'fw'} ) {
## always omit SSL for connections to local router
- if ( $globals{'ssl'} and (caller(1))[3] ne 'main::get_ip' ) {
+ if ( $force_ssl || ($globals{'ssl'} and (caller(1))[3] ne 'main::get_ip') ) {
$use_ssl = 1;
$default_port = 443;
load_ssl_support;
@@ -1769,7 +1841,7 @@
$request .= "Host: $server\n";
my $auth = encode_base64("${login}:${password}");
- $request .= "Authorization: Basic $auth" if $login || $password;
+ $request .= "Authorization: Basic $auth\n" if $login || $password;
$request .= "User-Agent: ${program}/${version}\n";
$request .= "Connection: close\n";
$request .= "\n";
@@ -1781,7 +1853,7 @@
$0 = sprintf("%s - connecting to %s port %s", $program, $peer, $port);
if (! opt('exec')) {
debug("skipped network connection");
- verbose("SENDING:", $request);
+ verbose("SENDING:", "%s", $request);
} elsif ($use_ssl) {
$sd = IO::Socket::SSL->new(
PeerAddr => $peer,
@@ -1802,39 +1874,39 @@
defined $sd or warning("cannot connect to $peer:$port socket: $@");
}
- if (defined $sd) {
- ## send the request to the http server
- verbose("CONNECTED: ", $use_ssl ? 'using SSL' : 'using HTTP');
- verbose("SENDING:", $request);
-
- $0 = sprintf("%s - sending to %s port %s", $program, $peer, $port);
- my $result = syswrite $sd, $rq;
- if ($result != length($rq)) {
- warning("cannot send to $peer:$port ($!).");
-
- } else {
- my $timeout = 0;
- local $SIG{'ALRM'} = sub { $timeout = 1; };
-
- $0 = sprintf("%s - reading from %s port %s", $program, $peer, $port);
- alarm(opt('timeout')) if opt('timeout') > 0;
- while (!$timeout && ($_ = <$sd>)) {
- $0 = sprintf("%s - read from %s port %s", $program, $peer, $port);
- verbose("RECEIVE:", "%s", define($_, "<undefined>"));
- $reply .= $_ if defined $_;
- }
- if (opt('timeout') > 0) {
- alarm(0);
- }
- close($sd);
- if ($timeout) {
- warning("TIMEOUT: %s after %s seconds", $to, opt('timeout'));
- $reply = '';
- }
- $reply = '' if !defined $reply;
+ if (defined $sd) {
+ ## send the request to the http server
+ verbose("CONNECTED: ", $use_ssl ? 'using SSL' : 'using HTTP');
+ verbose("SENDING:", "%s", $request);
+
+ $0 = sprintf("%s - sending to %s port %s", $program, $peer, $port);
+ my $result = syswrite $sd, $rq;
+ if ($result != length($rq)) {
+ warning("cannot send to $peer:$port ($!).");
+ } else {
+ $0 = sprintf("%s - reading from %s port %s", $program, $peer, $port);
+ eval {
+ local $SIG{'ALRM'} = sub { die "timeout";};
+ alarm(opt('timeout')) if opt('timeout') > 0;
+ while ($_ = <$sd>) {
+ $0 = sprintf("%s - read from %s port %s", $program, $peer, $port);
+ verbose("RECEIVE:", "%s", define($_, "<undefined>"));
+ $reply .= $_ if defined $_;
+ }
+ if (opt('timeout') > 0) {
+ alarm(0);
+ }
+ };
+ close($sd);
+
+ if ($@ and $@ =~ /timeout/) {
+ warning("TIMEOUT: %s after %s seconds", $to, opt('timeout'));
+ $reply = '';
+ }
+ $reply = '' if !defined $reply;
+ }
}
- }
- $0 = sprintf("%s - closed %s port %s", $program, $peer, $port);
+ $0 = sprintf("%s - closed %s port %s", $program, $peer, $port);
## during testing simulate reading the URL
if (opt('test')) {
@@ -1855,28 +1927,29 @@
######################################################################
sub get_ip {
my $use = lc shift;
+ my $h = shift;
my ($ip, $arg, $reply, $url, $skip) = (undef, opt($use), '');
$arg = '' unless $arg;
if ($use eq 'ip') {
- $ip = opt('ip');
+ $ip = opt('ip', $h);
$arg = 'ip';
} elsif ($use eq 'if') {
- $skip = opt('if-skip') || '';
+ $skip = opt('if-skip', $h) || '';
$reply = `ifconfig $arg 2> /dev/null`;
$reply = '' if $?;
} elsif ($use eq 'cmd') {
if ($arg) {
- $skip = opt('cmd-skip') || '';
+ $skip = opt('cmd-skip', $h) || '';
$reply = `$arg`;
$reply = '' if $?;
}
} elsif ($use eq 'web') {
- $url = opt('web') || '';
- $skip = opt('web-skip') || '';
+ $url = opt('web', $h) || '';
+ $skip = opt('web-skip', $h) || '';
if (exists $builtinweb{$url}) {
$skip = $builtinweb{$url}->{'skip'} unless $skip;
@@ -1885,15 +1958,32 @@
$arg = $url;
if ($url) {
- $reply = geturl(opt('proxy'), $url) || '';
+ $reply = geturl(opt('proxy', $h), $url) || '';
}
} elsif (($use eq 'cisco')) {
# Stuff added to support Cisco router ip http daemon
# User fw-login should only have level 1 access to prevent
# password theft. This is pretty harmless.
- my $queryif = opt('if');
- $skip = opt('fw-skip') || '';
+ my $queryif = opt('if', $h);
+ $skip = opt('fw-skip', $h) || '';
+
+ # Convert slashes to protected value "\/"
+ $queryif =~ s%\/%\\\/%g;
+
+ # Protect special HTML characters (like '?')
+ $queryif =~ s/([\?&= ])/sprintf("%%%02x",ord($1))/ge;
+
+ $url = "http://".opt('fw', $h)."/level/1/exec/show/ip/interface/brief/${queryif}/CR";
+ $reply = geturl('', $url, opt('fw-login', $h), opt('fw-password', $h)) || '';
+ $arg = $url;
+
+ } elsif (($use eq 'cisco-asa')) {
+ # Stuff added to support Cisco ASA ip https daemon
+ # User fw-login should only have level 1 access to prevent
+ # password theft. This is pretty harmless.
+ my $queryif = opt('if', $h);
+ $skip = opt('fw-skip', $h) || '';
# Convert slashes to protected value "\/"
$queryif =~ s%\/%\\\/%g;
@@ -1901,13 +1991,13 @@
# Protect special HTML characters (like '?')
$queryif =~ s/([\?&= ])/sprintf("%%%02x",ord($1))/ge;
- $url = "http://".opt('fw')."/level/1/exec/show/ip/interface/brief/${queryif}/CR";
- $reply = geturl('', $url, opt('fw-login'), opt('fw-password')) || '';
+ $url = "https://".opt('fw', $h)."/exec/show%20interface%20${queryif}";
+ $reply = geturl('', $url, opt('fw-login', $h), opt('fw-password', $h)) || '';
$arg = $url;
} else {
- $url = opt('fw') || '';
- $skip = opt('fw-skip') || '';
+ $url = opt('fw', $h) || '';
+ $skip = opt('fw-skip', $h) || '';
if (exists $builtinfw{$use}) {
$skip = $builtinfw{$use}->{'skip'} unless $skip;
@@ -1916,7 +2006,7 @@
$arg = $url;
if ($url) {
- $reply = geturl('', $url, opt('fw-login'), opt('fw-password')) || '';
+ $reply = geturl('', $url, opt('fw-login', $h), opt('fw-password', $h)) || '';
}
}
if (!defined $reply) {
@@ -2093,11 +2183,14 @@
} elsif (defined($sub) && &$sub($host)) {
$update = 1;
-
- } elsif (($cache{$host}{'static'} ne $config{$host}{'static'}) ||
- ($cache{$host}{'wildcard'} ne $config{$host}{'wildcard'}) ||
- ($cache{$host}{'mx'} ne $config{$host}{'mx'}) ||
- ($cache{$host}{'backupmx'} ne $config{$host}{'backupmx'})) {
+ } elsif ((defined($cache{$host}{'static'}) && defined($config{$host}{'static'}) &&
+ ($cache{$host}{'static'} ne $config{$host}{'static'})) ||
+ (defined($cache{$host}{'wildcard'}) && defined($config{$host}{'wildcard'}) &&
+ ($cache{$host}{'wildcard'} ne $config{$host}{'wildcard'})) ||
+ (defined($cache{$host}{'mx'}) && defined($config{$host}{'mx'}) &&
+ ($cache{$host}{'mx'} ne $config{$host}{'mx'})) ||
+ (defined($cache{$host}{'backupmx'}) && defined($config{$host}{'backupmx'}) &&
+ ($cache{$host}{'backupmx'} ne $config{$host}{'backupmx'})) ) {
info("updating %s because host settings have been changed.", $host);
$update = 1;
@@ -2270,6 +2363,7 @@
Configuration variables applicable to the 'dyndns2' protocol are:
protocol=dyndns2 ##
server=fqdn.of.service ## defaults to members.dyndns.org
+ script=/path/to/script ## defaults to /nic/update
backupmx=no|yes ## indicates that this host is the primary MX for the domain.
static=no|yes ## indicates that this host has a static IP address.
custom=no|yes ## indicates that this host is a 'custom' top-level domain name.
@@ -2318,7 +2412,9 @@
'!yours' => 'The hostname specified exists, but not under the username currently being used',
'!donator' => 'The offline setting was set, when the user is not a donator',
'!active' => 'The hostname specified is in a Custom DNS domain which has not yet been activated.',
- 'abuse', => 'The hostname specified is blocked for abuse; fill in the form at http://support.dyndns.org/abuse.php to be unblocked',
+ 'abuse', => 'The hostname specified is blocked for abuse; you should receive an email notification ' .
+ 'which provides an unblock request link. More info can be found on ' .
+ 'https://www.dyndns.com/support/abuse.html',
'numhost' => 'System error: Too many or too few hosts found. Contact support@dyndns.org',
'dnserr' => 'System error: DNS error encountered. Contact support@dyndns.org',
@@ -2338,7 +2434,7 @@
verbose("UPDATE:","updating %s", $hosts);
## Select the DynDNS system to update
- my $url = "http://$config{$h}{'server'}/nic/update?system=";
+ my $url = "http://$config{$h}{'server'}$config{$h}{'script'}?system=";
if ($config{$h}{'custom'}) {
warning("updating %s: 'custom' and 'static' may not be used together. ('static' ignored)", $hosts)
if $config{$h}{'static'};
@@ -2375,6 +2471,8 @@
my @reply = split /\n/, $reply;
my $state = 'header';
+ my $returnedip = $ip;
+
foreach my $line (@reply) {
if ($state eq 'header') {
$state = 'body';
@@ -2385,7 +2483,10 @@
} elsif ($state =~ /^results/) {
$state = 'results2';
- my ($status, $ip) = split / /, lc $line;
+ # bug #10: some dyndns providers does not return the IP so
+ # we can't use the returned IP
+ my ($status, $returnedip) = split / /, lc $line;
+ $ip = $returnedip if (not $ip);
my $h = shift @hosts;
$config{$h}{'status'} = $status;
@@ -2801,6 +2902,11 @@
Configuration variables applicable to the 'zoneedit1' protocol are:
protocol=zoneedit1 ##
server=fqdn.of.service ## defaults to www.zoneedit.com
+ zone=zone-where-domains-are ## only needed if 1 or more subdomains are deeper
+ ## than 1 level in relation to the zone where it
+ ## is defined. For example, b.foo.com in a zone
+ ## foo.com doesn't need this, but a.b.foo.com in
+ ## the same zone needs zone=foo.com
login=service-login ## login name and password registered with the service
password=service-password ##
your.domain.name ## the host registered with the service.
@@ -2808,7 +2914,8 @@
Example ${program}.conf file entries:
## single host update
protocol=zoneedit1, \\
- server=dynamic.zoneedit.com, \\
+ server=dynamic.zoneedit.com, \\
+ zone=zone-where-domains-are, \\
login=my-zoneedit-login, \\
password=my-zoneedit-password \\
my.domain.name
@@ -2832,7 +2939,7 @@
debug("\nnic_zoneedit1_update -------------------");
## group hosts with identical attributes together
- my %groups = group_hosts_by([ @_ ], [ qw(login password server) ]);
+ my %groups = group_hosts_by([ @_ ], [ qw(login password server zone) ]);
## update each set of hosts that had similar configurations
foreach my $sig (keys %groups) {
@@ -2849,6 +2956,7 @@
$url .= "http://$config{$h}{'server'}/auth/dynamic.html";
$url .= "?host=$hosts";
$url .= "&dnsto=$ip" if $ip;
+ $url .= "&zone=$config{$h}{'zone'}" if defined $config{$h}{'zone'};
my $reply = geturl(opt('proxy'), $url, $config{$h}{'login'}, $config{$h}{'password'});
if (!defined($reply) || !$reply) {
@@ -3378,6 +3486,191 @@
}
}
+######################################################################
+
+######################################################################
+## nic_freedns_examples
+######################################################################
+sub nic_freedns_examples {
+return <