View | Details | Raw Unified | Return to bug 228600
Collapse All | Expand All

(-)Makefile (-3 / +8 lines)
Lines 2-11 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	ddclient
4
PORTNAME=	ddclient
5
PORTVERSION=	3.8.3
5
PORTVERSION=	3.8.3.20180523
6
PORTREVISION=	3
7
CATEGORIES=	dns
6
CATEGORIES=	dns
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
7
#MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
9
8
10
MAINTAINER=	mjl@luckie.org.nz
9
MAINTAINER=	mjl@luckie.org.nz
11
COMMENT=	Update dynamic DNS entries
10
COMMENT=	Update dynamic DNS entries
Lines 12-22 Link Here
12
11
13
LICENSE=	GPLv2
12
LICENSE=	GPLv2
14
13
14
RUN_DEPENDS=	p5-Data-Validate-IP>0:net-mgmt/p5-Data-Validate-IP
15
15
NO_BUILD=	yes
16
NO_BUILD=	yes
16
17
17
USES=		perl5 tar:bzip2
18
USES=		perl5 tar:bzip2
18
USE_PERL5=	run
19
USE_PERL5=	run
19
20
21
USE_GITHUB=	yes
22
GH_ACCOUNT=	ddclient
23
GH_TAGNAME=	ec2acfb
24
20
USE_RC_SUBR=	${PORTNAME}
25
USE_RC_SUBR=	${PORTNAME}
21
26
22
SUB_FILES=	pkg-message ddclient_force
27
SUB_FILES=	pkg-message ddclient_force
(-)distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (ddclient-3.8.3.tar.bz2) = d40e2f1fd3f4bff386d27bbdf4b8645199b1995d27605a886b8c71e44d819591
1
TIMESTAMP = 1527645042
2
SIZE (ddclient-3.8.3.tar.bz2) = 49026
2
SHA256 (ddclient-ddclient-3.8.3.20180523-ec2acfb_GH0.tar.gz) = ac44b2fd15112c1896964bd6cb9b919bf68c2bca81deacc6f082497129fc5bf3
3
SIZE (ddclient-ddclient-3.8.3.20180523-ec2acfb_GH0.tar.gz) = 57924
(-)files/patch-ddclient (-55 / +12 lines)
Lines 1-14 Link Here
1
--- ddclient.orig	2015-05-30 21:37:38.000000000 +1200
1
--- ddclient.orig	2018-05-23 10:25:05 UTC
2
+++ ddclient	2017-02-08 11:00:23.812579000 +1300
2
+++ ddclient
3
@@ -25,6 +25,7 @@
3
@@ -25,6 +25,7 @@ use Getopt::Long;
4
 use Getopt::Long;
5
 use Sys::Hostname;
4
 use Sys::Hostname;
6
 use IO::Socket;
5
 use IO::Socket;
6
 use Data::Validate::IP;
7
+use POSIX 'setsid';
7
+use POSIX 'setsid';
8
 
8
 
9
 # my ($VERSION) = q$Revision: 184 $ =~ /(\d+)/;
9
 my $version  = "3.8.3";
10
 
10
 my $programd  = $0; 
11
@@ -35,9 +36,9 @@
11
@@ -33,9 +34,9 @@ my $program   = $programd;
12
 $program  =~ s/d$//;
12
 $program  =~ s/d$//;
13
 my $now       = time;
13
 my $now       = time;
14
 my $hostname  = hostname();
14
 my $hostname  = hostname();
Lines 21-27 Link Here
21
 my $msgs      = '';
21
 my $msgs      = '';
22
 my $last_msgs = '';
22
 my $last_msgs = '';
23
 
23
 
24
@@ -45,7 +46,7 @@
24
@@ -43,7 +44,7 @@ use vars qw($file $lineno);
25
 local $file   = '';
25
 local $file   = '';
26
 local $lineno = '';
26
 local $lineno = '';
27
 
27
 
Lines 30-36 Link Here
30
 
30
 
31
 sub T_ANY	{'any'};
31
 sub T_ANY	{'any'};
32
 sub T_STRING	{'string'};
32
 sub T_STRING	{'string'};
33
@@ -743,6 +744,9 @@
33
@@ -792,6 +793,9 @@ if (opt('foreground') || opt('force')) {
34
     ;
34
     ;
35
 } elsif (opt('daemon')) {
35
 } elsif (opt('daemon')) {
36
     $SIG{'CHLD'}   = 'IGNORE';
36
     $SIG{'CHLD'}   = 'IGNORE';
Lines 40-46 Link Here
40
     my $pid = fork;
40
     my $pid = fork;
41
     if ($pid < 0) {
41
     if ($pid < 0) {
42
 	print STDERR "${program}: can not fork ($!)\n";
42
 	print STDERR "${program}: can not fork ($!)\n";
43
@@ -750,10 +754,9 @@
43
@@ -799,10 +803,9 @@ if (opt('foreground') || opt('force')) {
44
     } elsif ($pid) {
44
     } elsif ($pid) {
45
 	exit 0;
45
 	exit 0;
46
     }
46
     }
Lines 53-59 Link Here
53
 }
53
 }
54
 
54
 
55
 # write out the pid file if we're daemon'ized
55
 # write out the pid file if we're daemon'ized
56
@@ -1544,17 +1547,17 @@
56
@@ -1595,17 +1598,17 @@ sub pipecmd {
57
     ## execute the command.
57
     ## execute the command.
58
     local *FD;
58
     local *FD;
59
     if (! open(FD, $cmd)) {
59
     if (! open(FD, $cmd)) {
Lines 75-98 Link Here
75
 
75
 
76
     } else {
76
     } else {
77
 	$ok = 1;
77
 	$ok = 1;
78
@@ -1878,13 +1881,13 @@
78
@@ -2034,6 +2037,7 @@ sub geturl {
79
 ## load_json_support
80
 ######################################################################
81
 sub load_json_support {
82
-	my $json_loaded = eval {require JSON::Any};
83
+	my $json_loaded = eval {require JSON::PP};
84
 	unless ($json_loaded) {
85
 		fatal(<<"EOM");
86
-Error loading the Perl module JSON::Any needed for cloudflare update.
87
+Error loading the Perl module JSON::PP needed for cloudflare update.
88
 EOM
89
 	}
90
-	import JSON::Any;
91
+	import JSON::PP (qw/decode_json/);
92
 }
93
 ######################################################################
94
 ## geturl
95
@@ -1957,6 +1960,7 @@
96
 	    $sd = IO::Socket::SSL->new(
79
 	    $sd = IO::Socket::SSL->new(
97
             PeerAddr => $peer,
80
             PeerAddr => $peer,
98
             PeerPort => $port,
81
             PeerPort => $port,
Lines 100-128 Link Here
100
             Proto => 'tcp',
83
             Proto => 'tcp',
101
             MultiHomed => 1,
84
             MultiHomed => 1,
102
             Timeout => opt('timeout'),
85
             Timeout => opt('timeout'),
103
@@ -4096,9 +4100,9 @@
104
 
105
 			# Strip header
106
 			$reply =~ s/^.*?\n\n//s;
107
-			my $response = JSON::Any->jsonToObj($reply);
108
-			if ($response->{result} eq 'error') {
109
-				failed ("%s", $response->{msg});
110
+			my $response = eval {decode_json($reply)};
111
+			if (!defined $response || !defined $response->{result}) {
112
+				failed ("invalid json or result.");
113
 				next; 
114
 			}
115
 
116
@@ -4128,9 +4132,9 @@
117
 
118
 			# Strip header
119
 			$reply =~ s/^.*?\n\n//s;
120
-			$response = JSON::Any->jsonToObj($reply);
121
-			if ($response->{result} eq 'error') {
122
-				failed ("%s", $response->{msg});	
123
+			$response = eval {decode_json($reply)}; 
124
+			if (!defined $response || !defined $response->{result}) {
125
+				failed ("invalid json or result.");
126
 			} else {
127
 				success ("%s -- Updated Successfully to %s", $domain, $ip);
128
 

Return to bug 228600