Skip to main content

is_valid_storage_path

Function is_valid_storage_path 

Source
pub fn is_valid_storage_path(value: &str) -> bool
Expand description

Check whether a candidate string is an acceptable filesystem-path setting (import_directory, export_directory, dump_directory).

Rejects:

  • empty / whitespace-only strings,
  • strings longer than STORAGE_PATH_MAX_LEN bytes,
  • strings containing a NUL byte (\0),
  • strings containing a .. path component (path-traversal guard),
  • strings that start with ~ (no shell-style home expansion).

The check is purely syntactic — it does not touch the filesystem.