Added "rootfs" feature.

This commit is contained in:
Tiago Natel de Moura
2020-05-28 14:57:41 +01:00
parent e9e5ddd5a5
commit e2b53e16c6
27 changed files with 1524 additions and 78 deletions

View File

@@ -39,6 +39,7 @@ nxt_capability_set(nxt_task_t *task, nxt_capabilities_t *cap)
if (geteuid() == 0) {
cap->setid = 1;
cap->chroot = 1;
return NXT_OK;
}
@@ -91,6 +92,10 @@ nxt_capability_specific_set(nxt_task_t *task, nxt_capabilities_t *cap)
return NXT_ERROR;
}
if ((val->effective & (1 << CAP_SYS_CHROOT)) != 0) {
cap->chroot = 1;
}
if ((val->effective & (1 << CAP_SETUID)) == 0) {
return NXT_OK;
}