postgresql/src
Tom Lane 64d132c299 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
2017-03-10 14:15:09 -05:00
..
backend Use doubly-linked block lists in aset.c to reduce large-chunk overhead. 2017-03-08 12:21:12 -05:00
bin Sanitize newlines in object names in "pg_restore -l" output. 2017-03-10 14:15:09 -05:00
common Unlink static libraries before rebuilding them. 2015-03-01 13:06:33 -05:00
include Formatting and docs corrections for logical decoding output plugins. 2017-02-15 18:15:47 -05:00
interfaces Fix a potential double-free in ecpg. 2017-03-10 10:51:40 +01:00
makefiles Consolidate makefile code for setting top_srcdir, srcdir and VPATH. 2015-07-30 20:49:22 -04:00
pl Adjust PL/Tcl regression test to dodge a possible bug or zone dependency. 2017-02-19 16:14:52 -05:00
port Stamp 9.4.11. 2017-02-06 16:49:02 -05:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:35 -04:00
test Fix timestamptz regression test to still work with latest IANA zone data. 2017-03-09 17:20:11 -05:00
timezone Update time zone data files to tzdata release 2016j. 2017-01-30 11:40:54 -05:00
tools MSVC: Include pg_recvlogical in client-only install. 2016-09-19 14:27:13 -04:00
tutorial pgindent run for 9.4 2014-05-06 12:12:18 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Document usage of COPT environment variable for adjusting configure flags. 2017-02-17 16:11:02 -05:00
Makefile.shlib Fix typos in comments. 2017-02-06 11:34:24 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00