]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Setting the resource hard limit to zero is irreversible, meaning if it
authorAntonio Torres <antorres@redhat.com>
Fri, 2 Jul 2021 11:12:48 +0000 (07:12 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 2 Jul 2021 11:13:03 +0000 (07:13 -0400)
is set to zero then there is no way to set it higher. This means
enabling core dump is not possible, since setting a new resource limit
for RLIMIT_CORE would fail. By only setting the soft limit to zero, we
can disable and enable core dumps without failures.

Ticket in RHEL Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1977572
Signed-off-by: Antonio Torres antorres@redhat.com
src/lib/debug.c

index 576bcb2a6518da666a1acd92ef42ce7555cd9bd8..6330c9cb66d4831257c798857da3247c42c37101 100644 (file)
@@ -599,7 +599,7 @@ int fr_set_dumpable(bool allow_core_dumps)
                struct rlimit no_core;
 
                no_core.rlim_cur = 0;
-               no_core.rlim_max = 0;
+               no_core.rlim_max = current.rlim_max;
 
                if (setrlimit(RLIMIT_CORE, &no_core) < 0) {
                        fr_strerror_printf("Failed disabling core dumps: %s", fr_syserror(errno));