audit_bsm_klib.c (159143) | audit_bsm_klib.c (159269) |
---|---|
1/* 2 * Copyright (c) 1999-2005 Apple Computer, Inc. 3 * Copyright (c) 2005 Robert N. M. Watson 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 13 unchanged lines hidden (view full) --- 22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * POSSIBILITY OF SUCH DAMAGE. 29 * | 1/* 2 * Copyright (c) 1999-2005 Apple Computer, Inc. 3 * Copyright (c) 2005 Robert N. M. Watson 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 13 unchanged lines hidden (view full) --- 22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * POSSIBILITY OF SUCH DAMAGE. 29 * |
30 * $FreeBSD: head/sys/security/audit/audit_bsm_klib.c 159143 2006-06-01 15:38:30Z csjp $ | 30 * $FreeBSD: head/sys/security/audit/audit_bsm_klib.c 159269 2006-06-05 14:48:17Z rwatson $ |
31 */ 32 33#include <sys/param.h> 34#include <sys/fcntl.h> 35#include <sys/filedesc.h> 36#include <sys/libkern.h> 37#include <sys/malloc.h> 38#include <sys/mount.h> --- 110 unchanged lines hidden (view full) --- 149 } 150} 151 152/* 153 * Check whether an event is aditable by comparing the mask of classes this 154 * event is part of against the given mask. 155 */ 156int | 31 */ 32 33#include <sys/param.h> 34#include <sys/fcntl.h> 35#include <sys/filedesc.h> 36#include <sys/libkern.h> 37#include <sys/malloc.h> 38#include <sys/mount.h> --- 110 unchanged lines hidden (view full) --- 149 } 150} 151 152/* 153 * Check whether an event is aditable by comparing the mask of classes this 154 * event is part of against the given mask. 155 */ 156int |
157au_preselect(au_event_t event, au_mask_t *mask_p, int sorf) | 157au_preselect(au_event_t event, au_class_t class, au_mask_t *mask_p, int sorf) |
158{ 159 au_class_t effmask = 0; | 158{ 159 au_class_t effmask = 0; |
160 au_class_t ae_class; | |
161 162 if (mask_p == NULL) 163 return (-1); 164 | 160 161 if (mask_p == NULL) 162 return (-1); 163 |
165 ae_class = au_event_class(event); 166 | |
167 /* 168 * Perform the actual check of the masks against the event. 169 */ 170 if (sorf & AU_PRS_SUCCESS) | 164 /* 165 * Perform the actual check of the masks against the event. 166 */ 167 if (sorf & AU_PRS_SUCCESS) |
171 effmask |= (mask_p->am_success & ae_class); | 168 effmask |= (mask_p->am_success & class); |
172 173 if (sorf & AU_PRS_FAILURE) | 169 170 if (sorf & AU_PRS_FAILURE) |
174 effmask |= (mask_p->am_failure & ae_class); | 171 effmask |= (mask_p->am_failure & class); |
175 176 if (effmask) 177 return (1); 178 else 179 return (0); 180} 181 182/* --- 366 unchanged lines hidden --- | 172 173 if (effmask) 174 return (1); 175 else 176 return (0); 177} 178 179/* --- 366 unchanged lines hidden --- |