()
| 225 | /// using the real UID via `getuid()`. |
| 226 | #[must_use] |
| 227 | pub fn default_socket_path() -> PathBuf { |
| 228 | #[cfg(target_os = "macos")] |
| 229 | { |
| 230 | let home = std::env::var("HOME").expect("HOME must be set on macOS"); |
| 231 | PathBuf::from(home).join(".local/share/containers/podman/machine/podman.sock") |
| 232 | } |
| 233 | #[cfg(target_os = "linux")] |
| 234 | { |
| 235 | std::env::var("XDG_RUNTIME_DIR").map_or_else( |
| 236 | |_| { |
| 237 | let uid = rustix::process::getuid().as_raw(); |
| 238 | PathBuf::from(format!("/run/user/{uid}/podman/podman.sock")) |
| 239 | }, |
| 240 | |xdg| PathBuf::from(xdg).join("podman/podman.sock"), |
| 241 | ) |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | impl Default for PodmanComputeConfig { |
nothing calls this directly
no outgoing calls
no test coverage detected