Deleted Added
full compact
audit_syscalls.c (193511) audit_syscalls.c (195104)
1/*-
2 * Copyright (c) 1999-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 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

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
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999-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 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

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
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/security/audit/audit_syscalls.c 193511 2009-06-05 14:55:22Z rwatson $");
31__FBSDID("$FreeBSD: head/sys/security/audit/audit_syscalls.c 195104 2009-06-27 13:58:44Z rwatson $");
32
33#include <sys/param.h>
34#include <sys/mount.h>
35#include <sys/namei.h>
36#include <sys/priv.h>
37#include <sys/proc.h>
38#include <sys/sysproto.h>
39#include <sys/systm.h>

--- 118 unchanged lines hidden (view full) ---

158{
159 struct ucred *cred, *newcred, *oldcred;
160 int error;
161 union auditon_udata udata;
162 struct proc *tp;
163
164 if (jailed(td->td_ucred))
165 return (ENOSYS);
32
33#include <sys/param.h>
34#include <sys/mount.h>
35#include <sys/namei.h>
36#include <sys/priv.h>
37#include <sys/proc.h>
38#include <sys/sysproto.h>
39#include <sys/systm.h>

--- 118 unchanged lines hidden (view full) ---

158{
159 struct ucred *cred, *newcred, *oldcred;
160 int error;
161 union auditon_udata udata;
162 struct proc *tp;
163
164 if (jailed(td->td_ucred))
165 return (ENOSYS);
166 AUDIT_ARG(cmd, uap->cmd);
166 AUDIT_ARG_CMD(uap->cmd);
167
168#ifdef MAC
169 error = mac_system_check_auditon(td->td_ucred, uap->cmd);
170 if (error)
171 return (error);
172#endif
173
174 error = priv_check(td, PRIV_AUDIT_CONTROL);

--- 25 unchanged lines hidden (view full) ---

200 case A_SETKAUDIT:
201 case A_GETCLASS:
202 case A_GETPINFO:
203 case A_GETPINFO_ADDR:
204 case A_SENDTRIGGER:
205 error = copyin(uap->data, (void *)&udata, uap->length);
206 if (error)
207 return (error);
167
168#ifdef MAC
169 error = mac_system_check_auditon(td->td_ucred, uap->cmd);
170 if (error)
171 return (error);
172#endif
173
174 error = priv_check(td, PRIV_AUDIT_CONTROL);

--- 25 unchanged lines hidden (view full) ---

200 case A_SETKAUDIT:
201 case A_GETCLASS:
202 case A_GETPINFO:
203 case A_GETPINFO_ADDR:
204 case A_SENDTRIGGER:
205 error = copyin(uap->data, (void *)&udata, uap->length);
206 if (error)
207 return (error);
208 AUDIT_ARG(auditon, &udata);
208 AUDIT_ARG_AUDITON(&udata);
209 break;
210 }
211
212 /*
213 * XXXAUDIT: Locking?
214 */
215 switch (uap->cmd) {
216 case A_OLDGETPOLICY:

--- 661 unchanged lines hidden ---
209 break;
210 }
211
212 /*
213 * XXXAUDIT: Locking?
214 */
215 switch (uap->cmd) {
216 case A_OLDGETPOLICY:

--- 661 unchanged lines hidden ---