summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-06-27 02:15:53 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-06-27 02:15:53 +0000
commit9764dc55960f90e9d53b8be83c0206ca1db7b93d (patch)
tree64640ae2a360b8bc992542dce6d36fecdc1c27e9
parent78c08934fb342be0b73ec1b877bb2d72804a3586 (diff)
do not permit ktrace on P_SUGID; millert ok
-rw-r--r--sys/kern/kern_ktrace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 46abeba17f9..5615a72a324 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_ktrace.c,v 1.28 2002/06/06 15:41:46 mpech Exp $ */
+/* $OpenBSD: kern_ktrace.c,v 1.29 2002/06/27 02:15:52 deraadt Exp $ */
/* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */
/*
@@ -530,7 +530,8 @@ ktrcanset(callp, targetp)
target->p_ruid == target->p_svuid &&
caller->p_rgid == target->p_rgid && /* XXX */
target->p_rgid == target->p_svgid &&
- (targetp->p_traceflag & KTRFAC_ROOT) == 0) ||
+ (targetp->p_traceflag & KTRFAC_ROOT) == 0 &&
+ !ISSET(targetp->p_flag, P_SUGID)) ||
caller->pc_ucred->cr_uid == 0)
return (1);