14 |
extern uid_t ruid, euid; |
extern uid_t ruid, euid; |
15 |
|
|
16 |
static secmem_t *smem = NULL; /* First node of secure memory linked list. */ |
static secmem_t *smem = NULL; /* First node of secure memory linked list. */ |
17 |
static struct rlimit orl; /* Original core file limit settings. */ |
|
18 |
|
|
19 |
/* |
/* |
20 |
* A malloc() that checks the results and dies in case of error. |
* A malloc() that checks the results and dies in case of error. |
240 |
*/ |
*/ |
241 |
void corefile_disable(void) |
void corefile_disable(void) |
242 |
{ |
{ |
243 |
struct rlimit nrl; |
struct rlimit rl; |
|
|
|
|
getrlimit(RLIMIT_CORE, &orl); |
|
|
|
|
|
nrl = orl; |
|
|
nrl.rlim_cur = 0; |
|
|
setrlimit(RLIMIT_CORE, &nrl); |
|
|
} |
|
|
|
|
244 |
|
|
245 |
/* |
getrlimit(RLIMIT_CORE, &rl); |
246 |
* Restore original core file settings. |
|
247 |
*/ |
rl.rlim_cur = rl.rlim_max = 0; |
248 |
void corefile_restore(void) |
setrlimit(RLIMIT_CORE, &rl); |
|
{ |
|
|
setrlimit(RLIMIT_CORE, &orl); |
|
249 |
} |
} |