(socket_path: &Path)
| 293 | } |
| 294 | |
| 295 | fn prepare_compute_driver_socket(socket_path: &Path) -> std::result::Result<(), String> { |
| 296 | let Some(parent) = socket_path.parent() else { |
| 297 | return Err(format!( |
| 298 | "vm compute driver socket path '{}' has no parent directory", |
| 299 | socket_path.display() |
| 300 | )); |
| 301 | }; |
| 302 | let expected_uid = current_euid(); |
| 303 | prepare_private_socket_dir(parent, expected_uid)?; |
| 304 | remove_stale_socket(socket_path, expected_uid) |
| 305 | } |
| 306 | |
| 307 | fn current_euid() -> u32 { |
| 308 | rustix::process::geteuid().as_raw() |
no test coverage detected