| 3171 | } |
| 3172 | |
| 3173 | static int |
| 3174 | mls_vnode_setlabel_extattr(struct ucred *cred, struct vnode *vp, |
| 3175 | struct label *vplabel, struct label *intlabel) |
| 3176 | { |
| 3177 | struct mac_mls *source, mm_temp; |
| 3178 | size_t buflen; |
| 3179 | int error; |
| 3180 | |
| 3181 | buflen = sizeof(mm_temp); |
| 3182 | bzero(&mm_temp, buflen); |
| 3183 | |
| 3184 | source = SLOT(intlabel); |
| 3185 | if ((source->mm_flags & MAC_MLS_FLAG_EFFECTIVE) == 0) |
| 3186 | return (0); |
| 3187 | |
| 3188 | mls_copy_effective(source, &mm_temp); |
| 3189 | |
| 3190 | error = vn_extattr_set(vp, IO_NODELOCKED, MAC_MLS_EXTATTR_NAMESPACE, |
| 3191 | MAC_MLS_EXTATTR_NAME, buflen, (char *) &mm_temp, curthread); |
| 3192 | return (error); |
| 3193 | } |
| 3194 | |
| 3195 | static struct mac_policy_ops mls_ops = |
| 3196 | { |
nothing calls this directly
no test coverage detected