{"record":{"id":"e300c62f71aeaa9b","repo":"jdx/mise","slug":"bootstrap-user-name-comment-must-not-contain","errorCode":null,"errorMessage":"bootstrap user '{name}' comment must not contain ':', CR, or LF","messagePattern":"bootstrap user '(.+?)' comment must not contain ':', CR, or LF","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/accounts.rs","lineNumber":372,"sourceCode":"        }\n        if config.move_home && config.home.is_none() {\n            bail!(\"bootstrap user '{name}' sets move_home without home\");\n        }\n        if let Some(group) = &config.group {\n            validate_name(\"group\", group)?;\n        }\n        if let Some(path) = &config.home {\n            validate_account_path(&name, \"home\", path)?;\n        }\n        if let Some(path) = &config.shell {\n            validate_account_path(&name, \"shell\", path)?;\n        }\n        if config\n            .comment\n            .as_ref()\n            .is_some_and(|comment| comment.contains([':', '\\n', '\\r']))\n        {\n            bail!(\"bootstrap user '{name}' comment must not contain ':', CR, or LF\");\n        }\n        let mut groups = config\n            .groups\n            .map(|groups| {\n                groups\n                    .into_iter()\n                    .map(|group| {\n                        validate_name(\"group\", &group)?;\n                        Ok(group)\n                    })\n                    .collect::<Result<BTreeSet<_>>>()\n            })\n            .transpose()?;\n        if let (Some(groups), Some(primary_group)) = (&mut groups, &config.group) {\n            groups.remove(primary_group);\n        }\n        let inspection = inspect_user(&name, config.uid)?;\n        Ok(Self {","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/accounts.rs#L354-L390","documentation":"Bootstrap user comments (GECOS field) are written to /etc/passwd, where ':' is the field separator and newlines would corrupt the line-based file. mise validates the comment field and rejects any comment containing ':', carriage return, or line feed before making system changes.","triggerScenarios":"Setting comment on a bootstrap user to a string containing ':', '\\n', or '\\r' — e.g. 'Work: admin' or a multi-line description.","commonSituations":"Using 'Name: Role' style descriptions; templating comments that expand to multi-line values; building the comment from environment data containing CR/LF.","solutions":["Remove ':' characters from the comment (use a space, dash, or semicolon instead).","Collapse any newlines/CRs into a single-line comment.","Re-run `mise bootstrap plan` after editing to confirm the comment validates."],"exampleFix":"// before\n[[bootstrap.users]]\nname = \"svc\"\ncomment = \"CI: build agent\"\n\n// after\n[[bootstrap.users]]\nname = \"svc\"\ncomment = \"CI - build agent\"","handlingStrategy":"validation","validationCode":"function validateComment(user) {\n  if (user.comment && /[:\\r\\n]/.test(user.comment)) {\n    throw new Error(`user '${user.name}': comment must not contain ':', CR, or LF`);\n  }\n}","typeGuard":"function hasSafeComment(user) {\n  return typeof user.comment !== 'string' || !/[:\\r\\n]/.test(user.comment);\n}","tryCatchPattern":"try {\n  await mise.bootstrap.apply(config);\n} catch (e) {\n  if (String(e).includes('comment must not contain')) {\n    console.error('Sanitize the GECOS comment field:', e.message);\n  } else throw e;\n}","preventionTips":["Avoid ':' in free-text fields destined for /etc/passwd.","Sanitize interpolated/templated values (strip \\r and \\n).","Keep comments short single-line descriptions."],"tags":["bootstrap","passwd","input-validation"],"backgroundTag":"invalid-argument-format","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"}