bsm_notify.c (159985) | bsm_notify.c (168777) |
---|---|
1/* 2 * Copyright (c) 2004 Apple Computer, 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 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * POSSIBILITY OF SUCH DAMAGE. 28 * | 1/* 2 * Copyright (c) 2004 Apple Computer, 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 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * POSSIBILITY OF SUCH DAMAGE. 28 * |
29 * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_notify.c#12 $ | 29 * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_notify.c#13 $ |
30 */ 31 32/* 33 * Based on sample code from Marc Majka. 34 */ 35#include <sys/types.h> 36 37#include <config/config.h> --- 23 unchanged lines hidden (view full) --- 61#endif /* AUDIT_NOTIFICATION_ENABLED */ 62 63static long au_cond = AUC_UNSET; /* <bsm/audit.h> */ 64 65uint32_t 66au_notify_initialize(void) 67{ 68#if AUDIT_NOTIFICATION_ENABLED | 30 */ 31 32/* 33 * Based on sample code from Marc Majka. 34 */ 35#include <sys/types.h> 36 37#include <config/config.h> --- 23 unchanged lines hidden (view full) --- 61#endif /* AUDIT_NOTIFICATION_ENABLED */ 62 63static long au_cond = AUC_UNSET; /* <bsm/audit.h> */ 64 65uint32_t 66au_notify_initialize(void) 67{ 68#if AUDIT_NOTIFICATION_ENABLED |
69 uint32_t status, ignore_first; | 69 uint32_t status; 70 int ignore_first; |
70 71 status = notify_register_check(__BSM_INTERNAL_NOTIFY_KEY, &token); 72 if (status != NOTIFY_STATUS_OK) 73 return (status); 74 status = notify_check(token, &ignore_first); 75 if (status != NOTIFY_STATUS_OK) 76 return (status); 77#endif --- 25 unchanged lines hidden (view full) --- 103 * is a slight performance hit if auditing is off, but at least the system 104 * will behave correctly. The notification calls are unlikely to fail, 105 * anyway. 106 */ 107int 108au_get_state(void) 109{ 110#if AUDIT_NOTIFICATION_ENABLED | 71 72 status = notify_register_check(__BSM_INTERNAL_NOTIFY_KEY, &token); 73 if (status != NOTIFY_STATUS_OK) 74 return (status); 75 status = notify_check(token, &ignore_first); 76 if (status != NOTIFY_STATUS_OK) 77 return (status); 78#endif --- 25 unchanged lines hidden (view full) --- 104 * is a slight performance hit if auditing is off, but at least the system 105 * will behave correctly. The notification calls are unlikely to fail, 106 * anyway. 107 */ 108int 109au_get_state(void) 110{ 111#if AUDIT_NOTIFICATION_ENABLED |
111 uint32_t did_notify; | 112 int did_notify; |
112#endif 113 int status; 114 115 /* 116 * Don't make the client initialize this set of routines, but take the 117 * slight performance hit by checking ourselves every time. 118 */ 119 if (au_cond == AUC_UNSET) { --- 61 unchanged lines hidden --- | 113#endif 114 int status; 115 116 /* 117 * Don't make the client initialize this set of routines, but take the 118 * slight performance hit by checking ourselves every time. 119 */ 120 if (au_cond == AUC_UNSET) { --- 61 unchanged lines hidden --- |