(argument: &str)
| 607 | } |
| 608 | |
| 609 | fn debugfs_quote_argument(argument: &str) -> Option<String> { |
| 610 | if argument.is_empty() { |
| 611 | return None; |
| 612 | } |
| 613 | |
| 614 | let mut quoted = String::with_capacity(argument.len() + 2); |
| 615 | quoted.push('"'); |
| 616 | for ch in argument.chars() { |
| 617 | match ch { |
| 618 | '\0' | '\n' | '\r' => return None, |
| 619 | '\\' => quoted.push_str("\\\\"), |
| 620 | '"' => quoted.push_str("\\\""), |
| 621 | _ => quoted.push(ch), |
| 622 | } |
| 623 | } |
| 624 | quoted.push('"'); |
| 625 | Some(quoted) |
| 626 | } |
| 627 | |
| 628 | fn sandbox_guest_user_ids(rootfs: &Path) -> Result<Option<(u32, u32)>, String> { |
| 629 | let passwd_path = rootfs.join("etc/passwd"); |
no test coverage detected