nxt_runtime.c (1254:aae6699f4eee) nxt_runtime.c (1302:d4c6a91f7091)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#include <nxt_main.h>

--- 691 unchanged lines hidden (view full) ---

700 return NXT_ERROR;
701 }
702
703 if (nxt_capability_set(task, &rt->capabilities) != NXT_OK) {
704 return NXT_ERROR;
705 }
706
707 if (rt->capabilities.setid) {
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#include <nxt_main.h>

--- 691 unchanged lines hidden (view full) ---

700 return NXT_ERROR;
701 }
702
703 if (nxt_capability_set(task, &rt->capabilities) != NXT_OK) {
704 return NXT_ERROR;
705 }
706
707 if (rt->capabilities.setid) {
708 if (nxt_user_cred_get(task, &rt->user_cred, rt->group) != NXT_OK) {
708 ret = nxt_user_cred_get(task, rt->mem_pool, &rt->user_cred,
709 rt->group);
710
711 if (nxt_slow_path(ret != NXT_OK)) {
709 return NXT_ERROR;
710 }
711
712 } else {
713 nxt_log(task, NXT_LOG_WARN, "Unit is running unprivileged, then it "
714 "cannot use arbitrary user and group.");
715 }
716

--- 601 unchanged lines hidden (view full) ---

1318
1319 } while (port != NULL);
1320
1321 nxt_thread_mutex_destroy(&process->incoming.mutex);
1322 nxt_thread_mutex_destroy(&process->outgoing.mutex);
1323 nxt_thread_mutex_destroy(&process->cp_mutex);
1324
1325 if (process->init != NULL) {
712 return NXT_ERROR;
713 }
714
715 } else {
716 nxt_log(task, NXT_LOG_WARN, "Unit is running unprivileged, then it "
717 "cannot use arbitrary user and group.");
718 }
719

--- 601 unchanged lines hidden (view full) ---

1321
1322 } while (port != NULL);
1323
1324 nxt_thread_mutex_destroy(&process->incoming.mutex);
1325 nxt_thread_mutex_destroy(&process->outgoing.mutex);
1326 nxt_thread_mutex_destroy(&process->cp_mutex);
1327
1328 if (process->init != NULL) {
1326 nxt_mp_free(rt->mem_pool, process->init);
1329 nxt_mp_destroy(process->init->mem_pool);
1327 }
1328
1329 nxt_mp_free(rt->mem_pool, process);
1330}
1331
1332
1333static nxt_int_t
1334nxt_runtime_lvlhsh_pid_test(nxt_lvlhsh_query_t *lhq, void *data)

--- 289 unchanged lines hidden ---
1330 }
1331
1332 nxt_mp_free(rt->mem_pool, process);
1333}
1334
1335
1336static nxt_int_t
1337nxt_runtime_lvlhsh_pid_test(nxt_lvlhsh_query_t *lhq, void *data)

--- 289 unchanged lines hidden ---