summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_capability.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/nxt_capability.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nxt_capability.c b/src/nxt_capability.c
index dfa7a834..24fd55d0 100644
--- a/src/nxt_capability.c
+++ b/src/nxt_capability.c
@@ -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;
}