From owner-trustedbsd-cvs@FreeBSD.ORG Tue Oct 3 07:50:21 2006 Return-Path: X-Original-To: trustedbsd-cvs@freebsd.org Delivered-To: trustedbsd-cvs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F283616A415 for ; Tue, 3 Oct 2006 07:50:20 +0000 (UTC) (envelope-from owner-perforce@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68F5F43D53 for ; Tue, 3 Oct 2006 07:50:20 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by cyrus.watson.org (Postfix) with ESMTP id BEBEE46CA3 for ; Tue, 3 Oct 2006 03:50:19 -0400 (EDT) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 32A0756774; Tue, 3 Oct 2006 07:50:18 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 2470F16A416; Tue, 3 Oct 2006 07:50:18 +0000 (UTC) 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 F32FC16A412 for ; Tue, 3 Oct 2006 07:50:17 +0000 (UTC) (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 6EBCE43D4C for ; Tue, 3 Oct 2006 07:50:17 +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.6/8.13.6) with ESMTP id k937oHKZ025942 for ; Tue, 3 Oct 2006 07:50:17 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k937oHDa025937 for perforce@freebsd.org; Tue, 3 Oct 2006 07:50:17 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 3 Oct 2006 07:50:17 GMT Message-Id: <200610030750.k937oHDa025937@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 107146 for review X-BeenThere: trustedbsd-cvs@FreeBSD.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: TrustedBSD CVS and Perforce commit message list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2006 07:50:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=107146 Change 107146 by rwatson@rwatson_peppercorn on 2006/10/03 07:50:08 Update alpha for priv(9), as alpha does not exist in 7-CURRENT. Affected files ... .. //depot/projects/trustedbsd/priv6/src/sys/alpha/alpha/promcons.c#2 edit .. //depot/projects/trustedbsd/priv6/src/sys/alpha/alpha/sys_machdep.c#2 edit .. //depot/projects/trustedbsd/priv6/src/sys/alpha/osf1/osf1_misc.c#2 edit Differences ... ==== //depot/projects/trustedbsd/priv6/src/sys/alpha/alpha/promcons.c#2 (text+ko) ==== @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -111,7 +112,8 @@ ttsetwater(tp); setuptimeout = 1; - } else if ((tp->t_state & TS_XCLUDE) && suser(td)) { + } else if ((tp->t_state & TS_XCLUDE) && + priv_check(td, PRIV_TTY_EXCLUSIVE)) { splx(s); return EBUSY; } ==== //depot/projects/trustedbsd/priv6/src/sys/alpha/alpha/sys_machdep.c#2 (text+ko) ==== @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -124,7 +125,7 @@ if (error) return (error); - error = suser(td); + error = priv_check(td, PRIV_IO); if (error) return (error); ==== //depot/projects/trustedbsd/priv6/src/sys/alpha/osf1/osf1_misc.c#2 (text+ko) ==== @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -902,12 +903,15 @@ PROC_LOCK(p); oldcred = p->p_ucred; - if ((error = suser_cred(p->p_ucred, SUSER_ALLOWJAIL)) != 0 && - uid != oldcred->cr_ruid && uid != oldcred->cr_svuid) { - PROC_UNLOCK(p); - uifree(uip); - crfree(newcred); - return (error); + if (uid != oldcred->cr_ruid && uid != oldcred->cr_svuid) { + error = priv_check_cred(p->p_ucred, PRIV_SETUID, + SUSER_ALLOWJAIL); + if (error) { + PROC_UNLOCK(p); + uifree(uip); + crfree(newcred); + return (error); + } } crcopy(newcred, oldcred); @@ -956,11 +960,14 @@ PROC_LOCK(p); oldcred = p->p_ucred; - if (((error = suser_cred(p->p_ucred, SUSER_ALLOWJAIL)) != 0 ) && - gid != oldcred->cr_rgid && gid != oldcred->cr_svgid) { - PROC_UNLOCK(p); - crfree(newcred); - return (error); + if (gid != oldcred->cr_rgid && gid != oldcred->cr_svgid) { + error = priv_check_cred(p->p_ucred, PRIV_SETGID, + SUSER_ALLOWJAIL); + if (error) { + PROC_UNLOCK(p); + crfree(newcred); + return (error); + } } crcopy(newcred, oldcred);