2
0
mirror of https://github.com/msantos/xmppipe synced 2024-11-13 13:10:32 +00:00

sandbox: enforce rlimit restrictions before connect

Basic pre-connect sandbox: disable the ability for the xmppipe process
to fork.
This commit is contained in:
Michael Santos 2017-04-13 10:02:29 -04:00
parent 90c57630b6
commit 6aa2cb528e

View File

@ -21,6 +21,13 @@
int
xmppipe_sandbox_init(xmppipe_state_t *state)
{
struct rlimit rl_zero = {0};
#ifdef RLIMIT_NPROC
if (setrlimit(RLIMIT_NPROC, &rl_zero) < 0)
return -1;
#endif
return 0;
}