summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2011-04-04 13:00:14 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2011-04-04 13:00:14 +0000
commit90f8714a176807ed6f4abeef738c9df2d3dccd8e (patch)
treea79a2300635acd370fbd15e53413864efffadc4c /sys/kern
parenta3bdcbdc31dbbf9573be9fbc0037c42b36aef3ba (diff)
Move P_EXEC flag from struct proc to process, so that setpgid() will
fail regardless of which rthread calls execve() ok blambert@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_exec.c4
-rw-r--r--sys/kern/kern_prot.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 65fe753077b..1f82e1882b9 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.116 2011/04/03 14:56:28 guenther Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.117 2011/04/04 13:00:13 guenther Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -467,7 +467,7 @@ sys_execve(struct proc *p, void *v, register_t *retval)
vref(pack.ep_vp);
p->p_textvp = pack.ep_vp;
- atomic_setbits_int(&p->p_flag, P_EXEC);
+ atomic_setbits_int(&pr->ps_flags, PS_EXEC);
if (pr->ps_flags & PS_PPWAIT) {
atomic_clearbits_int(&pr->ps_flags, PS_PPWAIT);
atomic_clearbits_int(&pr->ps_pptr->ps_flags, PS_ISPWAIT);
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 5b058ee605b..7f451200606 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_prot.c,v 1.47 2011/04/02 17:04:35 guenther Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.48 2011/04/04 13:00:13 guenther Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
@@ -284,7 +284,7 @@ sys_setpgid(struct proc *curp, void *v, register_t *retval)
error = EPERM;
goto out;
}
- if (targpr->ps_mainproc->p_flag & P_EXEC) {
+ if (targpr->ps_flags & PS_EXEC) {
error = EACCES;
goto out;
}