| 2874 | } |
| 2875 | |
| 2876 | static int |
| 2877 | lomac_vnode_setlabel_extattr(struct ucred *cred, struct vnode *vp, |
| 2878 | struct label *vplabel, struct label *intlabel) |
| 2879 | { |
| 2880 | struct mac_lomac *source, temp; |
| 2881 | size_t buflen; |
| 2882 | int error; |
| 2883 | |
| 2884 | buflen = sizeof(temp); |
| 2885 | bzero(&temp, buflen); |
| 2886 | |
| 2887 | source = SLOT(intlabel); |
| 2888 | if ((source->ml_flags & MAC_LOMAC_FLAG_SINGLE) == 0) |
| 2889 | return (0); |
| 2890 | |
| 2891 | lomac_copy_single(source, &temp); |
| 2892 | error = vn_extattr_set(vp, IO_NODELOCKED, MAC_LOMAC_EXTATTR_NAMESPACE, |
| 2893 | MAC_LOMAC_EXTATTR_NAME, buflen, (char *)&temp, curthread); |
| 2894 | return (error); |
| 2895 | } |
| 2896 | |
| 2897 | static struct mac_policy_ops lomac_ops = |
| 2898 | { |
nothing calls this directly
no test coverage detected