{"record":{"id":"382ceb4adf90654d","repo":"linera-io/linera-protocol","slug":"project-name-name-should-not-contain-path-separa","errorCode":null,"errorMessage":"Project name {name} should not contain path-separators","messagePattern":"Project name (.+?) should not contain path-separators","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"linera-service/src/project.rs","lineNumber":29,"sourceCode":"use cargo_toml::Manifest;\nuse convert_case::{Case, Casing};\nuse current_platform::CURRENT_PLATFORM;\nuse fs_err::File;\nuse tracing::debug;\n\n/// A Linera application project on disk, rooted at a given directory.\npub struct Project {\n    root: PathBuf,\n}\n\nimpl Project {\n    /// Creates a new application project from the template, scaffolding its files.\n    pub fn create_new(\n        name: &str,\n        linera_root: Option<&Path>,\n        dir: Option<PathBuf>,\n    ) -> Result<Self> {\n        ensure!(\n            !name.contains(std::path::is_separator),\n            \"Project name {name} should not contain path-separators\",\n        );\n        let root = match dir {\n            Some(dir) => dir,\n            None => {\n                let root = PathBuf::from(name);\n                ensure!(\n                    !root.exists(),\n                    \"Directory {} already exists\",\n                    root.display(),\n                );\n                root\n            }\n        };\n        ensure!(\n            root.extension().is_none(),\n            \"Project name {name} should not have a file extension\",","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/project.rs#L11-L47","documentation":"Project::create_new scaffolds a new Linera application project into a directory named after the project; a path separator in the name would escape the intended directory, so any name containing '/' (or '\\' on Windows, via std::path::is_separator) is rejected before anything is created.","triggerScenarios":"`linera project new` with a name like `my/app`, `../evil`, or any other string containing a path separator.","commonSituations":"Passing a relative path instead of a bare name; copy-pasting 'org/app' style package names; Windows users typing backslashes.","solutions":["Use a plain name: `linera project new my-app`","To scaffold into a specific location, pass the directory separately (create_new's dir parameter) rather than embedding a path in the name","Replace separators with dashes"],"exampleFix":"# before\n$ linera project new my/dapp\nerror: Project name my/dapp should not contain path-separators\n\n# after\n$ linera project new my-dapp","handlingStrategy":"validation","validationCode":"if name.contains(std::path::is_separator) {\n    anyhow::bail!(\"project name must not contain path separators: {name}\");\n}","typeGuard":"fn is_valid_project_name(name: &str) -> bool {\n    !name.is_empty()\n        && !name.contains(std::path::is_separator)\n        && std::path::Path::new(name).extension().is_none()\n}","tryCatchPattern":null,"preventionTips":["Pass bare names, never paths, to project creation","Sanitize user-supplied names in tooling that wraps the CLI"],"tags":["cli","project","validation","path","scaffolding"],"backgroundTag":"invalid-project-name","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}