summaryrefslogtreecommitdiff
path: root/sys/miscfs/procfs/procfs_ctl.c
diff options
context:
space:
mode:
authorAlexander Langer <alex@FreeBSD.org>1997-04-27 19:02:37 +0000
committerAlexander Langer <alex@FreeBSD.org>1997-04-27 19:02:37 +0000
commitee7877dfec86c65ee7af0a5c2b10112ce0d36485 (patch)
tree8ac93bd2017350a8d7d3357a8340990a711e4315 /sys/miscfs/procfs/procfs_ctl.c
parent589ede60a1097af77ff0d297f76a7dfb0ce7bef4 (diff)
Notes
Diffstat (limited to 'sys/miscfs/procfs/procfs_ctl.c')
-rw-r--r--sys/miscfs/procfs/procfs_ctl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/miscfs/procfs/procfs_ctl.c b/sys/miscfs/procfs/procfs_ctl.c
index 4370e0c9a9bc..9f47539f098e 100644
--- a/sys/miscfs/procfs/procfs_ctl.c
+++ b/sys/miscfs/procfs/procfs_ctl.c
@@ -37,7 +37,7 @@
* @(#)procfs_ctl.c 8.4 (Berkeley) 6/15/94
*
* From:
- * $Id: procfs_ctl.c,v 1.13 1997/02/22 09:40:27 peter Exp $
+ * $Id: procfs_ctl.c,v 1.14 1997/03/24 11:24:40 bde Exp $
*/
#include <sys/param.h>
@@ -52,6 +52,7 @@
#include <sys/signal.h>
#include <sys/signalvar.h>
#include <sys/ptrace.h>
+#include <sys/systm.h>
#include <miscfs/procfs/procfs.h>
#include <vm/vm.h>
@@ -130,6 +131,10 @@ procfs_control(curp, p, op)
if (p->p_pid == curp->p_pid)
return (EINVAL);
+ /* can't trace init when securelevel > 0 */
+ if (securelevel > 0 && p->p_pid == 1)
+ return (EPERM);
+
/*
* Go ahead and set the trace flag.
* Save the old parent (it's reset in