{"record":{"id":"bbe1f21f5639027c","repo":"chenhg5/cc-connect","slug":"config-s-run-as-user-is-only-supported-on-linux","errorCode":null,"errorMessage":"config: %s.run_as_user is only supported on Linux/macOS","messagePattern":"config: (.+?)\\.run_as_user is only supported on Linux/macOS","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":69,"sourceCode":"\t\"SUDO_COMMAND\":          true,\n}\n\nfunc validateRunAsEnv(prefix string, envVars []string) error {\n\tfor _, v := range envVars {\n\t\tname := strings.TrimSpace(v)\n\t\tif dangerousEnvVars[strings.ToUpper(name)] {\n\t\t\treturn fmt.Errorf(\"config: %s.run_as_env must not include dangerous variable %q\", prefix, name)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateRunAsUser(prefix, name string) error {\n\tif name == \"\" {\n\t\treturn nil\n\t}\n\tif runtime.GOOS == \"windows\" {\n\t\treturn fmt.Errorf(\"config: %s.run_as_user is only supported on Linux/macOS\", prefix)\n\t}\n\tif name == \"root\" || name == \"0\" {\n\t\treturn fmt.Errorf(\"config: %s.run_as_user must not be root\", prefix)\n\t}\n\tif !isValidRunAsUserName(name) {\n\t\treturn fmt.Errorf(\"config: %s.run_as_user %q contains invalid characters (allowed: a-z, A-Z, 0-9, -, _, .; must start with a letter or underscore)\", prefix, name)\n\t}\n\treturn nil\n}\n\n// configMu serializes read-modify-write cycles to prevent lost updates.\nvar configMu sync.Mutex\n\n// ConfigPath stores the path to the config file for saving\nvar ConfigPath string\n\ntype Config struct {\n\tDataDir        string `toml:\"data_dir\"` // session store directory, default ~/.cc-connect","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/config/config.go#L51-L87","documentation":"A config validation error from validateRunAsUser: run_as_user is configured but the platform is Windows, where the runuser-style privilege drop mechanism is not implemented. The feature is Linux/macOS only, so config load aborts rather than silently ignoring the setting.","triggerScenarios":"Thrown at config/config.go:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove run_as_user from config.toml on Windows hosts","Run cc-connect under the desired user account directly","Deploy on Linux/macOS if privilege separation is required"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}