summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nxt_master_process.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/nxt_master_process.c b/src/nxt_master_process.c
index 77e720cf..44cf8d8b 100644
--- a/src/nxt_master_process.c
+++ b/src/nxt_master_process.c
@@ -317,19 +317,25 @@ nxt_master_start_worker_process(nxt_task_t *task, nxt_runtime_t *rt,
return NXT_ERROR;
}
+ init->user_cred = (nxt_user_cred_t *) (init + 1);
+
user = nxt_pointer_to(init->user_cred, sizeof(nxt_user_cred_t));
nxt_memcpy(user, app_conf->user.start, app_conf->user.length);
user[app_conf->user.length] = '\0';
- group = nxt_pointer_to(user, app_conf->user.length + 1);
+ init->user_cred->user = user;
- nxt_memcpy(group, app_conf->group.start, app_conf->group.length);
- group[app_conf->group.length] = '\0';
+ if (app_conf->group.start != NULL) {
+ group = nxt_pointer_to(user, app_conf->user.length + 1);
- init->user_cred = (nxt_user_cred_t *) (init + 1);
+ nxt_memcpy(group, app_conf->group.start, app_conf->group.length);
+ group[app_conf->group.length] = '\0';
+
+ } else {
+ group = NULL;
+ }
- init->user_cred->user = user;
if (nxt_user_cred_get(task, init->user_cred, group) != NXT_OK) {
return NXT_ERROR;
}