236 |
|
|
237 |
|
|
238 |
/* |
/* |
239 |
|
* Lock memory of allocated buffers. |
240 |
|
*/ |
241 |
|
void secmem_lock(void) |
242 |
|
{ |
243 |
|
secmem_t *p; |
244 |
|
|
245 |
|
seteuid(euid); /* Gain root privileges. */ |
246 |
|
for (p = smem; p; p = p->next) |
247 |
|
mlock(p->buf, p->size); |
248 |
|
seteuid(ruid); /* Drop root privileges. */ |
249 |
|
|
250 |
|
if (getuid() != geteuid()) |
251 |
|
fatal(ERROR_SETUID, "imapfilter: failed to drop privileges\n"); |
252 |
|
} |
253 |
|
|
254 |
|
|
255 |
|
/* |
256 |
* Store original core file settings and disable core file dumping. |
* Store original core file settings and disable core file dumping. |
257 |
*/ |
*/ |
258 |
void corefile_disable(void) |
void corefile_disable(void) |