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

Function lomac_system_check_swapon

freebsd/security/mac_lomac/mac_lomac.c:2178–2197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2176}
2177
2178static int
2179lomac_system_check_swapon(struct ucred *cred, struct vnode *vp,
2180 struct label *vplabel)
2181{
2182 struct mac_lomac *subj, *obj;
2183
2184 if (!lomac_enabled)
2185 return (0);
2186
2187 subj = SLOT(cred->cr_label);
2188 obj = SLOT(vplabel);
2189
2190 if (lomac_subject_privileged(subj))
2191 return (EPERM);
2192
2193 if (!lomac_high_single(obj))
2194 return (EACCES);
2195
2196 return (0);
2197}
2198
2199static int
2200lomac_system_check_sysctl(struct ucred *cred, struct sysctl_oid *oidp,

Callers

nothing calls this directly

Calls 2

lomac_subject_privilegedFunction · 0.85
lomac_high_singleFunction · 0.85

Tested by

no test coverage detected