View | Details | Raw Unified | Return to bug 266415 | Differences between
and this patch

Collapse All | Expand All

(-)ddclient-new/Makefile (-14 / +10 lines)
Lines 1-6 Link Here
1
PORTNAME=	ddclient
1
PORTNAME=	ddclient
2
DISTVERSIONPREFIX=	v
2
DISTVERSIONPREFIX=	v
3
DISTVERSION=	3.9.1
3
DISTVERSION=	3.11.1
4
CATEGORIES=	dns
4
CATEGORIES=	dns
5
5
6
MAINTAINER=	mjl@luckie.org.nz
6
MAINTAINER=	mjl@luckie.org.nz
Lines 10-49 Link Here
10
LICENSE=	GPLv2+
10
LICENSE=	GPLv2+
11
LICENSE_FILE=	${WRKSRC}/COPYING
11
LICENSE_FILE=	${WRKSRC}/COPYING
12
12
13
RUN_DEPENDS=	p5-Data-Validate-IP>0:net-mgmt/p5-Data-Validate-IP
13
BUILD_DEPENDS=	curl:ftp/curl
14
RUN_DEPENDS=	p5-Data-Validate-IP>0:net-mgmt/p5-Data-Validate-IP \
15
		curl:ftp/curl
14
16
15
USES=		perl5 tar:bzip2
17
USES=		autoreconf gmake perl5 tar:bzip2
18
GNU_CONFIGURE=	yes
16
USE_GITHUB=	yes
19
USE_GITHUB=	yes
17
USE_PERL5=	run
20
USE_PERL5=	run
18
USE_RC_SUBR=	${PORTNAME}
21
USE_RC_SUBR=	${PORTNAME}
19
22
20
NO_ARCH=	yes
23
NO_ARCH=	yes
21
NO_BUILD=	yes
22
SUB_FILES=	pkg-message ddclient_force
24
SUB_FILES=	pkg-message ddclient_force
23
25
24
PLIST_FILES=	"@sample(,,600) etc/ddclient.conf.sample" \
26
PLIST_FILES=	"@sample(,,600) etc/ddclient.conf.sample" \
25
		etc/periodic/daily/ddclient_force \
27
		etc/periodic/daily/ddclient_force \
26
		sbin/ddclient
28
		sbin/ddclient
27
PORTDOCS=	COPYRIGHT ChangeLog README.cisco README.ssl README.md \
29
PORTDOCS=	COPYRIGHT ChangeLog README.cisco README.md \
28
		sample-etc_cron.d_ddclient sample-etc_dhclient-exit-hooks \
30
		sample-etc_cron.d_ddclient sample-etc_dhclient-exit-hooks \
29
		sample-etc_dhcpc_dhcpcd-eth0.exe sample-etc_ppp_ip-up.local
31
		sample-etc_dhcpc_dhcpcd-eth0.exe sample-etc_ppp_ip-up.local
30
32
31
OPTIONS_DEFINE=	SSL DOCS
33
OPTIONS_DEFINE=	DOCS
32
OPTIONS_DEFAULT=SSL
33
34
34
SSL_RUN_DEPENDS=ca_root_nss>0:security/ca_root_nss \
35
		p5-IO-Socket-SSL>0:security/p5-IO-Socket-SSL
36
37
post-patch:
35
post-patch:
38
	@${GREP} -lR '/usr' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \
36
	@${GREP} -lR '/usr' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \
39
		's|/usr|${PREFIX}|g'
37
		's|/usr|${PREFIX}|g'
40
	@${REINPLACE_CMD} -e 's|%%ETCDIR%%|${PREFIX}/etc| ; \
38
	@${REINPLACE_CMD} -e 's|%%ETCDIR%%|${PREFIX}/etc| ; \
41
		 s|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/ddclient
39
		 s|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/ddclient.in
42
	@${REINPLACE_CMD} -e '/^\#\!\/usr\/local\/local/d' \
43
		${WRKSRC}/ddclient
44
40
45
do-install:
41
do-install:
46
	(cd ${WRKSRC} && ${INSTALL_DATA} sample-etc_ddclient.conf \
42
	(cd ${WRKSRC} && ${INSTALL_DATA} ddclient.conf \
47
		${STAGEDIR}${PREFIX}/etc/ddclient.conf.sample)
43
		${STAGEDIR}${PREFIX}/etc/ddclient.conf.sample)
48
	(cd ${WRKSRC} && ${INSTALL_SCRIPT} ddclient \
44
	(cd ${WRKSRC} && ${INSTALL_SCRIPT} ddclient \
49
		${STAGEDIR}${PREFIX}/sbin)
45
		${STAGEDIR}${PREFIX}/sbin)
(-)ddclient-new/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1603527045
1
TIMESTAMP = 1700189235
2
SHA256 (ddclient-ddclient-v3.9.1_GH0.tar.gz) = e4969e15cc491fc52bdcd649d4c2b0e4b1bf0c9f9dba23471c634871acc52470
2
SHA256 (ddclient-ddclient-v3.11.1_GH0.tar.gz) = 5eb5ca4118f14ae219da09e82dac39e0255048518a56311b2e9ec392505edd11
3
SIZE (ddclient-ddclient-v3.9.1_GH0.tar.gz) = 63469
3
SIZE (ddclient-ddclient-v3.11.1_GH0.tar.gz) = 277452
(-)ddclient-new/files/patch-ddclient (-85 lines)
Lines 1-85 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'),
(-)ddclient-new/files/patch-ddclient.in (+77 lines)
Line 0 Link Here
1
--- ddclient.in.orig	2023-10-25 19:22:47 UTC
2
+++ ddclient.in
3
@@ -20,6 +20,7 @@ use File::Path qw(make_path);
4
 use File::Temp;
5
 use Getopt::Long;
6
 use Sys::Hostname;
7
+use POSIX 'setsid';
8
 
9
 use version 0.77; our $VERSION = version->declare('3.11.1');
10
 my $version = $VERSION->stringify();
11
@@ -39,9 +40,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@', '/usr/local/etc');
19
+my $cachedir = subst_var('@localstatedir@', '/var') . '/tmp';
20
+my $savedir = '/var/tmp';
21
 if ($program =~ /test/i) {
22
     $etc = '.';
23
     $cachedir = '.';
24
@@ -59,7 +60,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/local/sbin:/bin:";
30
 
31
 our %globals;
32
 my ($result, %config, %cache);
33
@@ -1131,6 +1132,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
@@ -1138,10 +1142,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
@@ -2164,17 +2167,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;

Return to bug 266415