ports/core (3.6): start-stop-daemon: update to 20200811, sync with upstream
![](https://secure.gravatar.com/avatar/df8330968b6df8cd1c1942c5fb4b720c.jpg?s=120&d=mm&r=g)
commit 361139d84e323daff107bf073f153963fbc68a43 Author: Steffen Nurpmeso <steffen@sdaoden.eu> Date: Tue Aug 11 15:49:50 2020 +0000 start-stop-daemon: update to 20200811, sync with upstream diff --git a/start-stop-daemon/.signature b/start-stop-daemon/.signature index dd560e8e..be715434 100644 --- a/start-stop-daemon/.signature +++ b/start-stop-daemon/.signature @@ -1,8 +1,8 @@ untrusted comment: verify with /etc/ports/core.pub -RWRJc1FUaeVeqojKcxHezTRN2pg696qEuLdrzcK6jg+RHdOphMR4SD6iO2YLgU+yDev3JJ75i6gfJwDGR6XtCmDUm2s4CMqBiQ0= -SHA256 (Pkgfile) = d797de1ea9510f18a9e967d0327773de95b0ca79833c5f1bfb35f0b46786c20f +RWRJc1FUaeVeqtzIP5R7BRVnVyT9uoMyWkuSFh2vdov+LPYO9KSxLhQHpmcK+9iXsCBkqyJP9SfsG936QWlEj3XT9JGve77O+Qc= +SHA256 (Pkgfile) = d512505d65536c5810b0339c88617b37626363be627a41c35775abb788911db8 SHA256 (.footprint) = a24924dba386364cd2326ad6abefd3be01927f37f8f2175b3f56845fc88bfb79 -SHA256 (start-stop-daemon.c) = 1edfa71d4b8d579d5db72edaa803ef1854d7e3dd9b58ac000df6bc6c4e7c6320 +SHA256 (start-stop-daemon.c) = 880baaaf05be96a9b1c56cd9e41dbce0624f059209535569a6a3ae9dcb91a1e2 SHA256 (start-stop-daemon.8) = 6920da66e820b7d210514660756b566f4a36c791178ed26e67fbdaf7315408fa -SHA256 (crux-patch.diff) = d5fd19777861182f00d0471ce2122c603bb2ebdf014a4f1b422878883c53dd49 +SHA256 (crux-patch.diff) = 1a02209ee0683cd789577417dbeb3299a5cd72a908af5bd5b3ec743c0629dcc2 SHA256 (makefile) = 7ce6e34d7473e965a55ccabf195468cf53f0c49a6d344bc41cd545b2ff8a5485 diff --git a/start-stop-daemon/Pkgfile b/start-stop-daemon/Pkgfile index e6254e31..bcac2823 100644 --- a/start-stop-daemon/Pkgfile +++ b/start-stop-daemon/Pkgfile @@ -3,12 +3,12 @@ # Maintainer: CRUX System Team, core-ports at crux dot nu name=start-stop-daemon -version=20190310 -release=2 +version=20200811 +release=1 source=(start-stop-daemon.c start-stop-daemon.8 crux-patch.diff makefile) build () { - patch -p0 -i crux-patch.diff + patch -p1 -i crux-patch.diff make install -d $PKG/{sbin,usr/share/man/man8} install -m 755 $name $PKG/sbin/ diff --git a/start-stop-daemon/crux-patch.diff b/start-stop-daemon/crux-patch.diff index a6bc4293..5e580ab4 100644 --- a/start-stop-daemon/crux-patch.diff +++ b/start-stop-daemon/crux-patch.diff @@ -1,15 +1,17 @@ ---- start-stop-daemon.8.orig 2020-08-11 09:18:30.855173650 +0000 -+++ start-stop-daemon.8 2020-08-11 09:18:59.687682548 +0000 +diff --git a/start-stop-daemon.8 b/start-stop-daemon.8 +index 2a083f3..bbeb0f6 100644 +--- a/start-stop-daemon.8 ++++ b/start-stop-daemon.8 @@ -20,7 +20,7 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see <https://www.gnu.org/licenses/>. . -.TH start\-stop\-daemon 8 "%RELEASE_DATE%" "%VERSION%" "dpkg suite" -+.TH start\-stop\-daemon 8 "2019-03-10" "CRUX 3.5" "dpkg suite" ++.TH start\-stop\-daemon 8 "2020-08-11" "CRUX 3.6" "dpkg suite" .nh .SH NAME start\-stop\-daemon \- start and stop system daemon programs -@@ -269,33 +269,6 @@ +@@ -269,33 +269,6 @@ reason. This is a last resort, and is only meant for programs that either make no sense forking on their own, or where it's not feasible to add the code for them to do this themselves. .TP @@ -43,8 +45,10 @@ .BR \-C ", " \-\-no\-close Do not close any file descriptor when forcing the daemon into the background (since version 1.16.5). ---- start-stop-daemon.c.orig 2020-08-11 09:18:38.031635113 +0000 -+++ start-stop-daemon.c 2020-08-11 09:20:15.932117049 +0000 +diff --git a/start-stop-daemon.c b/start-stop-daemon.c +index 3947cc0..1e0e163 100644 +--- a/start-stop-daemon.c ++++ b/start-stop-daemon.c @@ -20,10 +20,36 @@ * Changes by Ian Jackson: added --retry (and associated rearrangements). */ @@ -55,7 +59,7 @@ #include <dpkg/macros.h> +#else -+# define VERSION "20190310" ++# define VERSION "20200811" +# define CRUX "CRUX-Linux" + +# define WANT_SYSTEMD_NOTIFY 0 /* 1=yes */ @@ -93,7 +97,7 @@ #define IOPRIO_CLASS_SHIFT 13 #define IOPRIO_PRIO_VALUE(class, prio) (((class) << IOPRIO_CLASS_SHIFT) | (prio)) #define IO_SCHED_PRIO_MIN 0 -@@ -212,10 +242,12 @@ +@@ -212,10 +242,12 @@ static int quietmode = 0; static int exitnodo = 1; static bool background = false; static bool close_io = true; @@ -106,7 +110,7 @@ static bool mpidfile = false; static bool rpidfile = false; static int signal_nr = SIGTERM; -@@ -405,8 +437,7 @@ +@@ -405,8 +437,7 @@ xstrndup(const char *str, size_t n) static void timespec_gettime(struct timespec *ts) { @@ -116,7 +120,7 @@ if (clock_gettime(CLOCK_MONOTONIC, ts) < 0) fatale("clock_gettime failed"); #else -@@ -548,6 +579,7 @@ +@@ -548,6 +579,7 @@ wait_for_child(pid_t pid) } } @@ -124,7 +128,7 @@ static void cleanup_socket_dir(void) { -@@ -737,6 +769,7 @@ +@@ -737,6 +769,7 @@ wait_for_notify(int fd) } } } @@ -132,7 +136,7 @@ static void write_pidfile(const char *filename, pid_t pid) -@@ -769,7 +802,9 @@ +@@ -769,7 +802,9 @@ remove_pidfile(const char *filename) static void daemonize(void) { @@ -142,7 +146,7 @@ pid_t pid; sigset_t mask; sigset_t oldmask; -@@ -783,8 +818,10 @@ +@@ -783,8 +818,10 @@ daemonize(void) if (sigprocmask(SIG_BLOCK, &mask, &oldmask) == -1) fatale("cannot block SIGCHLD"); @@ -153,7 +157,7 @@ pid = fork(); if (pid < 0) -@@ -795,6 +832,7 @@ +@@ -795,6 +832,7 @@ daemonize(void) * not suffer from race conditions on return. */ wait_for_child(pid); @@ -161,7 +165,7 @@ if (notify_await) { /* Wait for a readiness notification from the second * child, so that we can safely exit when the service -@@ -803,6 +841,7 @@ +@@ -803,13 +841,16 @@ daemonize(void) close(notify_fd); cleanup_socket_dir(); } @@ -169,7 +173,16 @@ _exit(0); } -@@ -901,8 +940,10 @@ + + /* Close the notification socket, even though it is close-on-exec. */ ++#if WANT_SYSTEMD_NOTIFY + if (notify_await) + close(notify_fd); ++#endif + + /* Create a new session. */ + if (setsid() < 0) +@@ -905,8 +946,10 @@ usage(void) " scheduler (default prio is 4)\n" " -k, --umask <mask> change the umask to <mask> before starting\n" " -b, --background force the process to detach\n" @@ -180,7 +193,7 @@ " -C, --no-close do not close any file descriptor\n" " -m, --make-pidfile create the pidfile before starting\n" " --remove-pidfile delete the pidfile after stopping\n" -@@ -947,9 +988,9 @@ +@@ -951,9 +994,9 @@ usage(void) static void do_version(void) { @@ -193,7 +206,7 @@ } static void DPKG_ATTR_NORET -@@ -1274,8 +1315,10 @@ +@@ -1278,8 +1321,10 @@ parse_options(int argc, char * const *argv) { "iosched", 1, NULL, 'I'}, { "umask", 1, NULL, 'k'}, { "background", 0, NULL, 'b'}, @@ -204,7 +217,7 @@ { "no-close", 0, NULL, 'C'}, { "make-pidfile", 0, NULL, 'm'}, { "remove-pidfile", 0, NULL, OPT_RM_PIDFILE}, -@@ -1290,7 +1333,9 @@ +@@ -1294,7 +1339,9 @@ parse_options(int argc, char * const *argv) const char *schedule_str = NULL; const char *proc_schedule_str = NULL; const char *io_schedule_str = NULL; @@ -214,7 +227,7 @@ size_t changeuser_len; int c; -@@ -1390,12 +1435,14 @@ +@@ -1395,12 +1442,14 @@ parse_options(int argc, char * const *argv) case 'b': /* --background */ background = true; break; @@ -229,7 +242,7 @@ case 'C': /* --no-close */ close_io = false; break; -@@ -1448,9 +1495,11 @@ +@@ -1453,9 +1502,11 @@ parse_options(int argc, char * const *argv) badusage("umask value must be a positive number"); } @@ -241,7 +254,7 @@ if (action == ACTION_NONE) badusage("need one of --start or --stop or --status"); -@@ -2298,7 +2347,8 @@ +@@ -2303,7 +2354,8 @@ do_pidfile(const char *name) if (match_mode == MATCH_PIDFILE && ((st.st_uid != getuid() && st.st_uid != 0) || diff --git a/start-stop-daemon/start-stop-daemon.c b/start-stop-daemon/start-stop-daemon.c index 88c97266..3947cc06 100644 --- a/start-stop-daemon/start-stop-daemon.c +++ b/start-stop-daemon/start-stop-daemon.c @@ -551,8 +551,8 @@ wait_for_child(pid_t pid) static void cleanup_socket_dir(void) { - unlink(notify_socket); - rmdir(notify_sockdir); + (void)unlink(notify_socket); + (void)rmdir(notify_sockdir); } static char * @@ -593,7 +593,7 @@ set_socket_passcred(int fd) #ifdef SO_PASSCRED static const int enable = 1; - setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &enable, sizeof(enable)); + (void)setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &enable, sizeof(enable)); #endif } @@ -807,6 +807,10 @@ daemonize(void) _exit(0); } + /* Close the notification socket, even though it is close-on-exec. */ + if (notify_await) + close(notify_fd); + /* Create a new session. */ if (setsid() < 0) fatale("cannot set session ID"); @@ -1359,6 +1363,7 @@ parse_options(int argc, char * const *argv) execname = optarg; break; case 'c': /* --chuid <username>|<uid> */ + free(changeuser); /* We copy the string just in case we need the * argument later. */ changeuser_len = strcspn(optarg, ":");
participants (1)
-
crux@crux.nu