| 2777 | } |
| 2778 | |
| 2779 | static int |
| 2780 | lomac_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 | |
| 2809 | static void |
| 2810 | lomac_vnode_execve_transition(struct ucred *old, struct ucred *new, |
nothing calls this directly
no test coverage detected