audit_class.c revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 1992, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A * Macros to produce a quoted string containing the value of a 2N/A * preprocessor macro. For example, if SIZE is defined to be 256, 2N/A * VAL2STR(SIZE) is "256". This is used to construct format 2N/A * strings for scanf-family functions below. 2N/A * This is not MT-safe because of the static variables. 2N/A * This is MT-safe if each thread passes in its own pointer 2N/A * to the space where the class entry is returned. Be careful 2N/A * to also allocate space from the cname and cdesc pointers 2N/A * in the au_class_ent structure. 2N/A /* open audit class file if it isn't already */ 2N/A if ((*s !=
'\0') && (*s !=
'#')) {
2N/A /* parse bitfield */ 2N/A /* parse class name */ 2N/A /* parse class description */ 2N/A * Read the entire audit_class file into memory. 2N/A * Return a pointer to the requested entry in the cache 2N/A * or a pointer to an invalid entry if the the class 2N/A * requested is not known. 2N/A * Return < 0, do not set result pointer, if error. 2N/A * Return 0, set result pointer to invalid entry, if class not in cache. 2N/A * Return 1, set result pointer to a valid entry, if class is in cache. 2N/A /* Count number of lines in the class file */ 2N/A if ((*s !=
'\0') && (*s !=
'#')) {
2N/A * This call to getauclassent is protected by 2N/A * mutex_classcache, so we don't need to use the thread- 2N/A * safe version (getauclassent_r). 2N/A }
/* END if called_once */