From d40760f1483e603bff8eb793646d35d4a232909a Mon Sep 17 00:00:00 2001 From: renmingshuai Date: Thu, 29 Jun 2023 10:16:19 +0800 Subject: [PATCH] revert the correction about the logic in dhclient (cherry picked from commit a4be069f3417d8b13a7e236a7ea5e6afb4fce376) --- Revert-correcting-the-logic-in-dhclient.patch | 67 +++++++++++++++++++ dhcp.spec | 9 ++- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 Revert-correcting-the-logic-in-dhclient.patch diff --git a/Revert-correcting-the-logic-in-dhclient.patch b/Revert-correcting-the-logic-in-dhclient.patch new file mode 100644 index 0000000..4e44132 --- /dev/null +++ b/Revert-correcting-the-logic-in-dhclient.patch @@ -0,0 +1,67 @@ +From dbb9d0302f7f5009a871844d6648ea131a3df6b4 Mon Sep 17 00:00:00 2001 +From: renmingshuai +Date: Thu, 29 Jun 2023 10:04:49 +0800 +Subject: [PATCH] revert the correction about the logic in dhclient + +Reference:https://gitlab.isc.org/isc-projects/dhcp/-/commit/33e517615f8467a005de2ca2633f52bad323ec2b + https://gitlab.isc.org/isc-projects/dhcp/-/commit/e180ae075ecc989b6b75202d58363f96a8ce0167 +--- + RELNOTES | 4 ---- + client/dhclient.c | 19 +++++-------------- + 2 files changed, 5 insertions(+), 18 deletions(-) + +diff --git a/RELNOTES b/RELNOTES +index 64d45b2..54ad022 100644 +--- a/RELNOTES ++++ b/RELNOTES +@@ -51,10 +51,6 @@ by Eric Young (eay@cryptsoft.com). + - Minor corrections were made to allow compilation under gcc 10. + [GitLab #117] + +-- The logic in dhclient that causes it to decline DHCPv4 leases if the +- client script exits abnormally (i.e. crashes) has been corrected. +- [GitLab #123] +- + - The limit on the size of a lease file that can be loaded at startup + is now only enforced on 32-bit systems. + [GitLab #92] +diff --git a/client/dhclient.c b/client/dhclient.c +index d20ba66..d39cb5c 100644 +--- a/client/dhclient.c ++++ b/client/dhclient.c +@@ -2106,12 +2106,9 @@ void bind_lease (client) + script_write_params(client, "alias_", client->alias); + + /* If the BOUND/RENEW code detects another machine using the +- offered address, then per our man page it should exit with +- a non-zero status, to which we send a DHCPDECLINE and toss +- the lease. A return value of less than zero indicates +- the script crashed (e.g. segfault) which script_go will log +- but we will ignore here. */ +- if (script_go(client) > 0) { ++ offered address, it exits nonzero. We need to send a ++ DHCPDECLINE and toss the lease. */ ++ if (script_go(client)) { + make_decline(client, client->new); + send_decline(client); + destroy_client_lease(client->new); +@@ -5184,14 +5181,8 @@ int script_go(struct client_state *client) + } + dfree (envp, MDL); + gettimeofday(&cur_tv, NULL); +- +- if (!WIFEXITED(wstatus)) { +- int sigval = WTERMSIG(wstatus); +- log_error ("script_go script: %s was terminated by signal %d", scriptName, sigval); +- return (-sigval); +- } +- +- return (WEXITSTATUS(wstatus)); ++ return (WIFEXITED (wstatus) ? ++ WEXITSTATUS (wstatus) : -WTERMSIG (wstatus)); + } + + void client_envadd (struct client_state *client, +-- +2.23.0 + diff --git a/dhcp.spec b/dhcp.spec index 8c43806..d2a5b5c 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -3,7 +3,7 @@ Name: dhcp Version: 4.4.3 -Release: 2 +Release: 3 Summary: Dynamic host configuration protocol software #Please don't change the epoch on this package Epoch: 12 @@ -58,6 +58,7 @@ Patch37: bugfix-error-message-display.patch Patch38: backport-Fix-CVE-2021-25220.patch Patch39: backport-Fix-CVE-2022-2928.patch Patch40: backport-Fix-CVE-2022-2929.patch +Patch41: Revert-correcting-the-logic-in-dhclient.patch BuildRequires: gcc autoconf automake libtool openldap-devel krb5-devel libcap-ng-devel BuildRequires: systemd systemd-devel @@ -306,6 +307,12 @@ exit 0 %{_mandir}/man3/omapi.3.gz %changelog +* Thu Jun 29 2023 renmingshuai - 12:4.4.3-3 +- Type:bugfix +- ID: +- SUG:restart +- DESC:revert the correction about the logic in dhclient + * Sat May 27 2023 renmingshuai - 12:4.4.3-2 - Type:bugfix - ID:NA -- Gitee