1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 *
| 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 *
|
115#define DATAMODEL_NATIVE 0 116#ifdef __amd64__ 117#define DATAMODEL_LP64 0 118#define DATAMODEL_ILP32 1 119#else 120#define DATAMODEL_LP64 1 121#define DATAMODEL_ILP32 0 122#endif 123 124/* 125 * Definitions for fields in struct proc which are named differently in FreeBSD. 126 */ 127#define p_cred p_ucred 128#define p_parent p_pptr 129 130/* 131 * Definitions for fields in struct thread which are named differently in FreeBSD. 132 */ 133#define t_procp td_proc 134#define t_tid td_tid 135#define t_did td_tid 136 137 138int priv_policy(const cred_t *, int, boolean_t, int, const char *); 139boolean_t priv_policy_only(const cred_t *, int, boolean_t); 140boolean_t priv_policy_choice(const cred_t *, int, boolean_t); 141 142/* 143 * Test privilege. Audit success or failure, allow privilege debugging. 144 * Returns 0 for success, err for failure. 145 */ 146#define PRIV_POLICY(cred, priv, all, err, reason) \ 147 priv_policy((cred), (priv), (all), (err), (reason)) 148 149/* 150 * Test privilege. Audit success only, no privilege debugging. 151 * Returns 1 for success, and 0 for failure. 152 */ 153#define PRIV_POLICY_CHOICE(cred, priv, all) \ 154 priv_policy_choice((cred), (priv), (all)) 155 156/* 157 * Test privilege. No priv_debugging, no auditing. 158 * Returns 1 for success, and 0 for failure. 159 */ 160 161#define PRIV_POLICY_ONLY(cred, priv, all) \ 162 priv_policy_only((cred), (priv), (all)) 163 164#endif /* !_DTRACE_CDDL_H_ */
| 118#define DATAMODEL_NATIVE 0 119#ifdef __amd64__ 120#define DATAMODEL_LP64 0 121#define DATAMODEL_ILP32 1 122#else 123#define DATAMODEL_LP64 1 124#define DATAMODEL_ILP32 0 125#endif 126 127/* 128 * Definitions for fields in struct proc which are named differently in FreeBSD. 129 */ 130#define p_cred p_ucred 131#define p_parent p_pptr 132 133/* 134 * Definitions for fields in struct thread which are named differently in FreeBSD. 135 */ 136#define t_procp td_proc 137#define t_tid td_tid 138#define t_did td_tid 139 140 141int priv_policy(const cred_t *, int, boolean_t, int, const char *); 142boolean_t priv_policy_only(const cred_t *, int, boolean_t); 143boolean_t priv_policy_choice(const cred_t *, int, boolean_t); 144 145/* 146 * Test privilege. Audit success or failure, allow privilege debugging. 147 * Returns 0 for success, err for failure. 148 */ 149#define PRIV_POLICY(cred, priv, all, err, reason) \ 150 priv_policy((cred), (priv), (all), (err), (reason)) 151 152/* 153 * Test privilege. Audit success only, no privilege debugging. 154 * Returns 1 for success, and 0 for failure. 155 */ 156#define PRIV_POLICY_CHOICE(cred, priv, all) \ 157 priv_policy_choice((cred), (priv), (all)) 158 159/* 160 * Test privilege. No priv_debugging, no auditing. 161 * Returns 1 for success, and 0 for failure. 162 */ 163 164#define PRIV_POLICY_ONLY(cred, priv, all) \ 165 priv_policy_only((cred), (priv), (all)) 166 167#endif /* !_DTRACE_CDDL_H_ */
|