Skip to main content

validate_name

Function validate_name 

Source
pub fn validate_name(name: &str) -> Result<(), Error>
Expand description

Validate a profile name. Allowed: ASCII alphanumerics plus -, _, . (but never starting with .), max 64 chars. Rejects Windows reserved device names so a profile created on Linux cannot become a poisoned path when the directory is read on Windows.

This is the structural check only — it does not touch the filesystem. Callers that need to ensure the target directory doesn’t collide with an existing non-directory entry should chain ensure_no_filesystem_collision after this.