From owner-p4-projects@FreeBSD.ORG Fri Jan 16 11:16:37 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7CBF716A4D0; Fri, 16 Jan 2004 11:16:37 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57D6316A4CE for ; Fri, 16 Jan 2004 11:16:37 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A7AB43D41 for ; Fri, 16 Jan 2004 11:16:36 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0GJGa0B014353 for ; Fri, 16 Jan 2004 11:16:36 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0GJGaDo014350 for perforce@freebsd.org; Fri, 16 Jan 2004 11:16:36 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Fri, 16 Jan 2004 11:16:36 -0800 (PST) Message-Id: <200401161916.i0GJGaDo014350@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 45453 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2004 19:16:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=45453 Change 45453 by jhb@jhb_slimer on 2004/01/16 11:16:12 - Fix psignal() to check P_SYSTEM to see if a process is a system process, not just the pid. - Fix kill() to not send signals to a system process and return EINVAL instead. Is this incorrect given that init gets signals? Affected files ... .. //depot/projects/smpng/sys/kern/kern_sig.c#82 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_sig.c#82 (text+ko) ==== @@ -1392,7 +1392,10 @@ /* kill single process */ if ((p = pfind(uap->pid)) == NULL) return (ESRCH); - error = p_cansignal(td, p, uap->signum); + if (p->p_pid <= 1 || p->p_flag & P_SYSTEM) + error = EPERM; + else + error = p_cansignal(td, p, uap->signum); if (error == 0 && uap->signum) psignal(p, uap->signum); PROC_UNLOCK(p); @@ -2144,7 +2147,7 @@ /* * Don't take default actions on system processes. */ - if (p->p_pid <= 1) { + if (p->p_pid <= 1 || p->p_flag & P_SYSTEM) { #ifdef DIAGNOSTIC /* * Are you sure you want to ignore SIGSEGV