auditd_fbsd.c (187214) | auditd_fbsd.c (191273) |
---|---|
1/*- | 1/*- |
2 * Copyright (c) 2004-2008 Apple Inc. | 2 * Copyright (c) 2004-2009 Apple Inc. |
3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * | 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * |
29 * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#2 $ | 29 * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#4 $ |
30 */ 31 32#include <sys/types.h> 33 34#include <config/config.h> 35 36#include <errno.h> 37#include <fcntl.h> --- 90 unchanged lines hidden (view full) --- 128} 129 130/* 131 * Get the auditing state from the kernel and cache it. 132 */ 133static void 134init_audit_state(void) 135{ | 30 */ 31 32#include <sys/types.h> 33 34#include <config/config.h> 35 36#include <errno.h> 37#include <fcntl.h> --- 90 unchanged lines hidden (view full) --- 128} 129 130/* 131 * Get the auditing state from the kernel and cache it. 132 */ 133static void 134init_audit_state(void) 135{ |
136 long au_cond; | 136 int au_cond; |
137 | 137 |
138 if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) { | 138 if (audit_get_cond(&au_cond) < 0) { |
139 if (errno != ENOSYS) { 140 auditd_log_err("Audit status check failed (%s)", 141 strerror(errno)); 142 } 143 auditing_state = AUD_STATE_DISABLED; 144 } else 145 if (au_cond == AUC_NOAUDIT || au_cond == AUC_DISABLED) 146 auditing_state = AUD_STATE_DISABLED; --- 128 unchanged lines hidden --- | 139 if (errno != ENOSYS) { 140 auditd_log_err("Audit status check failed (%s)", 141 strerror(errno)); 142 } 143 auditing_state = AUD_STATE_DISABLED; 144 } else 145 if (au_cond == AUC_NOAUDIT || au_cond == AUC_DISABLED) 146 auditing_state = AUD_STATE_DISABLED; --- 128 unchanged lines hidden --- |