Isolation: allowed the use of credentials with unpriv userns.

The setuid/setgid syscalls requires root capabilities but if the kernel
supports unprivileged user namespace then the child process has the full
set of capabilities in the new namespace, then we can allow setting "user"
and "group" in such cases (this is a common security use case).

Tests were added to ensure user gets meaningful error messages for
uid/gid mapping misconfigurations.
This commit is contained in:
Tiago Natel
2019-12-06 16:52:50 +00:00
parent ed2492a66a
commit 411daeaa53
13 changed files with 1187 additions and 152 deletions

View File

@@ -163,6 +163,12 @@ NXT_TEST_SRCS=" \
src/test/nxt_strverscmp_test.c \
"
if [ $NXT_HAVE_CLONE_NEWUSER = YES ]; then
NXT_TEST_SRCS="$NXT_TEST_SRCS src/test/nxt_clone_test.c"
fi
NXT_LIB_UTF8_FILE_NAME_TEST_SRCS=" \
src/test/nxt_utf8_file_name_test.c \
"