Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR: 266415 Reported by: fbsd-bugzilla@schlachter.ca Approved by: mjl@luckie.org.nz (maintainer)
- Loading branch information
Showing
5 changed files
with
93 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TIMESTAMP = 1603527045 | ||
SHA256 (ddclient-ddclient-v3.9.1_GH0.tar.gz) = e4969e15cc491fc52bdcd649d4c2b0e4b1bf0c9f9dba23471c634871acc52470 | ||
SIZE (ddclient-ddclient-v3.9.1_GH0.tar.gz) = 63469 | ||
TIMESTAMP = 1700741617 | ||
SHA256 (ddclient-ddclient-v3.11.2_GH0.tar.gz) = 243cd832abd3cdd2b49903e1b5ed7f450e2d9c4c0eaf8ce4fe692c244d3afd77 | ||
SIZE (ddclient-ddclient-v3.11.2_GH0.tar.gz) = 278314 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- ddclient.in.orig 2023-10-25 19:22:47 UTC | ||
+++ ddclient.in | ||
@@ -20,6 +20,7 @@ use File::Path qw(make_path); | ||
use File::Temp; | ||
use Getopt::Long; | ||
use Sys::Hostname; | ||
+use POSIX 'setsid'; | ||
|
||
use version 0.77; our $VERSION = version->declare('3.11.1'); | ||
my $version = $VERSION->stringify(); | ||
@@ -39,9 +40,9 @@ sub subst_var { | ||
return $subst; | ||
} | ||
|
||
-my $etc = subst_var('@sysconfdir@', '/etc/ddclient'); | ||
-my $cachedir = subst_var('@localstatedir@', '/var') . '/cache/ddclient'; | ||
-my $savedir = '/tmp'; | ||
+my $etc = subst_var('@sysconfdir@', '/usr/local/etc'); | ||
+my $cachedir = subst_var('@localstatedir@', '/var') . '/tmp'; | ||
+my $savedir = '/var/tmp'; | ||
if ($program =~ /test/i) { | ||
$etc = '.'; | ||
$cachedir = '.'; | ||
@@ -59,7 +60,7 @@ use vars qw($file $lineno); | ||
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/local/sbin:/bin:"; | ||
|
||
our %globals; | ||
my ($result, %config, %cache); | ||
@@ -1131,6 +1132,9 @@ sub main { | ||
; | ||
} elsif (opt('daemon')) { | ||
$SIG{'CHLD'} = 'IGNORE'; | ||
+ chdir '/'; | ||
+ open(STDIN, "</dev/null"); | ||
+ open(STDOUT, ">/dev/null"); | ||
my $pid = fork; | ||
if ($pid < 0) { | ||
print STDERR "${program}: can not fork ($!)\n"; | ||
@@ -1138,10 +1142,9 @@ sub main { | ||
} elsif ($pid) { | ||
exit 0; | ||
} | ||
+ setsid; | ||
$SIG{'CHLD'} = 'DEFAULT'; | ||
- open(STDOUT, ">/dev/null"); | ||
- open(STDERR, ">/dev/null"); | ||
- open(STDIN, "</dev/null"); | ||
+ open(STDERR, "&STDOUT"); | ||
write_pid(); | ||
} | ||
|
||
@@ -2164,17 +2167,17 @@ sub pipecmd { | ||
## execute the command. | ||
local *FD; | ||
if (!open(FD, $cmd)) { | ||
- printf STDERR "%s: cannot execute command %s.\n", $program, $cmd; | ||
+ warning("$program: cannot execute command %s.\n", $cmd); | ||
|
||
} elsif ($stdin && (!print FD "$stdin\n")) { | ||
- printf STDERR "%s: failed writting to %s.\n", $program, $cmd; | ||
+ warning("$program: failed writing to %s.\n", $cmd); | ||
close(FD); | ||
|
||
} elsif (!close(FD)) { | ||
- printf STDERR "%s: failed closing %s.(%s)\n", $program, $cmd, $@; | ||
+ warning("$program: failed closing %s.($@)\n", $cmd); | ||
|
||
} elsif (opt('exec') && $?) { | ||
- printf STDERR "%s: failed %s. (%s)\n", $program, $cmd, $@; | ||
+ warning("$program: failed %s. ($@)\n", $cmd); | ||
|
||
} else { | ||
$ok = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@sample(,,600) etc/ddclient.conf.sample | ||
etc/periodic/daily/ddclient_force | ||
sbin/ddclient |