Date: Thu, 22 Nov 2007 06:37:46 GMT From: Zhouyi ZHOU <zhouzhouyi@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 129370 for review Message-ID: <200711220637.lAM6bknd069900@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711220637.lAM6bknd069900>