slackware-current/source/n/NetworkManager/patches/9cc2591fe871b29ce9a743dfb2cd189cb1580bde.dhcpcd.graceful.exit.patch
Patrick J Volkerding 253d995a9a Thu Mar 10 02:30:54 UTC 2022
a/logrotate-3.19.0-x86_64-1.txz:  Upgraded.
a/sysfsutils-2.1.1-x86_64-1.txz:  Upgraded.
l/adwaita-icon-theme-41.0-noarch-1.txz:  Upgraded.
l/gsettings-desktop-schemas-41.0-x86_64-1.txz:  Upgraded.
n/NetworkManager-1.36.2-x86_64-1.txz:  Upgraded.
n/ca-certificates-20220309-noarch-1.txz:  Upgraded.
  This update provides the latest CA certificates to check for the
  authenticity of SSL connections.
n/dhcp-4.4.3-x86_64-1.txz:  Upgraded.
xap/mozilla-thunderbird-91.7.0-x86_64-1.txz:  Upgraded.
  This release contains security fixes and improvements.
  For more information, see:
    https://www.mozilla.org/en-US/thunderbird/91.7.0/releasenotes/
    https://www.mozilla.org/en-US/security/advisories/mfsa2022-12/
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-26383
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-26384
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-26387
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-26381
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-26386
  (* Security fix *)
2022-03-10 06:59:43 +01:00

88 lines
3.4 KiB
Diff

--- ./src/core/dhcp/nm-dhcp-client.h.orig 2022-03-06 07:02:58.000000000 -0600
+++ ./src/core/dhcp/nm-dhcp-client.h 2022-03-09 15:07:05.974017045 -0600
@@ -260,7 +260,7 @@
/* Backend helpers for subclasses */
void nm_dhcp_client_stop_existing(const char *pid_file, const char *binary_name);
-void nm_dhcp_client_stop_pid(pid_t pid, const char *iface);
+void nm_dhcp_client_stop_pid(pid_t pid, const char *iface, int sig);
void nm_dhcp_client_start_timeout(NMDhcpClient *self);
--- ./src/core/dhcp/nm-dhcp-dhcpcd.c.orig 2022-02-23 09:40:42.000000000 -0600
+++ ./src/core/dhcp/nm-dhcp-dhcpcd.c 2022-03-09 15:07:05.974017045 -0600
@@ -158,31 +158,17 @@
{
NMDhcpDhcpcd *self = NM_DHCP_DHCPCD(client);
pid_t pid;
- int sig, errsv;
+ int sig;
pid = nm_dhcp_client_get_pid(client);
if (pid > 1) {
sig = release ? SIGALRM : SIGTERM;
_LOGD("sending %s to dhcpcd pid %d", sig == SIGALRM ? "SIGALRM" : "SIGTERM", pid);
- /* dhcpcd-9.x features privilege separation.
- * It's not our job to track all these processes so we rely on dhcpcd
- * to always cleanup after itself.
- * Because it also re-parents itself to PID 1, the process cannot be
- * reaped or waited for.
- * As such, just send the correct signal.
- */
- if (kill(pid, sig) == -1) {
- errsv = errno;
- _LOGE("failed to kill dhcpcd %d:%s", errsv, strerror(errsv));
- }
-
- /* When this function exits NM expects the PID to be -1.
- * This means we also need to stop watching the pid.
- * If we need to know the exit status then we need to refactor NM
- * to allow a non -1 to mean we're waiting to exit still.
- */
+ /* We need to remove the watch before stopping the process */
nm_dhcp_client_stop_watch_child(client, pid);
+
+ nm_dhcp_client_stop_pid(pid, nm_dhcp_client_get_iface(client), sig);
}
}
--- ./src/core/dhcp/nm-dhcp-dhclient.c.orig 2022-02-23 09:40:42.000000000 -0600
+++ ./src/core/dhcp/nm-dhcp-dhclient.c 2022-03-09 15:07:05.974017045 -0600
@@ -617,7 +617,7 @@
if (dhclient_start(client, NULL, TRUE, &rpid, NULL)) {
/* Wait a few seconds for the release to happen */
- nm_dhcp_client_stop_pid(rpid, nm_dhcp_client_get_iface(client));
+ nm_dhcp_client_stop_pid(rpid, nm_dhcp_client_get_iface(client), SIGTERM);
}
}
}
--- ./src/core/dhcp/nm-dhcp-client.c.orig 2022-03-06 07:02:58.000000000 -0600
+++ ./src/core/dhcp/nm-dhcp-client.c 2022-03-09 15:08:51.964019416 -0600
@@ -204,14 +204,14 @@
}
void
-nm_dhcp_client_stop_pid(pid_t pid, const char *iface)
+nm_dhcp_client_stop_pid(pid_t pid, const char *iface, int sig)
{
char *name = iface ? g_strdup_printf("dhcp-client-%s", iface) : NULL;
g_return_if_fail(pid > 1);
nm_utils_kill_child_sync(pid,
- SIGTERM,
+ sig,
LOGD_DHCP,
name ?: "dhcp-client",
NULL,
@@ -232,7 +232,7 @@
if (priv->pid > 0) {
/* Clean up the watch handler since we're explicitly killing the daemon */
watch_cleanup(self);
- nm_dhcp_client_stop_pid(priv->pid, priv->config.iface);
+ nm_dhcp_client_stop_pid(priv->pid, priv->config.iface, SIGTERM);
}
priv->pid = -1;
}