X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/6d2010ae8f7a6078e10b361c6962983bab233e0f..7e41aa883dd258f888d0470250eead40a53ef1f5:/bsd/security/audit/audit_arg.c?ds=sidebyside diff --git a/bsd/security/audit/audit_arg.c b/bsd/security/audit/audit_arg.c index eb6d5d434..207337909 100644 --- a/bsd/security/audit/audit_arg.c +++ b/bsd/security/audit/audit_arg.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2009 Apple Inc. + * Copyright (c) 1999-2012 Apple Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -75,8 +75,6 @@ #include #include #include -#include -#include #include #if CONFIG_MACF @@ -594,7 +592,7 @@ audit_arg_file(struct kaudit_record *ar, __unused proc_t p, struct sockaddr_in *sin; struct sockaddr_in6 *sin6; - switch (fp->f_fglob->fg_type) { + switch (FILEGLOB_DTYPE(fp->f_fglob)) { case DTYPE_VNODE: /* case DTYPE_FIFO: */ audit_arg_vnpath_withref(ar, @@ -603,15 +601,13 @@ audit_arg_file(struct kaudit_record *ar, __unused proc_t p, case DTYPE_SOCKET: so = (struct socket *)fp->f_fglob->fg_data; - if (INP_CHECK_SOCKAF(so, PF_INET)) { + if (SOCK_CHECK_DOM(so, PF_INET)) { if (so->so_pcb == NULL) break; ar->k_ar.ar_arg_sockinfo.sai_type = so->so_type; - ar->k_ar.ar_arg_sockinfo.sai_domain = - INP_SOCKAF(so); - ar->k_ar.ar_arg_sockinfo.sai_protocol = - so->so_proto->pr_protocol; + ar->k_ar.ar_arg_sockinfo.sai_domain = SOCK_DOM(so); + ar->k_ar.ar_arg_sockinfo.sai_protocol = SOCK_PROTO(so); pcb = (struct inpcb *)so->so_pcb; sin = (struct sockaddr_in *) &ar->k_ar.ar_arg_sockinfo.sai_faddr; @@ -623,15 +619,13 @@ audit_arg_file(struct kaudit_record *ar, __unused proc_t p, sin->sin_port = pcb->inp_lport; ARG_SET_VALID(ar, ARG_SOCKINFO); } - if (INP_CHECK_SOCKAF(so, PF_INET6)) { + if (SOCK_CHECK_DOM(so, PF_INET6)) { if (so->so_pcb == NULL) break; ar->k_ar.ar_arg_sockinfo.sai_type = so->so_type; - ar->k_ar.ar_arg_sockinfo.sai_domain = - INP_SOCKAF(so); - ar->k_ar.ar_arg_sockinfo.sai_protocol = - so->so_proto->pr_protocol; + ar->k_ar.ar_arg_sockinfo.sai_domain = SOCK_DOM(so); + ar->k_ar.ar_arg_sockinfo.sai_protocol = SOCK_PROTO(so); pcb = (struct inpcb *)so->so_pcb; sin6 = (struct sockaddr_in6 *) &ar->k_ar.ar_arg_sockinfo.sai_faddr;