From owner-p4-projects Tue Aug 6 13: 1:20 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3D25237B401; Tue, 6 Aug 2002 13:01:15 -0700 (PDT) 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 A4A8037B400 for ; Tue, 6 Aug 2002 13:01:14 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61EE043E4A for ; Tue, 6 Aug 2002 13:01:14 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g76K1EJU009985 for ; Tue, 6 Aug 2002 13:01:14 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g76K1E6X009982 for perforce@freebsd.org; Tue, 6 Aug 2002 13:01:14 -0700 (PDT) Date: Tue, 6 Aug 2002 13:01:14 -0700 (PDT) Message-Id: <200208062001.g76K1E6X009982@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 15626 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=15626 Change 15626 by rwatson@rwatson_tislabs on 2002/08/06 13:00:34 Introduce module dependencies to prevent MAC modules from getting loaded with a kernel that doesn't support MAC. Largely the evil of: peter Affected files ... .. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#229 edit .. //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#109 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#229 (text+ko) ==== @@ -87,6 +87,13 @@ #ifdef MAC +/* + * Declare that the kernel provides MAC support, version 1. This permits + * modules to refuse to be loaded if the necessary support isn't present, + * even if it's pre-boot. + */ +MODULE_VERSION(kernel_mac_support, 1); + SYSCTL_DECL(_security); SYSCTL_NODE(_security, OID_AUTO, mac, CTLFLAG_RW, 0, ==== //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#109 (text+ko) ==== @@ -496,6 +496,7 @@ mac_policy_modevent, \ &mpname##_mac_policy_conf \ }; \ + MODULE_DEPEND(mpname, kernel_mac_support, 1, 1, 1); \ DECLARE_MODULE(mpname, mpname##_mod, SI_SUB_MAC_POLICY, \ SI_ORDER_MIDDLE) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message