MCPcopy Create free account
hub / github.com/F-Stack/f-stack / audit_arg_vnode

Function audit_arg_vnode

freebsd/security/audit/audit_arg.c:868–890  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

866 * XXXAUDIT: Possibly KASSERT the path pointer is NULL?
867 */
868static int
869audit_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
892void
893audit_arg_vnode1(struct vnode *vp)

Callers 2

audit_arg_vnode1Function · 0.85
audit_arg_vnode2Function · 0.85

Calls 1

VOP_GETATTRFunction · 0.85

Tested by

no test coverage detected