diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-10-26 07:29:41 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-10-26 07:29:41 +0000 |
commit | 8f78581265bb64405586cff687a87ade2dc3d147 (patch) | |
tree | 78344d50ae58b6d53c29a186a9a3c7f120111283 | |
parent | 188f8fd51e66686e09730143ee4e11961a7b76e1 (diff) |
Verify that pgid argument to setpgid() is legal
-rw-r--r-- | sys/kern/kern_prot.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 34223860510..1f21a6d3531 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_prot.c,v 1.5 1996/10/02 20:22:14 deraadt Exp $ */ +/* $OpenBSD: kern_prot.c,v 1.6 1996/10/26 07:29:40 tholo Exp $ */ /* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */ /* @@ -247,6 +247,9 @@ sys_setpgid(curp, v, retval) SCARG(uap, pgid) = (short) SCARG(uap, pgid); /* XXX */ #endif + if (SCARG(uap, pgid) < 0) + return (EINVAL); + if (SCARG(uap, pid) != 0 && SCARG(uap, pid) != curp->p_pid) { if ((targp = pfind(SCARG(uap, pid))) == 0 || !inferior(targp)) return (ESRCH); |