| 168 | |
| 169 | #[inline] |
| 170 | fn capset(pid: Option<Pid>, sets: CapabilitySets) -> io::Result<()> { |
| 171 | let mut header = linux_raw_sys::general::__user_cap_header_struct { |
| 172 | version: linux_raw_sys::general::_LINUX_CAPABILITY_VERSION_3, |
| 173 | pid: Pid::as_raw(pid) as backend::c::c_int, |
| 174 | }; |
| 175 | let data = [ |
| 176 | linux_raw_sys::general::__user_cap_data_struct { |
| 177 | effective: sets.effective.bits() as u32, |
| 178 | permitted: sets.permitted.bits() as u32, |
| 179 | inheritable: sets.inheritable.bits() as u32, |
| 180 | }, |
| 181 | linux_raw_sys::general::__user_cap_data_struct { |
| 182 | effective: (sets.effective.bits() >> u32::BITS) as u32, |
| 183 | permitted: (sets.permitted.bits() >> u32::BITS) as u32, |
| 184 | inheritable: (sets.inheritable.bits() >> u32::BITS) as u32, |
| 185 | }, |
| 186 | ]; |
| 187 | |
| 188 | backend::thread::syscalls::capset(&mut header, &data) |
| 189 | } |