{"record":{"id":"49e5cf0d24e65537","repo":"NationalSecurityAgency/ghidra","slug":"missing-system-name-in-pg-ident-conf-entry","errorCode":null,"errorMessage":"Missing system-name in pg_ident.conf entry","messagePattern":"Missing system-name in pg_ident\\.conf entry","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ServerConfig.java","lineNumber":388,"sourceCode":"\t\t */\n\t\tpublic boolean parse(String line) throws IOException {\n\t\t\tint pos = 0;\n\t\t\tpos = skipWhiteSpace(pos, line);\n\t\t\tif (pos >= line.length()) {\n\t\t\t\treturn false;\t\t\t// Blank line, treat as comment\n\t\t\t}\n\t\t\tif (line.charAt(pos) == '\"') {\n\t\t\t\tthrow new IOException(\"Bad map field in pg_ident.conf entry\");\n\t\t\t}\n\t\t\tif (line.charAt(pos) == '#') {\n\t\t\t\treturn false;\t\t\t// Return false to indicate comment\n\t\t\t}\n\t\t\tint endpos = parseField(pos, line);\n\t\t\tmapName = line.substring(pos, endpos);\n\n\t\t\tpos = skipWhiteSpace(endpos, line);\n\t\t\tif (pos >= line.length()) {\n\t\t\t\tthrow new IOException(\"Missing system-name in pg_ident.conf entry\");\n\t\t\t}\n\t\t\telse if (line.charAt(pos) == '\"') {\n\t\t\t\tsystemNameIsQuoted = true;\n\t\t\t\tendpos = parseDoubleQuote(pos, line);\n\t\t\t\tif (line.charAt(endpos - 1) != '\"') {\n\t\t\t\t\tthrow new IOException(\"Entry missing ending quote in pg_ident.conf\");\n\t\t\t\t}\n\t\t\t\tsystemName = line.substring(pos + 1, endpos - 1);\t\t// Strip quotes\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsystemNameIsQuoted = false;\n\t\t\t\tendpos = parseField(pos, line);\n\t\t\t\tsystemName = line.substring(pos, endpos);\n\t\t\t}\n\n\t\t\tpos = skipWhiteSpace(endpos, line);\n\t\t\tif (pos >= line.length()) {\n\t\t\t\tthrow new IOException(\"Missing role in pg_ident.conf entry\");","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ServerConfig.java#L370-L406","documentation":"Thrown by ServerConfig.IdentEntry.parse when, after reading the map-name field, there is no remaining content for the required system-name field (pos >= line.length() after skipping whitespace). The pg_ident.conf entry format requires three fields: map name, system (OS) user name, and role.","triggerScenarios":"Parsing a pg_ident.conf line that has a map name but no system-name token afterwards, e.g. 'mymap' alone or 'mymap   ' with only trailing whitespace.","commonSituations":"A truncated pg_ident.conf line missing the system-user field. Editing the file and deleting the second field. A copy-paste that dropped columns.","solutions":["Add the missing system-name (OS user) field after the map name.","Use the full three-field form: mapname systemusername rolename.","Remove incomplete lines or comment them out with '#'."],"exampleFix":"// before (pg_ident.conf line)\nmymap   \n// after\nmymap   myuser   myrole","handlingStrategy":"validation","validationCode":"// Ensure a pg_ident.conf line has all three fields before parsing\nString[] split = line.trim().split(\"\\\\s+\");\nif (split.length < 3) {\n    throw new IllegalArgumentException(\n        \"pg_ident.conf entry needs map-name, system-name, and role: \" + line);\n}\nidentEntry.parse(line);","typeGuard":null,"tryCatchPattern":"try {\n    identEntry.parse(line);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"Missing system-name\")) {\n        log.error(\"pg_ident.conf entry missing system-name field: '{}'\", line);\n    }\n    throw e;\n}","preventionTips":["Every pg_ident.conf entry needs exactly three fields: mapname systemname rolename.","Remove or comment out incomplete lines with '#'.","Lint the file for three-field completeness."],"tags":["bsim","server-config","config-parsing","postgresql","pg-ident"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}