Validate whether a process identity field value is acceptable. Accepts either the literal `"sandbox"` or a numeric UID/GID parsed as `u32` within the range `[MIN_SANDBOX_UID, MAX_SANDBOX_UID]`. Rejects: - The empty string (callers should use `ensure_sandbox_process_identity` to fill defaults before validation) - UID 0 or values below `MIN_SANDBOX_UID` - Values above `MAX_SANDBOX_UID` - Non-numer
(value: &str)
| 944 | /// - Values above `MAX_SANDBOX_UID` |
| 945 | /// - Non-numeric strings other than `"sandbox"` (e.g. `"root"`, `"nobody"`) |
| 946 | pub fn is_valid_sandbox_identity(value: &str) -> bool { |
| 947 | if value == SANDBOX_NAME { |
| 948 | return true; |
| 949 | } |
| 950 | value |
| 951 | .parse::<u32>() |
| 952 | .is_ok_and(|uid| (MIN_SANDBOX_UID..=MAX_SANDBOX_UID).contains(&uid)) |
| 953 | } |
| 954 | |
| 955 | // --------------------------------------------------------------------------- |
| 956 | // Public API |
no outgoing calls
no test coverage detected