From 6339649983759fa23b265cb1c664af3d412b2fea Mon Sep 17 00:00:00 2001 From: xfnw Date: Mon, 8 Nov 2021 17:30:01 -0500 Subject: [PATCH] force core dumps to be disabled --- ratbox-respond.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ratbox-respond.c b/ratbox-respond.c index 9188264..1111a12 100644 --- a/ratbox-respond.c +++ b/ratbox-respond.c @@ -32,6 +32,15 @@ #include #include #include +#include +#include + +void nodumps() +{ + struct rlimit r; + r.rlim_cur = r.rlim_max = 0; + setrlimit(RLIMIT_CORE, &r); +} static int called_passcb = 0; static int pass_cb(char *buf, int size, int rwflag, void *u) @@ -215,6 +224,8 @@ read_challenge(FILE *f) int main(int argc, char **argv) { + nodumps(); + FILE *kfile; RSA *rsa = NULL; SHA_CTX ctx; @@ -236,7 +247,7 @@ main(int argc, char **argv) } OpenSSL_add_all_ciphers(); - rsa = PEM_read_RSAPrivateKey(kfile, NULL,pass_cb, NULL); + rsa = PEM_read_RSAPrivateKey(kfile, NULL, pass_cb, NULL); if(!rsa) {