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

Function mls_vnode_setlabel_extattr

freebsd/security/mac_mls/mac_mls.c:3173–3193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3171}
3172
3173static int
3174mls_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
3195static struct mac_policy_ops mls_ops =
3196{

Callers

nothing calls this directly

Calls 3

bzeroFunction · 0.85
mls_copy_effectiveFunction · 0.85
vn_extattr_setFunction · 0.85

Tested by

no test coverage detected