public static void patchIdent(File inFile, File outFile, String mapName, String systemName,
			String roleName, boolean addUser) throws IOException {
		BufferedReader reader = new BufferedReader(new FileReader(inFile));
		FileWriter writer = new FileWriter(outFile);

		try {
			boolean entryIsMatched = !addUser;
			for (;;) {
				String line = reader.readLine();
				if (line == null) {
					break;
				}
				IdentLine identLine = new IdentLine();
				if (identLine.parse(line)) {
					if (identLine.matchRole(mapName, roleName)) {	// Found old entry
						if (!addUser) {								// If we are supposed to drop the entry
							continue;								// Skip the emit method below
						}
						identLine.setSystemName(systemName);			// Update to new role
						entryIsMatched = true;
					}
					identLine.emit(writer);
					writer.write('\n');
				}
				else {	// Read a comment
					writer.write(line);			// Keep line as is
					writer.write('\n');
				}
			}
			if (!entryIsMatched) {
				IdentLine identLine = new IdentLine(mapName, systemName, roleName);
				identLine.emit(writer);
				writer.write('\n');
			}
		}
		finally {
			reader.close();
			writer.close();
		}
	}
Add/remove an identify entry to pg_ident.conf
@param inFile is a copy of pg_ident.conf to modify
@param outFile becomes the modified copy of pg_ident.conf
@param mapName is the map being modified
@param systemName is the system name (map from)
@param roleName is the database role (map to)
@param addUser is true if the map entry is to be added, false if the entry should be removed
@throws IOException if the file cannot be read from or written to
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ServerConfig.java