[COMMITTERS] pgsql: Sanitize newlines in object names in "pg_restore -l" output.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Sanitize newlines in object names in "pg_restore -l" output.
Дата
Msg-id E1cmQ0h-0002YV-7I@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Sanitize newlines in object names in "pg_restore -l" output.

Commits 89e0bac86 et al replaced newlines with spaces in object names
printed in SQL comments, but we neglected to consider that the same
names are also printed by "pg_restore -l", and a newline would render
the output unparseable by "pg_restore -L".  Apply the same replacement
in "-l" output.  Since "pg_restore -L" doesn't actually examine any
object names, only the dump ID field that starts each line, this is
enough to fix things for its purposes.

The previous fix was treated as a security issue, and we might have
done that here as well, except that the issue was reported publicly
to start with.  Anyway it's hard to see how this could be exploited
for SQL injection; "pg_restore -L" doesn't do much with the file
except parse it for leading integers.

Per bug #14587 from Milos Urbanek.  Back-patch to all supported versions.

Discussion: https://postgr.es/m/20170310155318.1425.30483@wrigleys.postgresql.org

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/64d132c2997ec5972827bd0ae186ca967492ce51

Modified Files
--------------
src/bin/pg_dump/pg_backup_archiver.c | 39 +++++++++++++++++++++++++++++++-----
1 file changed, 34 insertions(+), 5 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: [COMMITTERS] pgsql: Change the relkind for partitioned tables from 'P' to 'p'.
Следующее
От: Andres Freund
Дата:
Сообщение: [COMMITTERS] pgsql: Enable 64 bit atomics on ARM64.