]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/security/audit/audit_arg.c
xnu-3248.60.10.tar.gz
[apple/xnu.git] / bsd / security / audit / audit_arg.c
index eb6d5d4346526f755b42eb4e3184a53f582199bf..20733790997f80e4c75fb3daeda914b547f82a58 100644 (file)
@@ -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
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -75,8 +75,6 @@
 #include <kern/host.h>
 #include <kern/kalloc.h>
 #include <kern/zalloc.h>
 #include <kern/host.h>
 #include <kern/kalloc.h>
 #include <kern/zalloc.h>
-#include <kern/lock.h>
-#include <kern/wait_queue.h>
 #include <kern/sched_prim.h>
 
 #if CONFIG_MACF
 #include <kern/sched_prim.h>
 
 #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;
 
        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,
        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;
 
        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;
                        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;
                        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);
                }
                        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;
                        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;
                        pcb = (struct inpcb *)so->so_pcb;
                        sin6 = (struct sockaddr_in6 *)
                            &ar->k_ar.ar_arg_sockinfo.sai_faddr;