* Function to save the path and vnode attr information into the audit * record. * * It is assumed that the caller will hold any vnode locks necessary to * perform a VOP_GETATTR() on the passed vnode. * * XXX: The attr code is very similar to vfs_default.c:vop_stdstat(), but always * provides access to the generation number as we need that to construct the * BSM file ID. * * XXX: We shoul
| 866 | * XXXAUDIT: Possibly KASSERT the path pointer is NULL? |
| 867 | */ |
| 868 | static int |
| 869 | audit_arg_vnode(struct vnode *vp, struct vnode_au_info *vnp) |
| 870 | { |
| 871 | struct vattr vattr; |
| 872 | int error; |
| 873 | |
| 874 | ASSERT_VOP_LOCKED(vp, "audit_arg_vnode"); |
| 875 | |
| 876 | error = VOP_GETATTR(vp, &vattr, curthread->td_ucred); |
| 877 | if (error) { |
| 878 | /* XXX: How to handle this case? */ |
| 879 | return (error); |
| 880 | } |
| 881 | |
| 882 | vnp->vn_mode = vattr.va_mode; |
| 883 | vnp->vn_uid = vattr.va_uid; |
| 884 | vnp->vn_gid = vattr.va_gid; |
| 885 | vnp->vn_dev = vattr.va_rdev; |
| 886 | vnp->vn_fsid = vattr.va_fsid; |
| 887 | vnp->vn_fileid = vattr.va_fileid; |
| 888 | vnp->vn_gen = vattr.va_gen; |
| 889 | return (0); |
| 890 | } |
| 891 | |
| 892 | void |
| 893 | audit_arg_vnode1(struct vnode *vp) |
no test coverage detected