From owner-p4-projects@FreeBSD.ORG Tue Jul 5 11:50:58 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E3F9916A421; Tue, 5 Jul 2005 11:50:57 +0000 (GMT) X-Original-To: perforce@freebsd.org 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 BF82516A41C for ; Tue, 5 Jul 2005 11:50:57 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A330443D4C for ; Tue, 5 Jul 2005 11:50:57 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j65BovuE075826 for ; Tue, 5 Jul 2005 11:50:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j65BovRr075822 for perforce@freebsd.org; Tue, 5 Jul 2005 11:50:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 5 Jul 2005 11:50:57 GMT Message-Id: <200507051150.j65BovRr075822@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 79597 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2005 11:50:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=79597 Change 79597 by rwatson@rwatson_paprika on 2005/07/05 11:50:57 Substitute CAP_SYS_ADMIN checks for suser in hwpmc, for the purposes of administering hwpmc availability and model. Affected files ... .. //depot/projects/trustedbsd/sebsd/sys/dev/hwpmc/hwpmc_mod.c#2 edit Differences ... ==== //depot/projects/trustedbsd/sebsd/sys/dev/hwpmc/hwpmc_mod.c#2 (text+ko) ==== @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_mod.c,v 1.7 2005/05/01 14:11:48 jkoshy Exp $"); #include +#include #include #include #include @@ -2598,7 +2599,7 @@ KASSERT(td == curthread, ("[pmc,%d] td != curthread", __LINE__)); - if (suser(td) || jailed(td->td_ucred)) { + if (cap_check(td, CAP_SYS_ADMIN) || jailed(td->td_ucred)) { error = EPERM; break; } @@ -2736,7 +2737,7 @@ if (PMC_IS_SYSTEM_MODE(mode)) { if (jailed(curthread->td_ucred)) error = EPERM; - else if (suser(curthread) && + else if (cap_check(curthread, CAP_SYS_ADMIN) && (pmc_unprivileged_syspmcs == 0)) error = EPERM; }