Apply the same P_INEXEC test to avoid the execve/trace problem using

the procfs ptrace calls.
This commit is contained in:
christos 2002-01-11 22:02:56 +00:00
parent 59e608be9f
commit 67c310f08c
1 changed files with 9 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: procfs_ctl.c,v 1.21 2001/12/05 00:58:05 thorpej Exp $ */ /* $NetBSD: procfs_ctl.c,v 1.22 2002/01/11 22:02:56 christos Exp $ */
/* /*
* Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 Jan-Simon Pendry
@ -40,7 +40,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: procfs_ctl.c,v 1.21 2001/12/05 00:58:05 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: procfs_ctl.c,v 1.22 2002/01/11 22:02:56 christos Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -107,11 +107,17 @@ procfs_control(curp, p, op, sig)
{ {
int s, error; int s, error;
/*
* You cannot do anything to the process if it is currently exec'ing
*/
if (ISSET(p->p_flag, P_INEXEC))
return (EAGAIN);
switch (op) {
/* /*
* Attach - attaches the target process for debugging * Attach - attaches the target process for debugging
* by the calling process. * by the calling process.
*/ */
switch (op) {
case PROCFS_CTL_ATTACH: case PROCFS_CTL_ATTACH:
/* /*
* You can't attach to a process if: * You can't attach to a process if: