| 315 | } |
| 316 | |
| 317 | static int |
| 318 | lomac_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 | |
| 343 | static int |
| 344 | lomac_high_single(struct mac_lomac *ml) |
no outgoing calls
no test coverage detected