summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2017-07-14 17:03:01 +0300
committerValentin Bartenev <vbart@nginx.com>2017-07-14 17:03:01 +0300
commitd669045b758effb22e1648a64f2219d0c1b01a9f (patch)
tree46664861bdfb3bc52d677c87a644c7f85c62cc32
parenta937047cb8d3255cc451bccf9e8b7cc0671ef9c2 (diff)
downloadunit-d669045b758effb22e1648a64f2219d0c1b01a9f.tar.gz
unit-d669045b758effb22e1648a64f2219d0c1b01a9f.tar.bz2
Fixed the previous commit.
Diffstat (limited to '')
-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;
}