Blame SOURCES/freeradius-Fix-resource-hard-limit-error.patch

80a797
commit 1ce4508c92493cf03ea1b3c42e83540b387884fa
80a797
Author: Antonio Torres <antorres@redhat.com>
80a797
Date:   Fri Jul 2 07:12:48 2021 -0400
80a797
Subject: [PATCH] debug: don't set resource hard limit to zero
80a797
80a797
    Setting the resource hard limit to zero is irreversible, meaning if it
80a797
    is set to zero then there is no way to set it higher. This means
80a797
    enabling core dump is not possible, since setting a new resource limit
80a797
    for RLIMIT_CORE would fail. By only setting the soft limit to zero, we
80a797
    can disable and enable core dumps without failures.
80a797
80a797
    This fix is present in both main and 3.0.x upstream branches.
80a797
    
80a797
    Ticket in RHEL Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1977572
80a797
    Signed-off-by: Antonio Torres antorres@redhat.com
80a797
---
80a797
 src/lib/debug.c | 2 +-
80a797
 1 file changed, 1 insertion(+), 1 deletion(-)
80a797
80a797
diff --git a/src/lib/debug.c b/src/lib/debug.c
80a797
index 576bcb2a65..6330c9cb66 100644
80a797
--- a/src/lib/debug.c
80a797
+++ b/src/lib/debug.c
80a797
@@ -599,7 +599,7 @@ int fr_set_dumpable(bool allow_core_dumps)
80a797
 		struct rlimit no_core;
80a797
 
80a797
 		no_core.rlim_cur = 0;
80a797
-		no_core.rlim_max = 0;
80a797
+		no_core.rlim_max = core_limits.rlim_max;
80a797
 
80a797
 		if (setrlimit(RLIMIT_CORE, &no_core) < 0) {
80a797
 			fr_strerror_printf("Failed disabling core dumps: %s", fr_syserror(errno));