postgresql/src/bin
Tom Lane 815172ba80 Avoid using unsafe search_path settings during dump and restore.
Historically, pg_dump has "set search_path = foo, pg_catalog" when
dumping an object in schema "foo", and has also caused that setting
to be used while restoring the object.  This is problematic because
functions and operators in schema "foo" could capture references meant
to refer to pg_catalog entries, both in the queries issued by pg_dump
and those issued during the subsequent restore run.  That could
result in dump/restore misbehavior, or in privilege escalation if a
nefarious user installs trojan-horse functions or operators.

This patch changes pg_dump so that it does not change the search_path
dynamically.  The emitted restore script sets the search_path to what
was used at dump time, and then leaves it alone thereafter.  Created
objects are placed in the correct schema, regardless of the active
search_path, by dint of schema-qualifying their names in the CREATE
commands, as well as in subsequent ALTER and ALTER-like commands.

Since this change requires a change in the behavior of pg_restore
when processing an archive file made according to this new convention,
bump the archive file version number; old versions of pg_restore will
therefore refuse to process files made with new versions of pg_dump.

Security: CVE-2018-1058
2018-02-26 10:18:22 -05:00
..
initdb Translation updates 2018-02-05 12:38:16 -05:00
pg_archivecleanup Fix new warnings from GCC 7 2017-05-16 08:52:39 -04:00
pg_basebackup Translation updates 2018-02-05 12:38:16 -05:00
pg_config Translation updates 2018-02-05 12:38:16 -05:00
pg_controldata Translation updates 2018-02-05 12:38:16 -05:00
pg_ctl Translation updates 2018-02-05 12:38:16 -05:00
pg_dump Avoid using unsafe search_path settings during dump and restore. 2018-02-26 10:18:22 -05:00
pg_resetxlog Translation updates 2018-02-05 12:38:16 -05:00
pg_rewind Translation updates 2018-02-05 12:38:16 -05:00
pg_test_fsync Avoid depending on non-POSIX behavior of fcntl(2). 2017-04-21 15:55:56 -04:00
pg_test_timing Move pg_test_timing from contrib/ to src/bin/ 2015-04-20 21:30:12 -04:00
pg_upgrade Repair pg_upgrade's failure to preserve relfrozenxid for matviews. 2018-02-21 18:40:24 -05:00
pg_xlogdump Fix record length computation in pg_waldump/xlogdump. 2017-06-05 16:10:07 -07:00
pgbench Fix broken link-command-line ordering for libpgfeutils. 2017-07-14 12:26:53 -04:00
pgevent Update copyright for 2016 2016-01-02 13:33:40 -05:00
psql Translation updates 2018-02-26 08:32:14 -05:00
scripts Translation updates 2018-02-05 12:38:16 -05:00
Makefile Update copyright for 2016 2016-01-02 13:33:40 -05:00