diff options
Diffstat (limited to 'usr.sbin/vmd/proc.c')
-rw-r--r-- | usr.sbin/vmd/proc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/vmd/proc.c b/usr.sbin/vmd/proc.c index 5e473717b2b..52ab19c2ef8 100644 --- a/usr.sbin/vmd/proc.c +++ b/usr.sbin/vmd/proc.c @@ -1,7 +1,7 @@ -/* $OpenBSD: proc.c,v 1.6 2016/09/29 22:42:04 reyk Exp $ */ +/* $OpenBSD: proc.c,v 1.7 2016/10/04 17:17:30 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; |