Files
ntp/ntp-check-argv.patch
Reinhard Max 53b6e122a1 - Update to 4.2.8p18
* obsoletes Get-rid-of-EVP_MD_CTX_FLAG_NON_FIPS_ALLOW.patch
  * Multiple bug fixes and improvements. For details, see:
    /usr/share/doc/packages/ntp/ChangeLog
    http://www.ntp.org/support/securitynotice/4_2_8-series-changelog/  
- bsc#1233890: chown refclock device to ntp user on startup.
- ntp-check-argv.patch: Improve the handling of the process name of
  the forked-off DNS resolver process.

OBS-URL: https://build.opensuse.org/package/show/network:time/ntp?expand=0&rev=227
2025-02-05 17:21:36 +00:00

30 lines
822 B
Diff

--- libntp/work_fork.c.orig
+++ libntp/work_fork.c
@@ -543,17 +543,21 @@ fork_blocking_child(
/*
* Change the process name of the child to avoid confusion
- * about ntpd trunning twice.
+ * about ntpd running twice.
*/
if (saved_argc != 0) {
int argcc;
int argvlen = 0;
- /* Clear argv */
+ char *end_of_argv = saved_argv[0];
+ /* Check that argv is contiguous, measure and clear it */
for (argcc = 0; argcc < saved_argc; argcc++) {
- int l = strlen(saved_argv[argcc]);
- argvlen += l + 1;
- memset(saved_argv[argcc], 0, l);
+ if (end_of_argv == saved_argv[argcc]) {
+ end_of_argv += strlen(saved_argv[argcc]) + 1;
+ }
}
+ argvlen = end_of_argv - saved_argv[0];
+ memset(saved_argv[0], 0, argvlen);
+
strlcpy(saved_argv[0], "ntpd: asynchronous dns resolver", argvlen);
}