{"record":{"id":"19c18ba94349a8a5","repo":"jdx/mise","slug":"invalid-command-wrapper-name-name","errorCode":null,"errorMessage":"invalid command wrapper name: {name:?}","messagePattern":"invalid command wrapper name: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/shims.rs","lineNumber":1147,"sourceCode":"        a == b\n    }\n}\n\npub(crate) fn command_name_without_exe_suffix(bin_name: &str) -> &str {\n    let suffix = std::env::consts::EXE_SUFFIX;\n    if suffix.is_empty() {\n        return bin_name;\n    }\n    let suffix_start = bin_name.len().saturating_sub(suffix.len());\n    match (bin_name.get(..suffix_start), bin_name.get(suffix_start..)) {\n        (Some(name), Some(actual_suffix)) if actual_suffix.eq_ignore_ascii_case(suffix) => name,\n        _ => bin_name,\n    }\n}\n\nfn validate_wrapper_name(name: &str) -> Result<()> {\n    if name.is_empty() || name == \".\" || name == \"..\" || name.contains('/') || name.contains('\\\\') {\n        bail!(\"invalid command wrapper name: {name:?}\");\n    }\n    if cfg!(windows) && name.contains('.') {\n        bail!(\"command wrapper names cannot contain dots on Windows: {name:?}\");\n    }\n    Ok(())\n}\n\nfn validate_wrapper_names<'a>(names: impl IntoIterator<Item = &'a String>) -> Result<()> {\n    let mut normalized = HashSet::new();\n    for name in names {\n        validate_wrapper_name(name)?;\n        if cfg!(macos) && !normalized.insert(name.to_lowercase()) {\n            bail!(\"command wrapper names collide on macOS after case normalization: {name:?}\");\n        }\n    }\n    Ok(())\n}\n","sourceCodeStart":1129,"sourceCodeEnd":1165,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/shims.rs#L1129-L1165","documentation":"validate_wrapper_name rejects a [command-wrappers] entry whose name is unusable as a shim filename: empty, '.' or '..', or containing a path separator ('/' or '\\\\'). Such a name could escape the shims directory or resolve incorrectly, so configuration fails fast.","triggerScenarios":"Thrown at src/shims.rs:1147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a plain file name without slashes for the wrapper","Remove path traversal segments ('.', '..')","Name the wrapper after the command it wraps"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}