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

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