From 4ce08cf6c05f03959283904d566484a15c3b45e9 Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Mar 17 2021 08:36:13 +0000 Subject: Fix sa_mask initialization when registering PID file removal --- diff --git a/quota-4.06-quota_nld-Initialize-sa_mask-when-registering-PID-fi.patch b/quota-4.06-quota_nld-Initialize-sa_mask-when-registering-PID-fi.patch new file mode 100644 index 0000000..79bea00 --- /dev/null +++ b/quota-4.06-quota_nld-Initialize-sa_mask-when-registering-PID-fi.patch @@ -0,0 +1,34 @@ +From 25f16b1de313ce0d411f754572f94f051bfbe3c8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 16 Mar 2021 17:28:15 +0100 +Subject: [PATCH] quota_nld: Initialize sa_mask when registering PID file + removal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +term_action.sa_mask is an automatic variable and and thus unitialized. +This patch empties the signal mask. + +Signed-off-by: Petr Písař +Signed-off-by: Jan Kara +--- + quota_nld.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/quota_nld.c b/quota_nld.c +index 72d99a9..09c4775 100644 +--- a/quota_nld.c ++++ b/quota_nld.c +@@ -466,7 +466,7 @@ static void use_pid_file(void) + + term_action.sa_handler = remove_pid; + term_action.sa_flags = 0; +- if (sigaction(SIGTERM, &term_action, NULL)) ++ if (sigemptyset(&term_action.sa_mask) || sigaction(SIGTERM, &term_action, NULL)) + errstr(_("Could not register PID file removal on SIGTERM.\n")); + if (store_pid()) + errstr(_("Could not store my PID %jd.\n"), (intmax_t )getpid()); +-- +2.26.3 + diff --git a/quota.spec b/quota.spec index b2ac3dc..884c63a 100644 --- a/quota.spec +++ b/quota.spec @@ -13,7 +13,7 @@ Name: quota Epoch: 1 Version: 4.06 -Release: 4%{?dist} +Release: 5%{?dist} Summary: System administration tools for monitoring users' disk usage # quota_nld.c, quotaio_xfs.h: GPLv2 # bylabel.c copied from util-linux: GPLv2+ @@ -69,6 +69,9 @@ Patch3: quota-4.06-quotaops-fix-compilation-warning.patch Patch4: quota-4.06-quotaio_xfs-Warn-when-large-kernel-timestamps-cannot.patch # Do not use a pointless compiler-internal __P() macro, in upstream after 4.06 Patch5: quota-4.06-Drop-sys-cdefs.h-usage.patch +# Fix sa_mask initialization when registering PID file removal, +# upstream bug #141, in upstream after 4.06 +Patch6: quota-4.06-quota_nld-Initialize-sa_mask-when-registering-PID-fi.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bash @@ -195,6 +198,7 @@ Linux/UNIX environment. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 # Regenerate build scripts autoreconf -f -i @@ -344,6 +348,10 @@ make check %changelog +* Wed Mar 17 2021 Petr Pisar - 1:4.06-5 +- Fix sa_mask initialization when registering PID file removal + (upstream bug #141) + * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 1:4.06-4 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583.