From owner-p4-projects@FreeBSD.ORG Thu Oct 26 19:22:34 2006 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 DDB1816A56E; Thu, 26 Oct 2006 19:22:33 +0000 (UTC) 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 BCB8716A56C for ; Thu, 26 Oct 2006 19:22:33 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3496443D76 for ; Thu, 26 Oct 2006 19:22:31 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9QJMVwh077976 for ; Thu, 26 Oct 2006 19:22:31 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9QJMUXE077972 for perforce@freebsd.org; Thu, 26 Oct 2006 19:22:30 GMT (envelope-from millert@freebsd.org) Date: Thu, 26 Oct 2006 19:22:30 GMT Message-Id: <200610261922.k9QJMUXE077972@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 108508 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, 26 Oct 2006 19:22:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=108508 Change 108508 by millert@millert_macbook on 2006/10/26 19:21:52 Rename mac_find_module_data() to mac_find_policy_data(). Affected files ... .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/config/MACFramework.exports#8 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_data.c#3 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_data.h#3 edit .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/sedarwin/sebsd.c#28 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/config/MACFramework.exports#8 (text+ko) ==== @@ -38,6 +38,7 @@ _mac_zfree _mac_find_module_data +_mac_find_policy_data _mac_iokit_check_device ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_data.c#3 (text+ko) ==== @@ -29,16 +29,26 @@ #include "mac_internal.h" int -mac_find_module_data(const mac_policy_handle_t handle, const char *key, +mac_find_policy_data(const mac_policy_handle_t handle, const char *key, void **valp, size_t *sizep) { struct mac_policy_conf *mpc; - struct mac_module_data *mmd; + int error = ENOENT; + unsigned int i; + + if ((mpc = mac_get_mpc(handle)) != NULL) + error = mac_find_module_data(mpc->mpc_data, key, valp, sizep); + return (error); +} + +int +mac_find_module_data(struct mac_module_data *mmd, const char *key, + void **valp, size_t *sizep) +{ int error = ENOENT; unsigned int i; - if ((mpc = mac_get_mpc(handle)) != NULL && - (mmd = mpc->mpc_data) != NULL) { + if (mmd != NULL) { for (i = 0; i < mmd->count; i++) { if (strcmp(key, mmd->data[i].key) == 0) { *valp = mmd->data[i].value; ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_data.h#3 (text+ko) ==== @@ -61,7 +61,9 @@ #ifdef _SECURITY_MAC_POLICY_H_ /* XXX mac_policy_handle_t is defined in mac_policy.h, move prototype there? */ -int mac_find_module_data(const mac_policy_handle_t, const char *key, +int mac_find_policy_data(const mac_policy_handle_t, const char *key, + void **valp, size_t *sizep); +int mac_find_module_data(struct mac_module_data *mmd, const char *key, void **valp, size_t *sizep); #endif ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/sedarwin/sebsd.c#28 (text+ko) ==== @@ -110,7 +110,7 @@ int sebsd_find_data(const char *key, void **valp, size_t *sizep) { - return (mac_find_module_data(sebsd_handle, key, valp, sizep)); + return (mac_find_policy_data(sebsd_handle, key, valp, sizep)); } extern int ss_initialized;