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

Function lomac_vnode_create_extattr

freebsd/security/mac_lomac/mac_lomac.c:2779–2807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2777}
2778
2779static int
2780lomac_vnode_create_extattr(struct ucred *cred, struct mount *mp,
2781 struct label *mplabel, struct vnode *dvp, struct label *dvplabel,
2782 struct vnode *vp, struct label *vplabel, struct componentname *cnp)
2783{
2784 struct mac_lomac *source, *dest, *dir, temp;
2785 size_t buflen;
2786 int error;
2787
2788 buflen = sizeof(temp);
2789 bzero(&temp, buflen);
2790
2791 source = SLOT(cred->cr_label);
2792 dest = SLOT(vplabel);
2793 dir = SLOT(dvplabel);
2794 if (dir->ml_flags & MAC_LOMAC_FLAG_AUX) {
2795 lomac_copy_auxsingle(dir, &temp);
2796 lomac_set_single(&temp, dir->ml_auxsingle.mle_type,
2797 dir->ml_auxsingle.mle_grade);
2798 } else {
2799 lomac_copy_single(source, &temp);
2800 }
2801
2802 error = vn_extattr_set(vp, IO_NODELOCKED, MAC_LOMAC_EXTATTR_NAMESPACE,
2803 MAC_LOMAC_EXTATTR_NAME, buflen, (char *)&temp, curthread);
2804 if (error == 0)
2805 lomac_copy(&temp, dest);
2806 return (error);
2807}
2808
2809static void
2810lomac_vnode_execve_transition(struct ucred *old, struct ucred *new,

Callers

nothing calls this directly

Calls 6

bzeroFunction · 0.85
lomac_copy_auxsingleFunction · 0.85
lomac_set_singleFunction · 0.85
lomac_copy_singleFunction · 0.85
vn_extattr_setFunction · 0.85
lomac_copyFunction · 0.85

Tested by

no test coverage detected