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

Function lomac_subject_privileged

freebsd/security/mac_lomac/mac_lomac.c:317–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317static int
318lomac_subject_privileged(struct mac_lomac *ml)
319{
320
321 KASSERT((ml->ml_flags & MAC_LOMAC_FLAGS_BOTH) ==
322 MAC_LOMAC_FLAGS_BOTH,
323 ("lomac_subject_privileged: subject doesn't have both labels"));
324
325 /* If the single is EQUAL, it's ok. */
326 if (ml->ml_single.mle_type == MAC_LOMAC_TYPE_EQUAL)
327 return (0);
328
329 /* If either range endpoint is EQUAL, it's ok. */
330 if (ml->ml_rangelow.mle_type == MAC_LOMAC_TYPE_EQUAL ||
331 ml->ml_rangehigh.mle_type == MAC_LOMAC_TYPE_EQUAL)
332 return (0);
333
334 /* If the range is low-high, it's ok. */
335 if (ml->ml_rangelow.mle_type == MAC_LOMAC_TYPE_LOW &&
336 ml->ml_rangehigh.mle_type == MAC_LOMAC_TYPE_HIGH)
337 return (0);
338
339 /* It's not ok. */
340 return (EPERM);
341}
342
343static int
344lomac_high_single(struct mac_lomac *ml)

Callers 12

lomac_cred_check_relabelFunction · 0.85
lomac_kld_check_loadFunction · 0.85
lomac_pipe_check_relabelFunction · 0.85
lomac_priv_checkFunction · 0.85
lomac_system_check_acctFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected