Index: head/dns/ddclient/Makefile =================================================================== --- head/dns/ddclient/Makefile (revision 433787) +++ head/dns/ddclient/Makefile (revision 433788) @@ -1,56 +1,57 @@ # Created by: Dirk Froemberg # $FreeBSD$ PORTNAME= ddclient PORTVERSION= 3.8.3 +PORTREVISION= 1 CATEGORIES= dns MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION} MAINTAINER= mjl@luckie.org.nz COMMENT= Update dynamic DNS entries LICENSE= GPLv2 NO_BUILD= yes USES= perl5 tar:bzip2 USE_PERL5= run USE_RC_SUBR= ${PORTNAME} -RUN_DEPENDS= p5-JSON-Any>=0:converters/p5-JSON-Any +RUN_DEPENDS= p5-JSON-PP>=0:converters/p5-JSON-PP SUB_FILES= pkg-message ddclient_force OPTIONS_DEFINE= SSL OPTIONS_DEFAULT=SSL SSL_RUN_DEPENDS=ca_root_nss>0:security/ca_root_nss \ p5-IO-Socket-SSL>0:security/p5-IO-Socket-SSL PORTDOCS= COPYRIGHT ChangeLog README.cisco README.ssl README.md \ sample-etc_cron.d_ddclient sample-etc_dhclient-exit-hooks \ sample-etc_dhcpc_dhcpcd-eth0.exe sample-etc_ppp_ip-up.local -PLIST_FILES= etc/ddclient.conf.sample etc/periodic/daily/ddclient_force \ +PLIST_FILES= "@sample etc/ddclient.conf.sample" etc/periodic/daily/ddclient_force \ sbin/ddclient post-patch: @${GREP} -lR '/usr' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \ 's|/usr|${PREFIX}|g' @${REINPLACE_CMD} -e 's|%%ETCDIR%%|${PREFIX}/etc| ; \ s|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/ddclient do-install: (cd ${WRKSRC} && ${INSTALL_DATA} sample-etc_ddclient.conf \ ${STAGEDIR}${PREFIX}/etc/ddclient.conf.sample) (cd ${WRKSRC} && ${INSTALL_SCRIPT} ddclient \ ${STAGEDIR}${PREFIX}/sbin) @${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily (cd ${WRKDIR} && ${INSTALL_SCRIPT} ddclient_force \ ${STAGEDIR}${PREFIX}/etc/periodic/daily/ddclient_force) @${MKDIR} ${STAGEDIR}${DOCSDIR} .for i in ${PORTDOCS} (cd ${WRKSRC} && ${INSTALL_DATA} ${i} ${STAGEDIR}${DOCSDIR}) .endfor .include Index: head/dns/ddclient/files/patch-ddclient =================================================================== --- head/dns/ddclient/files/patch-ddclient (revision 433787) +++ head/dns/ddclient/files/patch-ddclient (revision 433788) @@ -1,85 +1,128 @@ ---- ./ddclient.orig 2011-07-25 19:41:39.000000000 -0700 -+++ ./ddclient 2011-07-25 19:41:48.000000000 -0700 -@@ -19,6 +18,7 @@ +--- ddclient.orig 2015-05-30 21:37:38.000000000 +1200 ++++ ddclient 2017-02-08 11:00:23.812579000 +1300 +@@ -25,6 +25,7 @@ use Getopt::Long; use Sys::Hostname; use IO::Socket; +use POSIX 'setsid'; - my ($VERSION) = q$Revision: 157 $ =~ /(\d+)/; + # my ($VERSION) = q$Revision: 184 $ =~ /(\d+)/; -@@ -29,9 +29,9 @@ +@@ -35,9 +36,9 @@ $program =~ s/d$//; my $now = time; my $hostname = hostname(); -my $etc = ($program =~ /test/i) ? './' : '/etc/ddclient/'; -my $cachedir = ($program =~ /test/i) ? './' : '/var/cache/ddclient/'; -my $savedir = ($program =~ /test/i) ? 'URL/' : '/tmp/'; +my $etc = ($program =~ /test/i) ? './' : '%%ETCDIR%%/'; +my $cachedir = ($program =~ /test/i) ? './' : '/var/tmp/'; +my $savedir = ($program =~ /test/i) ? 'URL/' : '/var/tmp/'; my $msgs = ''; my $last_msgs = ''; -@@ -39,7 +39,7 @@ +@@ -45,7 +46,7 @@ local $file = ''; local $lineno = ''; -$ENV{'PATH'} = (exists($ENV{PATH}) ? "$ENV{PATH}:" : "") . "/sbin:/usr/sbin:/bin:/usr/bin:/etc:/usr/lib:"; +$ENV{'PATH'} = (exists($ENV{PATH}) ? "$ENV{PATH}:" : "") . "/sbin:/usr/sbin:/bin:"; sub T_ANY {'any'}; sub T_STRING {'string'}; -@@ -678,6 +678,9 @@ +@@ -743,6 +744,9 @@ ; } elsif (opt('daemon')) { $SIG{'CHLD'} = 'IGNORE'; + chdir '/'; + open(STDIN, "/dev/null"); my $pid = fork; if ($pid < 0) { print STDERR "${program}: can not fork ($!)\n"; -@@ -685,10 +688,9 @@ +@@ -750,10 +754,9 @@ } elsif ($pid) { exit 0; } + setsid; $SIG{'CHLD'} = 'DEFAULT'; - open(STDOUT, ">/dev/null"); - open(STDERR, ">/dev/null"); - open(STDIN, "new( PeerAddr => $peer, PeerPort => $port, + SSL_ca_file => '%%LOCALBASE%%/share/certs/ca-root-nss.crt', Proto => 'tcp', MultiHomed => 1, Timeout => opt('timeout'), +@@ -4096,9 +4100,9 @@ + + # Strip header + $reply =~ s/^.*?\n\n//s; +- my $response = JSON::Any->jsonToObj($reply); +- if ($response->{result} eq 'error') { +- failed ("%s", $response->{msg}); ++ my $response = eval {decode_json($reply)}; ++ if (!defined $response || !defined $response->{result}) { ++ failed ("invalid json or result."); + next; + } + +@@ -4128,9 +4132,9 @@ + + # Strip header + $reply =~ s/^.*?\n\n//s; +- $response = JSON::Any->jsonToObj($reply); +- if ($response->{result} eq 'error') { +- failed ("%s", $response->{msg}); ++ $response = eval {decode_json($reply)}; ++ if (!defined $response || !defined $response->{result}) { ++ failed ("invalid json or result."); + } else { + success ("%s -- Updated Successfully to %s", $domain, $ip); +