Isolation: Rename NXT_HAVE_CLONE -> NXT_HAVE_LINUX_NS.
Due to the need to replace our use of clone/__NR_clone on Linux with fork(2)/unshare(2) for enabling Linux namespaces(7) to keep the pthreads(7) API working. Let's rename NXT_HAVE_CLONE to NXT_HAVE_LINUX_NS, i.e name it after the feature, not how it's implemented, then in future if we change how we do namespaces again we don't have to rename this. Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
This commit is contained in:
@@ -286,7 +286,7 @@ nxt_credential_setuid(nxt_task_t *task, nxt_credential_t *uc)
|
||||
|
||||
if (setuid(uc->uid) != 0) {
|
||||
|
||||
#if (NXT_HAVE_CLONE)
|
||||
#if (NXT_HAVE_LINUX_NS)
|
||||
if (nxt_errno == EINVAL) {
|
||||
nxt_log(task, NXT_LOG_ERR, "The uid %d (user \"%s\") isn't "
|
||||
"valid in the application namespace.", uc->uid, uc->user);
|
||||
@@ -314,7 +314,7 @@ nxt_credential_setgids(nxt_task_t *task, nxt_credential_t *uc)
|
||||
|
||||
if (setgid(uc->base_gid) != 0) {
|
||||
|
||||
#if (NXT_HAVE_CLONE)
|
||||
#if (NXT_HAVE_LINUX_NS)
|
||||
if (nxt_errno == EINVAL) {
|
||||
nxt_log(task, NXT_LOG_ERR, "The gid %d isn't valid in the "
|
||||
"application namespace.", uc->base_gid);
|
||||
@@ -333,7 +333,7 @@ nxt_credential_setgids(nxt_task_t *task, nxt_credential_t *uc)
|
||||
if (nxt_slow_path(uc->ngroups > 0
|
||||
&& setgroups(uc->ngroups, uc->gids) != 0)) {
|
||||
|
||||
#if (NXT_HAVE_CLONE)
|
||||
#if (NXT_HAVE_LINUX_NS)
|
||||
if (nxt_errno == EINVAL) {
|
||||
nxt_log(task, NXT_LOG_ERR, "The user \"%s\" (uid: %d) has "
|
||||
"supplementary group ids not valid in the application "
|
||||
|
||||
Reference in New Issue
Block a user