+---
+* [Bug 3062] Change the process name of forked DNS worker <perlinger@ntp.org>
+ - applied patch by Reinhard Max. See bugzilla for limitations.
+
---
(4.2.8p9) 2016/11/21 Released by Harlan Stenn <stenn@ntp.org>
-(4.2.8p9) 2016/MM/DD Released by Harlan Stenn <stenn@ntp.org>
* [Sec 3119] Trap crash <perlinger@ntp.org>
* [Sec 3118] Mode 6 information disclosure and DDoS vector <perlinger@ntp.org>
/* ntp_config.c */
extern char const * progname;
+extern int saved_argc;
+extern char **saved_argv;
extern char *sys_phone[]; /* ACTS phone numbers */
#if defined(HAVE_SCHED_SETSCHEDULER)
extern int config_priority_override;
int worker_process;
addremove_io_fd_func addremove_io_fd;
static volatile int worker_sighup_received;
+int saved_argc = 0;
+char **saved_argv;
/* === function prototypes === */
static void fork_blocking_child(blocking_child *);
c->pid = getpid();
worker_process = TRUE;
+ /*
+ * Change the process name of the child to avoid confusion
+ * about ntpd trunning twice.
+ */
+ if (saved_argc != 0) {
+ int argcc;
+ int argvlen = 0;
+ /* Clear argv */
+ for (argcc = 0; argcc < saved_argc; argcc++) {
+ int l = strlen(saved_argv[argcc]);
+ argvlen += l + 1;
+ memset(saved_argv[argcc], 0, l);
+ }
+ strlcpy(saved_argv[0], "ntpd: asynchronous dns resolver", argvlen);
+ }
+
/*
* In the child, close all files except stdin, stdout, stderr,
* and the two child ends of the pipes.