From owner-p4-projects@FreeBSD.ORG Thu Nov 22 06:37:48 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B5B4B16A420; Thu, 22 Nov 2007 06:37:47 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F403916A418 for ; Thu, 22 Nov 2007 06:37:46 +0000 (UTC) (envelope-from zhouzhouyi@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0BAEC13C48A for ; Thu, 22 Nov 2007 06:37:47 +0000 (UTC) (envelope-from zhouzhouyi@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lAM6bkxe069903 for ; Thu, 22 Nov 2007 06:37:46 GMT (envelope-from zhouzhouyi@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lAM6bknd069900 for perforce@freebsd.org; Thu, 22 Nov 2007 06:37:46 GMT (envelope-from zhouzhouyi@FreeBSD.org) Date: Thu, 22 Nov 2007 06:37:46 GMT Message-Id: <200711220637.lAM6bknd069900@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zhouzhouyi@FreeBSD.org using -f From: Zhouyi ZHOU To: Perforce Change Reviews Cc: Subject: PERFORCE change 129370 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: Thu, 22 Nov 2007 06:37:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=129370 Change 129370 by zhouzhouyi@zhouzhouyi_mactest on 2007/11/22 06:36:51 use thread0's ucred to circumvent the priv check Affected files ... .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/mac_test/mac_test_log.c#8 edit Differences ... ==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/mac_test/mac_test_log.c#8 (text+ko) ==== @@ -128,12 +128,12 @@ if ((error = vn_start_write(logvnode, &mp, V_WAIT))) goto bad; - VOP_LEASE(logvnode, curthread, curthread->td_ucred, LEASE_WRITE); + VOP_LEASE(logvnode, curthread, /*curthread->td_ucred*/thread0.td_ucred, LEASE_WRITE); VATTR_NULL(&vat); vat.va_size = 0; vn_lock(logvnode, LK_EXCLUSIVE | LK_RETRY, curthread); /*do truncate */ - error = VOP_SETATTR(logvnode, &vat, curthread->td_ucred, curthread); + error = VOP_SETATTR(logvnode, &vat, /*curthread->td_ucred*/thread0.td_ucred, curthread); /*set the external attribute */ @@ -147,10 +147,11 @@ auio.uio_segflg = UIO_SYSSPACE; auio.uio_td = curthread; - mac_vnode_check_setextattr(curthread->td_ucred, logvnode, + mac_vnode_check_setextattr(/*curthread->td_ucred*/thread0.td_ucred, logvnode, EXTATTR_NAMESPACE_SYSTEM, "mac_test", &auio); error = VOP_SETEXTATTR(logvnode, EXTATTR_NAMESPACE_SYSTEM, - "mac_test", &auio, curthread->td_ucred, curthread); + "mac_test", &auio, /*curthread->td_ucred*/thread0.td_ucred, curthread); + VOP_UNLOCK(logvnode, 0, curthread); vn_finished_write(mp);