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:
parent
90c57630b6
commit
6aa2cb528e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user