mirror of
https://github.com/clearml/dropbear
synced 2025-04-03 20:40:56 +00:00
Disable core dumps
--HG-- extra : convert_revision : ba8ebf724630561c6b9285247be7574a33853a17
This commit is contained in:
parent
433d5511e1
commit
47e76de56a
@ -47,6 +47,8 @@ int main(int argc, char ** argv) {
|
||||
_dropbear_exit = cli_dropbear_exit;
|
||||
_dropbear_log = cli_dropbear_log;
|
||||
|
||||
disallow_core();
|
||||
|
||||
cli_getopts(argc, argv);
|
||||
|
||||
TRACE(("user='%s' host='%s' port='%s'", cli_opts.username,
|
||||
|
6
dbutil.c
6
dbutil.c
@ -693,3 +693,9 @@ void setnonblocking(int fd) {
|
||||
}
|
||||
TRACE(("leave setnonblocking"))
|
||||
}
|
||||
|
||||
void disallow_core() {
|
||||
struct rlimit lim;
|
||||
lim.rlim_cur = lim.rlim_max = 0;
|
||||
setrlimit(RLIMIT_CORE, &lim);
|
||||
}
|
||||
|
1
dbutil.h
1
dbutil.h
@ -63,6 +63,7 @@ void * m_realloc(void* ptr, size_t size);
|
||||
void __m_free(void* ptr);
|
||||
void m_burn(void* data, unsigned int len);
|
||||
void setnonblocking(int fd);
|
||||
void disallow_core();
|
||||
|
||||
/* Used to force mp_ints to be initialised */
|
||||
#define DEF_MP_INT(X) mp_int X = {0, 0, 0, NULL}
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
@ -52,6 +52,8 @@ int main(int argc, char ** argv)
|
||||
_dropbear_exit = svr_dropbear_exit;
|
||||
_dropbear_log = svr_dropbear_log;
|
||||
|
||||
disallow_core();
|
||||
|
||||
/* get commandline options */
|
||||
svr_getopts(argc, argv);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user