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) 1993, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * private interfaces for auditd plugins and auditd. 2N/A * audit_syslog() -- generate syslog messages from threads that use 2N/A * different severity, facility code, and application names. 2N/A * syslog(3C) is thread safe, but the set openlog() / syslog() / 2N/A * closelog() is not. 2N/A * Assumption: the app_name and facility code are paired, i.e., 2N/A * if the facility code for this call is the same as for the 2N/A * the previous, the app_name hasn't changed. 2N/A * __audit_dowarn - invoke the shell script auditwarn to notify the 2N/A * adminstrator about a given problem. 2N/A * option - what the problem is 2N/A * text - when used with options soft and hard: which file was being 2N/A * used when the filesystem filled up 2N/A * when used with the plugin option: error detail 2N/A * count - used with various options: how many times auditwarn has 2N/A * been called for this problem since it was last cleared. 2N/A /* __audit_syslog() called only in case execl() failed */ 2N/A * __audit_dowarn2 - invoke the shell script auditwarn to notify the 2N/A * adminstrator about a given problem. 2N/A * option - what the problem is 2N/A * name - entity reporting the problem (ie, plugin name) 2N/A * error - error string 2N/A * text - when used with options soft and hard: which file was being 2N/A * used when the filesystem filled up 2N/A * when used with the plugin option: error detail 2N/A * count - used with various options: how many times auditwarn has 2N/A * been called for this problem since it was last cleared. 2N/A /* execl() failed */ 2N/A * debug use - open a file for auditd and its plugins for debug 2N/A * debug log for auditd, its plugins, and for logging adt issues. 2N/A * __do_sethost - set the kernel instance host-id 2N/A * If the hostname look fails, with errno ENETDOWN, the returned 2N/A * address is loopback, we choose to accept this just log it. 2N/A * If the kernel instance host-id is loopback, we try 2N/A * to get it again, note this is likely only to happen on 2N/A * a refresh of the audit service. 2N/A * Entry who = the caller 2N/A * Returns 0 = success and system instance terminal ID set 2N/A * errno = ENETDOWN, loopback address set 2N/A * errno = fatal error 2N/A * Get the current audit info and look for a no-trivial 2N/A /* Force a new lookup */ 2N/A /* get my terminal ID */ 2N/A /* Update the kernel audit info with new IP address */ 2N/A * getshift() - get the multiplier of bytes based on the string describing the 2N/A * __audit_hrstrtonum - translate human readable form of size (eg. "100K") 2N/A * to the actual number in bytes. 2N/A * The code has been borrowed from the libzfs:zfs_nicestrtonum() function.