(capability: impl CompatCapability)
| 487 | /// [`prctl(PR_CAPBSET_DROP,…)`]: https://man7.org/linux/man-pages/man2/prctl.2.html |
| 488 | #[inline] |
| 489 | pub fn remove_capability_from_bounding_set(capability: impl CompatCapability) -> io::Result<()> { |
| 490 | let capset = capability.as_capability_set(private::Token).bits(); |
| 491 | if capset.count_ones() != 1 { |
| 492 | return Err(Errno::INVAL); |
| 493 | } |
| 494 | let cap = capset.trailing_zeros(); |
| 495 | |
| 496 | // as *mut _ should be ptr::without_provenance_mut but our MSRV does not allow it. |
| 497 | unsafe { prctl_2args(PR_CAPBSET_DROP, cap as usize as *mut _) }.map(|_r| ()) |
| 498 | } |
| 499 | |
| 500 | // |
| 501 | // PR_GET_SECUREBITS/PR_SET_SECUREBITS |
nothing calls this directly
no test coverage detected