From owner-p4-projects@FreeBSD.ORG Sun Jul 10 00:09:59 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 7AEAD16A420; Sun, 10 Jul 2005 00:09:59 +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 3F25A16A41C for ; Sun, 10 Jul 2005 00:09:59 +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 F303243D45 for ; Sun, 10 Jul 2005 00:09:58 +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 j6A09wHG002428 for ; Sun, 10 Jul 2005 00:09:58 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 j6A09wWr002425 for perforce@freebsd.org; Sun, 10 Jul 2005 00:09:58 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 10 Jul 2005 00:09:58 GMT Message-Id: <200507100009.j6A09wWr002425@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 79876 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: Sun, 10 Jul 2005 00:10:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=79876 Change 79876 by rwatson@rwatson_zoo on 2005/07/10 00:09:25 Style cleanup, restoration, fixage. Affected files ... .. //depot/projects/trustedbsd/sebsd/sys/kern/kern_ntptime.c#7 edit .. //depot/projects/trustedbsd/sebsd/sys/kern/kern_prot.c#14 edit .. //depot/projects/trustedbsd/sebsd/sys/kern/kern_xxx.c#10 edit .. //depot/projects/trustedbsd/sebsd/sys/kern/subr_witness.c#15 edit .. //depot/projects/trustedbsd/sebsd/sys/net/if.c#14 edit .. //depot/projects/trustedbsd/sebsd/sys/net/if_ppp.c#11 edit .. //depot/projects/trustedbsd/sebsd/sys/net/if_tun.c#13 edit .. //depot/projects/trustedbsd/sebsd/sys/net/ppp_tty.c#8 edit .. //depot/projects/trustedbsd/sebsd/sys/netinet/ip_output.c#13 edit .. //depot/projects/trustedbsd/sebsd/sys/security/mac_test/mac_test.c#17 edit .. //depot/projects/trustedbsd/sebsd/sys/ufs/ufs/ufs_vnops.c#12 edit .. //depot/projects/trustedbsd/sebsd/sys/vm/vm_mmap.c#13 edit Differences ... ==== //depot/projects/trustedbsd/sebsd/sys/kern/kern_ntptime.c#7 (text+ko) ==== @@ -334,7 +334,7 @@ mtx_lock(&Giant); modes = ntv.modes; if (modes) - error = cap_check(td,CAP_SYS_TIME); + error = cap_check(td, CAP_SYS_TIME); if (error) goto done2; s = splclock(); @@ -955,7 +955,7 @@ struct timeval atv; int error; - if ((error = cap_check(td,CAP_SYS_TIME))) + if ((error = cap_check(td, CAP_SYS_TIME))) return (error); mtx_lock(&Giant); ==== //depot/projects/trustedbsd/sebsd/sys/kern/kern_prot.c#14 (text+ko) ==== @@ -1346,6 +1346,7 @@ suser(struct thread *td) { #ifdef INVARIANTS + if (td != curthread) { printf("suser: thread %p (%d %s) != curthread %p (%d %s)\n", td, td->td_proc->p_pid, td->td_proc->p_comm, ==== //depot/projects/trustedbsd/sebsd/sys/kern/kern_xxx.c#10 (text+ko) ==== @@ -139,7 +139,7 @@ { int error; - error = cap_check(td,CAP_SYS_ADMIN); + error = cap_check(td, CAP_SYS_ADMIN); if (error) return (error); mtx_lock(&Giant); @@ -297,7 +297,7 @@ int error, domainnamelen; mtx_lock(&Giant); - if ((error = cap_check (td,CAP_SYS_ADMIN))) + if ((error = cap_check(td, CAP_SYS_ADMIN))) goto done2; if ((u_int)uap->len > sizeof (domainname) - 1) { error = EINVAL; ==== //depot/projects/trustedbsd/sebsd/sys/kern/subr_witness.c#15 (text+ko) ==== @@ -454,7 +454,6 @@ /* * We have to release Giant before initializing its witness * structure so that WITNESS doesn't get confused. - */ mtx_unlock(&Giant); mtx_assert(&Giant, MA_NOTOWNED); ==== //depot/projects/trustedbsd/sebsd/sys/net/if.c#14 (text+ko) ==== @@ -1311,7 +1311,7 @@ break; case SIOCSIFPHYS: - error = cap_check (td, CAP_NET_ADMIN); + error = cap_check(td, CAP_NET_ADMIN); if (error) return (error); if (ifp->if_ioctl == NULL) ==== //depot/projects/trustedbsd/sebsd/sys/net/if_ppp.c#11 (text+ko) ==== @@ -476,7 +476,7 @@ break; case PPPIOCSFLAGS: - if ((error = cap_check (td, CAP_NET_ADMIN)) != 0) + if ((error = cap_check(td, CAP_NET_ADMIN)) != 0) break; flags = *(int *)data & SC_MASK; s = splsoftnet(); @@ -720,7 +720,7 @@ break; case SIOCSIFMTU: - if ((error = cap_check (td, CAP_NET_ADMIN)) != 0) + if ((error = cap_check(td, CAP_NET_ADMIN)) != 0) break; if (ifr->ifr_mtu > PPP_MAXMTU) error = EINVAL; ==== //depot/projects/trustedbsd/sebsd/sys/net/if_tun.c#13 (text+ko) ==== @@ -577,7 +577,7 @@ if (tunp->mtu < IF_MINMTU) return (EINVAL); if (tp->tun_if.if_mtu != tunp->mtu - && (error = cap_check (td, CAP_NET_ADMIN)) != 0) + && (error = cap_check(td, CAP_NET_ADMIN)) != 0) return (error); tp->tun_if.if_mtu = tunp->mtu; tp->tun_if.if_type = tunp->type; ==== //depot/projects/trustedbsd/sebsd/sys/net/ppp_tty.c#8 (text+ko) ==== @@ -180,7 +180,7 @@ register struct ppp_softc *sc; int error, s; - if ((error = cap_check (td, CAP_NET_ADMIN)) != 0) + if ((error = cap_check(td, CAP_NET_ADMIN)) != 0) return (error); s = spltty(); @@ -449,7 +449,7 @@ break; case PPPIOCSRASYNCMAP: - if ((error = cap_check (td, CAP_NET_ADMIN)) != 0) + if ((error = cap_check(td, CAP_NET_ADMIN)) != 0) break; sc->sc_rasyncmap = *(u_int *)data; break; ==== //depot/projects/trustedbsd/sebsd/sys/netinet/ip_output.c#13 (text+ko) ==== @@ -1299,7 +1299,7 @@ if ((error = soopt_mcopyin(sopt, m)) != 0) /* XXX */ break; priv = (sopt->sopt_td != NULL && - cap_check (sopt->sopt_td, CAP_NET_ADMIN) != 0) ? 0 : 1; + cap_check(sopt->sopt_td, CAP_NET_ADMIN) != 0) ? 0 : 1; req = mtod(m, caddr_t); len = m->m_len; optname = sopt->sopt_name; ==== //depot/projects/trustedbsd/sebsd/sys/security/mac_test/mac_test.c#17 (text+ko) ==== @@ -1384,8 +1384,9 @@ static int mac_test_check_cap(struct ucred *cred, cap_value_t capv) { - ASSERT_CRED_LABEL(cred->cr_label); - return 0; + + ASSERT_CRED_LABEL(cred->cr_label); + return (0); } static int ==== //depot/projects/trustedbsd/sebsd/sys/ufs/ufs/ufs_vnops.c#12 (text+ko) ==== @@ -617,7 +617,7 @@ * jail(8). */ if (vp->v_type != VDIR && (mode & S_ISTXT)) { - if (cap_check_cred (cred, CAP_SYS_RAWIO, SUSER_ALLOWJAIL)) + if (cap_check_cred(cred, CAP_SYS_RAWIO, SUSER_ALLOWJAIL)) return (EFTYPE); } if (!groupmember(ip->i_gid, cred) && (mode & ISGID)) { @@ -630,7 +630,7 @@ * Setting suid on nonowned files requires CAP_FSETID. */ if ((ip->i_uid != cred->cr_uid) && (mode & ISUID)) { - if (cap_check_cred (cred, CAP_FSETID, SUSER_ALLOWJAIL)) + if (cap_check_cred(cred, CAP_FSETID, SUSER_ALLOWJAIL)) return (EPERM); } ==== //depot/projects/trustedbsd/sebsd/sys/vm/vm_mmap.c#13 (text+ko) ==== @@ -643,7 +643,7 @@ * "immortal." */ if (uap->behav == MADV_PROTECT) { - error = cap_check (td, CAP_SYS_RESOURCE); + error = cap_check(td, CAP_SYS_RESOURCE); if (error == 0) { p = td->td_proc; PROC_LOCK(p);