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

(-)ddclient/Makefile (-1 / +2 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	ddclient
4
PORTNAME=	ddclient
5
PORTVERSION=	3.8.3
5
PORTVERSION=	3.8.3
6
PORTREVISION=	1
6
CATEGORIES=	dns
7
CATEGORIES=	dns
7
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
8
9
Lines 18-24 Link Here
18
19
19
USE_RC_SUBR=	${PORTNAME}
20
USE_RC_SUBR=	${PORTNAME}
20
21
21
RUN_DEPENDS=	p5-JSON-Any>=0:converters/p5-JSON-Any
22
RUN_DEPENDS=	p5-JSON-PP>=0:converters/p5-JSON-PP
22
23
23
SUB_FILES=	pkg-message ddclient_force
24
SUB_FILES=	pkg-message ddclient_force
24
25
(-)ddclient/files/patch-ddclient (-10 / +53 lines)
Lines 1-14 Link Here
1
--- ./ddclient.orig	2011-07-25 19:41:39.000000000 -0700
1
--- ddclient.orig	2015-05-30 21:37:38.000000000 +1200
2
+++ ./ddclient	2011-07-25 19:41:48.000000000 -0700
2
+++ ddclient	2017-02-08 11:00:23.812579000 +1300
3
@@ -19,6 +18,7 @@
3
@@ -25,6 +25,7 @@
4
 use Getopt::Long;
4
 use Getopt::Long;
5
 use Sys::Hostname;
5
 use Sys::Hostname;
6
 use IO::Socket;
6
 use IO::Socket;
7
+use POSIX 'setsid';
7
+use POSIX 'setsid';
8
 
8
 
9
 my ($VERSION) = q$Revision: 157 $ =~ /(\d+)/;
9
 # my ($VERSION) = q$Revision: 184 $ =~ /(\d+)/;
10
 
10
 
11
@@ -29,9 +29,9 @@
11
@@ -35,9 +36,9 @@
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
@@ -39,7 +39,7 @@
24
@@ -45,7 +46,7 @@
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
@@ -678,6 +678,9 @@
33
@@ -743,6 +744,9 @@
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
@@ -685,10 +688,9 @@
43
@@ -750,10 +754,9 @@
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
@@ -1478,17 +1480,17 @@
56
@@ -1544,17 +1547,17 @@
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-81 Link Here
75
 
75
 
76
     } else {
76
     } else {
77
 	$ok = 1;
77
 	$ok = 1;
78
@@ -1878,6 +1880,7 @@
78
@@ -1878,13 +1881,13 @@
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 @@
79
 	    $sd = IO::Socket::SSL->new(
96
 	    $sd = IO::Socket::SSL->new(
80
             PeerAddr => $peer,
97
             PeerAddr => $peer,
81
             PeerPort => $port,
98
             PeerPort => $port,
Lines 83-85 Link Here
83
             Proto => 'tcp',
100
             Proto => 'tcp',
84
             MultiHomed => 1,
101
             MultiHomed => 1,
85
             Timeout => opt('timeout'),
102
             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 216526