Useless setrlimit(RLIMIT_CORE, ...) and typo in mainconfig.c

Enrik Berkhan enrik#freeradius at planb.de
Mon Oct 15 16:49:05 CEST 2007


Hi,

when coredumps are enabled in the config file, the code in mainconfig.c 
does an setrlimit(RLIMIT_CORE, ...) using the core limits retrieved by 
an earlier getrlimit(RLIMIT_CORE, ...). This looks useless to me. I 
think the original intention of the setrlimit() was to actually enable 
core dumping in case the server is started with core dump limit set to 0 
but coredumps enabled in the config file.

Further, a prctl() call to set the dumpable flag of the process is 
protected by HAVE_SYS_PRTCL_H which should be HAVE_SYS_PRCTL_H. Even 
with the typo fixed, the code will never be run, because configure does 
not check for prctl.h yet.

I have attached a suggested patch (not including configure / prctl.h).

Enrik
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: setrlimit.patch
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20071015/f71e2476/attachment.ksh>


More information about the Freeradius-Devel mailing list