| 3136 | } |
| 3137 | |
| 3138 | static int |
| 3139 | mls_vnode_create_extattr(struct ucred *cred, struct mount *mp, |
| 3140 | struct label *mplabel, struct vnode *dvp, struct label *dvplabel, |
| 3141 | struct vnode *vp, struct label *vplabel, struct componentname *cnp) |
| 3142 | { |
| 3143 | struct mac_mls *source, *dest, mm_temp; |
| 3144 | size_t buflen; |
| 3145 | int error; |
| 3146 | |
| 3147 | buflen = sizeof(mm_temp); |
| 3148 | bzero(&mm_temp, buflen); |
| 3149 | |
| 3150 | source = SLOT(cred->cr_label); |
| 3151 | dest = SLOT(vplabel); |
| 3152 | mls_copy_effective(source, &mm_temp); |
| 3153 | |
| 3154 | error = vn_extattr_set(vp, IO_NODELOCKED, MAC_MLS_EXTATTR_NAMESPACE, |
| 3155 | MAC_MLS_EXTATTR_NAME, buflen, (char *) &mm_temp, curthread); |
| 3156 | if (error == 0) |
| 3157 | mls_copy_effective(source, dest); |
| 3158 | return (error); |
| 3159 | } |
| 3160 | |
| 3161 | static void |
| 3162 | mls_vnode_relabel(struct ucred *cred, struct vnode *vp, |
nothing calls this directly
no test coverage detected