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

(-)b/dns/ddclient/Makefile (-10 / +5 lines)
Lines 1-6 Link Here
1
PORTNAME=	ddclient
1
PORTNAME=	ddclient
2
PORTVERSION=	3.10.0
2
DISTVERSIONPREFIX=	v
3
DISTVERSIONPREFIX=	v
3
DISTVERSION=	3.9.1
4
CATEGORIES=	dns
4
CATEGORIES=	dns
5
5
6
MAINTAINER=	mjl@luckie.org.nz
6
MAINTAINER=	mjl@luckie.org.nz
Lines 12-29 LICENSE_FILE= ${WRKSRC}/COPYING Link Here
12
12
13
RUN_DEPENDS=	p5-Data-Validate-IP>0:net-mgmt/p5-Data-Validate-IP
13
RUN_DEPENDS=	p5-Data-Validate-IP>0:net-mgmt/p5-Data-Validate-IP
14
14
15
USES=		perl5 tar:bzip2
15
USES=		autoreconf gmake perl5 tar:bzip2
16
GNU_CONFIGURE=	yes
16
USE_GITHUB=	yes
17
USE_GITHUB=	yes
17
USE_PERL5=	run
18
USE_PERL5=	run
18
USE_RC_SUBR=	${PORTNAME}
19
USE_RC_SUBR=	${PORTNAME}
19
20
20
NO_ARCH=	yes
21
NO_ARCH=	yes
21
NO_BUILD=	yes
22
SUB_FILES=	pkg-message ddclient_force
22
SUB_FILES=	pkg-message ddclient_force
23
23
24
PLIST_FILES=	"@sample(,,600) etc/ddclient.conf.sample" \
25
		etc/periodic/daily/ddclient_force \
26
		sbin/ddclient
27
PORTDOCS=	COPYRIGHT ChangeLog README.cisco README.ssl README.md \
24
PORTDOCS=	COPYRIGHT ChangeLog README.cisco README.ssl README.md \
28
		sample-etc_cron.d_ddclient sample-etc_dhclient-exit-hooks \
25
		sample-etc_cron.d_ddclient sample-etc_dhclient-exit-hooks \
29
		sample-etc_dhcpc_dhcpcd-eth0.exe sample-etc_ppp_ip-up.local
26
		sample-etc_dhcpc_dhcpcd-eth0.exe sample-etc_ppp_ip-up.local
Lines 38-49 post-patch: Link Here
38
	@${GREP} -lR '/usr' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \
35
	@${GREP} -lR '/usr' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \
39
		's|/usr|${PREFIX}|g'
36
		's|/usr|${PREFIX}|g'
40
	@${REINPLACE_CMD} -e 's|%%ETCDIR%%|${PREFIX}/etc| ; \
37
	@${REINPLACE_CMD} -e 's|%%ETCDIR%%|${PREFIX}/etc| ; \
41
		 s|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/ddclient
38
		 s|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/ddclient.in
42
	@${REINPLACE_CMD} -e '/^\#\!\/usr\/local\/local/d' \
43
		${WRKSRC}/ddclient
44
39
45
do-install:
40
do-install:
46
	(cd ${WRKSRC} && ${INSTALL_DATA} sample-etc_ddclient.conf \
41
	(cd ${WRKSRC} && ${INSTALL_DATA} ddclient.conf \
47
		${STAGEDIR}${PREFIX}/etc/ddclient.conf.sample)
42
		${STAGEDIR}${PREFIX}/etc/ddclient.conf.sample)
48
	(cd ${WRKSRC} && ${INSTALL_SCRIPT} ddclient \
43
	(cd ${WRKSRC} && ${INSTALL_SCRIPT} ddclient \
49
		${STAGEDIR}${PREFIX}/sbin)
44
		${STAGEDIR}${PREFIX}/sbin)
(-)b/dns/ddclient/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1603527045
1
TIMESTAMP = 1666679028
2
SHA256 (ddclient-ddclient-v3.9.1_GH0.tar.gz) = e4969e15cc491fc52bdcd649d4c2b0e4b1bf0c9f9dba23471c634871acc52470
2
SHA256 (ddclient-ddclient-v3.10.0_GH0.tar.gz) = 34b6d9a946290af0927e27460a965ad018a7c525625063b0f380cbddffc01c1b
3
SIZE (ddclient-ddclient-v3.9.1_GH0.tar.gz) = 63469
3
SIZE (ddclient-ddclient-v3.10.0_GH0.tar.gz) = 275494
(-)a/dns/ddclient/files/patch-ddclient (-85 lines)
Removed Link Here
1
--- ddclient.orig	2018-05-23 10:25:05 UTC
2
+++ ddclient
3
@@ -25,6 +25,7 @@ use Getopt::Long;
4
 use Sys::Hostname;
5
 use IO::Socket;
6
 use Data::Validate::IP;
7
+use POSIX 'setsid';
8
 
9
 my $version  = "3.8.3";
10
 my $programd  = $0; 
11
@@ -33,9 +34,9 @@ my $program   = $programd;
12
 $program  =~ s/d$//;
13
 my $now       = time;
14
 my $hostname  = hostname();
15
-my $etc       = ($program =~ /test/i) ? './'   : '/etc/ddclient/';
16
-my $cachedir  = ($program =~ /test/i) ? './'   : '/var/cache/ddclient/';
17
-my $savedir   = ($program =~ /test/i) ? 'URL/' : '/tmp/';
18
+my $etc       = ($program =~ /test/i) ? './'   : '%%ETCDIR%%/';
19
+my $cachedir  = ($program =~ /test/i) ? './'   : '/var/tmp/';
20
+my $savedir   = ($program =~ /test/i) ? 'URL/' : '/var/tmp/';
21
 my $msgs      = '';
22
 my $last_msgs = '';
23
 
24
@@ -43,7 +44,7 @@ use vars qw($file $lineno);
25
 local $file   = '';
26
 local $lineno = '';
27
 
28
-$ENV{'PATH'} = (exists($ENV{PATH}) ? "$ENV{PATH}:" : "") . "/sbin:/usr/sbin:/bin:/usr/bin:/etc:/usr/lib:";
29
+$ENV{'PATH'} = (exists($ENV{PATH}) ? "$ENV{PATH}:" : "") . "/sbin:/usr/sbin:/bin:";
30
 
31
 sub T_ANY	{'any'};
32
 sub T_STRING	{'string'};
33
@@ -792,6 +793,9 @@ if (opt('foreground') || opt('force')) {
34
     ;
35
 } elsif (opt('daemon')) {
36
     $SIG{'CHLD'}   = 'IGNORE';
37
+    chdir '/';
38
+    open(STDIN,  "</dev/null");
39
+    open(STDOUT, ">/dev/null");
40
     my $pid = fork;
41
     if ($pid < 0) {
42
 	print STDERR "${program}: can not fork ($!)\n";
43
@@ -799,10 +803,9 @@ if (opt('foreground') || opt('force')) {
44
     } elsif ($pid) {
45
 	exit 0;
46
     }
47
+    setsid;
48
     $SIG{'CHLD'}   = 'DEFAULT';
49
-    open(STDOUT, ">/dev/null");
50
-    open(STDERR, ">/dev/null");
51
-    open(STDIN,  "</dev/null");
52
+    open(STDERR, "&STDOUT");
53
 }
54
 
55
 # write out the pid file if we're daemon'ized
56
@@ -1595,17 +1598,17 @@ sub pipecmd {
57
     ## execute the command.
58
     local *FD;
59
     if (! open(FD, $cmd)) {
60
-	printf STDERR "$program: cannot execute command %s.\n", $cmd;
61
+	warning("$program: cannot execute command %s.\n", $cmd);
62
 
63
     } elsif ($stdin && (! print FD "$stdin\n")) {
64
-	printf STDERR "$program: failed writting to %s.\n", $cmd;
65
+	warning("$program: failed writing to %s.\n", $cmd);
66
 	close(FD);
67
 
68
     } elsif (! close(FD)) {
69
-	printf STDERR "$program: failed closing %s.($@)\n", $cmd;
70
+	warning("$program: failed closing %s.($@)\n", $cmd);
71
 
72
     } elsif (opt('exec') && $?) {
73
-	printf STDERR "$program: failed %s. ($@)\n", $cmd;
74
+	warning("$program: failed %s. ($@)\n", $cmd);
75
 
76
     } else {
77
 	$ok = 1;
78
@@ -2034,6 +2037,7 @@ sub geturl {
79
 	    $sd = IO::Socket::SSL->new(
80
             PeerAddr => $peer,
81
             PeerPort => $port,
82
+            SSL_ca_file => '%%LOCALBASE%%/share/certs/ca-root-nss.crt',
83
             Proto => 'tcp',
84
             MultiHomed => 1,
85
             Timeout => opt('timeout'),
(-)b/dns/ddclient/files/patch-ddclient.in (+85 lines)
Added Link Here
1
--- ddclient.in.orig	2022-05-16 00:12:34 UTC
2
+++ ddclient.in
3
@@ -29,6 +29,7 @@ use Getopt::Long;
4
 use IO::Socket::INET;
5
 use Socket qw(AF_INET AF_INET6 PF_INET PF_INET6);
6
 use Sys::Hostname;
7
+use POSIX 'setsid';
8
 
9
 use version 0.77; our $VERSION = version->declare('v3.10.0_2');
10
 (my $version = $VERSION->stringify()) =~ s/^v//;
11
@@ -48,9 +49,9 @@ sub subst_var {
12
     return $subst;
13
 }
14
 
15
-my $etc = subst_var('@sysconfdir@', '/etc/ddclient');
16
-my $cachedir = subst_var('@localstatedir@', '/var') . '/cache/ddclient';
17
-my $savedir = '/tmp';
18
+my $etc = subst_var('@sysconfdir@', '%%ETCDIR%%');
19
+my $cachedir = subst_var('@localstatedir@', '/var') . '/tmp';
20
+my $savedir = '/var/tmp';
21
 if ($program =~ /test/i) {
22
     $etc = '.';
23
     $cachedir = '.';
24
@@ -68,7 +69,7 @@ use vars qw($file $lineno);
25
 local $file   = '';
26
 local $lineno = '';
27
 
28
-$ENV{'PATH'} = (exists($ENV{PATH}) ? "$ENV{PATH}:" : "") . "/sbin:/usr/sbin:/bin:/usr/bin:/etc:/usr/lib:";
29
+$ENV{'PATH'} = (exists($ENV{PATH}) ? "$ENV{PATH}:" : "") . "/sbin:/usr/sbin:/bin:";
30
 
31
 our %globals;
32
 my ($result, %config, %cache);
33
@@ -1022,6 +1023,9 @@ sub main {
34
         ;
35
     } elsif (opt('daemon')) {
36
         $SIG{'CHLD'} = 'IGNORE';
37
+        chdir '/';
38
+        open(STDIN,  "</dev/null");
39
+        open(STDOUT, ">/dev/null");
40
         my $pid = fork;
41
         if ($pid < 0) {
42
             print STDERR "${program}: can not fork ($!)\n";
43
@@ -1029,10 +1033,9 @@ sub main {
44
         } elsif ($pid) {
45
             exit 0;
46
         }
47
+        setsid;
48
         $SIG{'CHLD'} = 'DEFAULT';
49
-        open(STDOUT, ">/dev/null");
50
-        open(STDERR, ">/dev/null");
51
-        open(STDIN,  "</dev/null");
52
+        open(STDERR, "&STDOUT");
53
         write_pid();
54
     }
55
 
56
@@ -2011,17 +2014,17 @@ sub pipecmd {
57
     ## execute the command.
58
     local *FD;
59
     if (!open(FD, $cmd)) {
60
-        printf STDERR "%s: cannot execute command %s.\n", $program, $cmd;
61
+	warning("$program: cannot execute command %s.\n", $cmd);
62
 
63
     } elsif ($stdin && (!print FD "$stdin\n")) {
64
-        printf STDERR "%s: failed writting to %s.\n", $program, $cmd;
65
+	warning("$program: failed writing to %s.\n", $cmd);
66
         close(FD);
67
 
68
     } elsif (!close(FD)) {
69
-        printf STDERR "%s: failed closing %s.(%s)\n", $program, $cmd, $@;
70
+	warning("$program: failed closing %s.($@)\n", $cmd);
71
 
72
     } elsif (opt('exec') && $?) {
73
-        printf STDERR "%s: failed %s. (%s)\n", $program, $cmd, $@;
74
+	warning("$program: failed %s. ($@)\n", $cmd);
75
 
76
     } else {
77
         $ok = 1;
78
@@ -2461,6 +2464,7 @@ sub fetch_via_socket_io {
79
         PeerPort => $port,
80
         Proto => 'tcp',
81
         MultiHomed => 1,
82
+        SSL_ca_file => '%%LOCALBASE%%/share/certs/ca-root-nss.crt',
83
         Timeout => opt('timeout'),
84
     );
85
     my $socket_class = 'IO::Socket::INET';
(-)b/dns/ddclient/pkg-plist (+3 lines)
Added Link Here
1
@sample(,,600) etc/ddclient.conf.sample
2
etc/periodic/daily/ddclient_force
3
sbin/ddclient

Return to bug 267323