Be more wary of false matches in initdb's replace_token().
Tom Lane <tgl@sss.pgh.pa.us>
Be more wary of false matches in initdb's replace_token(). Do not replace the target string unless the occurrence is surrounded by whitespace or line start/end. This avoids potential false match to a substring of a field. While we've not had trouble with that up to now, the next patch creates hazards of false matches to POSTGRES within an ACL field. There is one call site that needs adjustment, as it was presuming it could write "::1" and have that match "::1/128". For all the others, this restriction is okay and strictly safer. Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de> Discussion: https://postgr.es/m/183292bb-4891-4c96-a3ca-e78b5e0e1358@dunslane.net
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/initdb/initdb.c | modified | +18 −5 |
Discussion
- generating function default settings from pg_proc.dat 28 messages · 2026-02-16 → 2026-03-05