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

Function lomac_vnode_setlabel_extattr

freebsd/security/mac_lomac/mac_lomac.c:2876–2895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2874}
2875
2876static int
2877lomac_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
2897static struct mac_policy_ops lomac_ops =
2898{

Callers

nothing calls this directly

Calls 3

bzeroFunction · 0.85
lomac_copy_singleFunction · 0.85
vn_extattr_setFunction · 0.85

Tested by

no test coverage detected