From 28f7a6638f751ca1601d767297e9b03b7fdc1f5a Mon Sep 17 00:00:00 2001 From: Jan Vaclav Date: Mon, 11 Sep 2023 11:42:47 +0200 Subject: [PATCH] main: don't limit upper bound of pid when checking pidfile This commit removes the upper bound check for the PID, letting NetworkManager recognize a PID from the pidfile higher than 2^16. The PID limit is often set higher than 2^16 (65536) on 64-bit systems, resulting in the pidfile being ignored and subsequently deleted if the currently running instance of NetworkManager has a pid higher than 2^16. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1727 --- src/core/main-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/main-utils.c b/src/core/main-utils.c index c6fa05c0ca..3c210896ee 100644 --- a/src/core/main-utils.c +++ b/src/core/main-utils.c @@ -174,7 +174,7 @@ nm_main_utils_ensure_not_running_pidfile(const char *pidfile) errno = 0; pid = strtol(contents, NULL, 10); - if (pid <= 0 || pid > 65536 || errno) + if (pid <= 0 || errno) return; nm_clear_g_free(&contents);