diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2016-10-05 16:58:20 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2016-10-05 16:58:20 +0000 |
commit | 0dec1e31a8ff472618d1b82399e8c6bc579e11b7 (patch) | |
tree | 88ccd6908dcfbf1f1038e877cfa2a47733cc957e /usr.sbin/httpd/proc.c | |
parent | 98e35f79c600266ab0666c4606d9cfab1da4ea95 (diff) |
sync proc.c with vmd: add p_pw to specify a non-standard user for a process.
OK rzalamena@
Diffstat (limited to 'usr.sbin/httpd/proc.c')
-rw-r--r-- | usr.sbin/httpd/proc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/httpd/proc.c b/usr.sbin/httpd/proc.c index 5ea7e5f4eb9..d7f1e015095 100644 --- a/usr.sbin/httpd/proc.c +++ b/usr.sbin/httpd/proc.c @@ -1,7 +1,7 @@ -/* $OpenBSD: proc.c,v 1.27 2016/09/28 12:01:04 reyk Exp $ */ +/* $OpenBSD: proc.c,v 1.28 2016/10/05 16:58:19 reyk Exp $ */ /* - * Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org> + * Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org> * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any @@ -498,7 +498,7 @@ proc_run(struct privsep *ps, struct privsep_proc *p, struct privsep_proc *procs, unsigned int nproc, void (*run)(struct privsep *, struct privsep_proc *, void *), void *arg) { - struct passwd *pw = ps->ps_pw; + struct passwd *pw; const char *root; struct control_sock *rcs; @@ -518,6 +518,12 @@ proc_run(struct privsep *ps, struct privsep_proc *p, fatalx(__func__); } + /* Use non-standard user */ + if (p->p_pw != NULL) + pw = p->p_pw; + else + pw = ps->ps_pw; + /* Change root directory */ if (p->p_chroot != NULL) root = p->p_chroot; |