From owner-p4-projects@FreeBSD.ORG Tue Jun 12 09:25:31 2007 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 CFF2216A473; Tue, 12 Jun 2007 09:25:30 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F48D16A46D for ; Tue, 12 Jun 2007 09:25:30 +0000 (UTC) (envelope-from zhouzhouyi@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 8FE3013C448 for ; Tue, 12 Jun 2007 09:25:30 +0000 (UTC) (envelope-from zhouzhouyi@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l5C9PUir008089 for ; Tue, 12 Jun 2007 09:25:30 GMT (envelope-from zhouzhouyi@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l5C9PUH5008080 for perforce@freebsd.org; Tue, 12 Jun 2007 09:25:30 GMT (envelope-from zhouzhouyi@FreeBSD.org) Date: Tue, 12 Jun 2007 09:25:30 GMT Message-Id: <200706120925.l5C9PUH5008080@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 121487 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, 12 Jun 2007 09:25:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=121487 Change 121487 by zhouzhouyi@zhouzhouyi_mactest on 2007/06/12 09:24:46 support for special handling of /dev/mactestpipe. Set the label of it to MAGIC_MACTESTPIPE Affected files ... .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/zhouzhouyi_mactest_soc/sys/security/mac/mac_policy.h#2 edit .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/zhouzhouyi_mactest_soc/sys/security/mac/mac_vfs.c#2 edit Differences ... ==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/zhouzhouyi_mactest_soc/sys/security/mac/mac_policy.h#2 (text+ko) ==== @@ -631,6 +631,7 @@ mpo_init_bpfdesc_label_t mpo_init_bpfdesc_label; mpo_init_cred_label_t mpo_init_cred_label; mpo_init_devfs_label_t mpo_init_devfs_label; + mpo_init_devfs_label_t mpo_init_mactestpipe_label; mpo_placeholder_t _mpo_placeholder0; mpo_init_ifnet_label_t mpo_init_ifnet_label; mpo_init_inpcb_label_t mpo_init_inpcb_label; ==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/zhouzhouyi_mactest_soc/sys/security/mac/mac_vfs.c#2 (text+ko) ==== @@ -59,13 +59,13 @@ #include #include #include - #include #include #include #include #include +#include #include #include @@ -90,11 +90,24 @@ return (label); } +static struct label * +mac_mactestpipe_label_alloc(void) +{ + struct label *label; + + label = mac_labelzone_alloc(M_WAITOK); + MAC_PERFORM(init_devfs_label, label); + MAC_PERFORM(init_mactestpipe_label, label); + return (label); +} + void mac_init_devfs(struct devfs_dirent *de) { - - de->de_label = mac_devfs_label_alloc(); + if (de&&de->de_dirent&&!strncmp(de->de_dirent->d_name,"mactestpipe",11)) + de->de_label = mac_mactestpipe_label_alloc(); + else + de->de_label = mac_devfs_label_alloc(); } static struct label *