(path: &std::path::Path, content: &[u8])
| 289 | /// Write a file with secure Unix permissions (0o600) for use in tests. |
| 290 | #[cfg(unix)] |
| 291 | fn write_secure(path: &std::path::Path, content: &[u8]) { |
| 292 | use std::io::Write as _; |
| 293 | let mut f = std::fs::File::create(path).unwrap(); |
| 294 | f.write_all(content).unwrap(); |
| 295 | drop(f); |
| 296 | std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o600)).unwrap(); |
| 297 | } |
| 298 | |
| 299 | #[tokio::test] |
| 300 | #[cfg(unix)] |
no test coverage detected