Skip to content

Commit 23802e2

Browse files
committed
Merge branch 'REL9_6_STABLE' into PGPRO9_6
Update PGPRO9_6 standard up to upstream 9.6.4 stamp Conflicts: configure configure.in src/include/pg_config.h.win32
2 parents 052adf0 + eca2f8a commit 23802e2

File tree

66 files changed

+22096
-16371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+22096
-16371
lines changed

configure

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for PostgreSQL 9.6.3.
3+
# Generated by GNU Autoconf 2.69 for PostgreSQL 9.6.4.
44
#
55
# Report bugs to <bugs@postgrespro.ru>.
66
#
@@ -583,8 +583,8 @@ MAKEFLAGS=
583583
# Identity of this package.
584584
PACKAGE_NAME='PostgreSQL'
585585
PACKAGE_TARNAME='postgrespro'
586-
PACKAGE_VERSION='9.6.3'
587-
PACKAGE_STRING='PostgreSQL 9.6.3'
586+
PACKAGE_VERSION='9.6.4'
587+
PACKAGE_STRING='PostgreSQL 9.6.4'
588588
PACKAGE_BUGREPORT='bugs@postgrespro.ru'
589589
PACKAGE_URL=''
590590

@@ -1405,7 +1405,7 @@ if test "$ac_init_help" = "long"; then
14051405
# Omit some internal or obsolete options to make the list less imposing.
14061406
# This message is too long to be a string in the A/UX 3.1 sh.
14071407
cat <<_ACEOF
1408-
\`configure' configures PostgreSQL 9.6.3 to adapt to many kinds of systems.
1408+
\`configure' configures PostgreSQL 9.6.4 to adapt to many kinds of systems.
14091409

14101410
Usage: $0 [OPTION]... [VAR=VALUE]...
14111411

@@ -1470,7 +1470,7 @@ fi
14701470

14711471
if test -n "$ac_init_help"; then
14721472
case $ac_init_help in
1473-
short | recursive ) echo "Configuration of PostgreSQL 9.6.3:";;
1473+
short | recursive ) echo "Configuration of PostgreSQL 9.6.4:";;
14741474
esac
14751475
cat <<\_ACEOF
14761476

@@ -1623,7 +1623,7 @@ fi
16231623
test -n "$ac_init_help" && exit $ac_status
16241624
if $ac_init_version; then
16251625
cat <<\_ACEOF
1626-
PostgreSQL configure 9.6.3
1626+
PostgreSQL configure 9.6.4
16271627
generated by GNU Autoconf 2.69
16281628

16291629
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2335,7 +2335,7 @@ cat >config.log <<_ACEOF
23352335
This file contains any messages produced by compilers while
23362336
running configure, to aid debugging if configure makes a mistake.
23372337

2338-
It was created by PostgreSQL $as_me 9.6.3, which was
2338+
It was created by PostgreSQL $as_me 9.6.4, which was
23392339
generated by GNU Autoconf 2.69. Invocation command line was
23402340

23412341
$ $0 $@
@@ -2752,7 +2752,7 @@ else
27522752
fi
27532753

27542754

2755-
PGPRO_VERSION="$PACKAGE_VERSION.3"
2755+
PGPRO_VERSION="$PACKAGE_VERSION.1"
27562756
PGPRO_PACKAGE_NAME="PostgresPro"
27572757
PGPRO_EDITION="standard"
27582758

@@ -18700,7 +18700,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1870018700
# report actual input values of CONFIG_FILES etc. instead of their
1870118701
# values after options handling.
1870218702
ac_log="
18703-
This file was extended by PostgreSQL $as_me 9.6.3, which was
18703+
This file was extended by PostgreSQL $as_me 9.6.4, which was
1870418704
generated by GNU Autoconf 2.69. Invocation command line was
1870518705

1870618706
CONFIG_FILES = $CONFIG_FILES
@@ -18770,7 +18770,7 @@ _ACEOF
1877018770
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1877118771
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1877218772
ac_cs_version="\\
18773-
PostgreSQL config.status 9.6.3
18773+
PostgreSQL config.status 9.6.4
1877418774
configured by $0, generated by GNU Autoconf 2.69,
1877518775
with options \\"\$ac_cs_config\\"
1877618776

configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
1717
dnl
1818
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
1919

20-
AC_INIT([PostgreSQL], [9.6.3], [bugs@postgrespro.ru],[postgrespro])
20+
AC_INIT([PostgreSQL], [9.6.4], [bugs@postgrespro.ru],[postgrespro])
2121
PACKAGE_TARNAME=postgrespro
2222

2323
m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
@@ -38,7 +38,7 @@ AC_DEFINE_UNQUOTED(PG_MAJORVERSION, "$PG_MAJORVERSION", [PostgreSQL major versio
3838
PGAC_ARG_REQ(with, extra-version, [STRING], [append STRING to version],
3939
[PG_VERSION="$PACKAGE_VERSION$withval"],
4040
[PG_VERSION="$PACKAGE_VERSION"])
41-
PGPRO_VERSION="$PACKAGE_VERSION.3"
41+
PGPRO_VERSION="$PACKAGE_VERSION.1"
4242
PGPRO_PACKAGE_NAME="PostgresPro"
4343
PGPRO_EDITION="standard"
4444
AC_SUBST(PGPRO_PACKAGE_NAME)

doc/bug.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ System Configuration:
2727

2828
Operating System (example: Linux 2.4.18) :
2929

30-
PostgreSQL version (example: PostgreSQL 9.6.3): PostgreSQL 9.6.3
30+
PostgreSQL version (example: PostgreSQL 9.6.4): PostgreSQL 9.6.4
3131

3232
Compiler used (example: gcc 3.3.5) :
3333

doc/src/sgml/catalogs.sgml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10058,17 +10058,37 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
1005810058
<entry><type>text[]</type></entry>
1005910059
<entry></entry>
1006010060
<entry>
10061-
User mapping specific options, as <quote>keyword=value</>
10062-
strings. This column will show as null unless the current user
10063-
is the user being mapped, or the mapping is for
10064-
<literal>PUBLIC</literal> and the current user is the server
10065-
owner, or the current user is a superuser. The intent is
10066-
to protect password information stored as user mapping option.
10061+
User mapping specific options, as <quote>keyword=value</> strings
1006710062
</entry>
1006810063
</row>
1006910064
</tbody>
1007010065
</tgroup>
1007110066
</table>
10067+
10068+
<para>
10069+
To protect password information stored as a user mapping option,
10070+
the <structfield>umoptions</structfield> column will read as null
10071+
unless one of the following applies:
10072+
<itemizedlist>
10073+
<listitem>
10074+
<para>
10075+
current user is the user being mapped, and owns the server or
10076+
holds <literal>USAGE</> privilege on it
10077+
</para>
10078+
</listitem>
10079+
<listitem>
10080+
<para>
10081+
current user is the server owner and mapping is for <literal>PUBLIC</>
10082+
</para>
10083+
</listitem>
10084+
<listitem>
10085+
<para>
10086+
current user is a superuser
10087+
</para>
10088+
</listitem>
10089+
</itemizedlist>
10090+
</para>
10091+
1007210092
</sect1>
1007310093

1007410094

doc/src/sgml/release-9.2.sgml

Lines changed: 128 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
</para>
3030

3131
<para>
32-
However, if you are upgrading from a version earlier than 9.2.20,
32+
However, if you use foreign data servers that make use of user
33+
passwords for authentication, see the first changelog entry below.
34+
</para>
35+
36+
<para>
37+
Also, if you are upgrading from a version earlier than 9.2.20,
3338
see <xref linkend="release-9-2-20">.
3439
</para>
3540

@@ -40,6 +45,126 @@
4045

4146
<itemizedlist>
4247

48+
<listitem>
49+
<para>
50+
Further restrict visibility
51+
of <structname>pg_user_mappings</>.<structfield>umoptions</>, to
52+
protect passwords stored as user mapping options
53+
(Noah Misch)
54+
</para>
55+
56+
<para>
57+
The fix for CVE-2017-7486 was incorrect: it allowed a user
58+
to see the options in her own user mapping, even if she did not
59+
have <literal>USAGE</> permission on the associated foreign server.
60+
Such options might include a password that had been provided by the
61+
server owner rather than the user herself.
62+
Since <structname>information_schema.user_mapping_options</> does not
63+
show the options in such cases, <structname>pg_user_mappings</>
64+
should not either.
65+
(CVE-2017-7547)
66+
</para>
67+
68+
<para>
69+
By itself, this patch will only fix the behavior in newly initdb'd
70+
databases. If you wish to apply this change in an existing database,
71+
you will need to do the following:
72+
</para>
73+
74+
<procedure>
75+
<step>
76+
<para>
77+
Restart the postmaster after adding <literal>allow_system_table_mods
78+
= true</> to <filename>postgresql.conf</>. (In versions
79+
supporting <command>ALTER SYSTEM</>, you can use that to make the
80+
configuration change, but you'll still need a restart.)
81+
</para>
82+
</step>
83+
84+
<step>
85+
<para>
86+
In <emphasis>each</> database of the cluster,
87+
run the following commands as superuser:
88+
<programlisting>
89+
SET search_path = pg_catalog;
90+
CREATE OR REPLACE VIEW pg_user_mappings AS
91+
SELECT
92+
U.oid AS umid,
93+
S.oid AS srvid,
94+
S.srvname AS srvname,
95+
U.umuser AS umuser,
96+
CASE WHEN U.umuser = 0 THEN
97+
'public'
98+
ELSE
99+
A.rolname
100+
END AS usename,
101+
CASE WHEN (U.umuser &lt;&gt; 0 AND A.rolname = current_user
102+
AND (pg_has_role(S.srvowner, 'USAGE')
103+
OR has_server_privilege(S.oid, 'USAGE')))
104+
OR (U.umuser = 0 AND pg_has_role(S.srvowner, 'USAGE'))
105+
OR (SELECT rolsuper FROM pg_authid WHERE rolname = current_user)
106+
THEN U.umoptions
107+
ELSE NULL END AS umoptions
108+
FROM pg_user_mapping U
109+
LEFT JOIN pg_authid A ON (A.oid = U.umuser) JOIN
110+
pg_foreign_server S ON (U.umserver = S.oid);
111+
</programlisting>
112+
</para>
113+
</step>
114+
115+
<step>
116+
<para>
117+
Do not forget to include the <literal>template0</>
118+
and <literal>template1</> databases, or the vulnerability will still
119+
exist in databases you create later. To fix <literal>template0</>,
120+
you'll need to temporarily make it accept connections.
121+
In <productname>PostgreSQL</> 9.5 and later, you can use
122+
<programlisting>
123+
ALTER DATABASE template0 WITH ALLOW_CONNECTIONS true;
124+
</programlisting>
125+
and then after fixing <literal>template0</>, undo that with
126+
<programlisting>
127+
ALTER DATABASE template0 WITH ALLOW_CONNECTIONS false;
128+
</programlisting>
129+
In prior versions, instead use
130+
<programlisting>
131+
UPDATE pg_database SET datallowconn = true WHERE datname = 'template0';
132+
UPDATE pg_database SET datallowconn = false WHERE datname = 'template0';
133+
</programlisting>
134+
</para>
135+
</step>
136+
137+
<step>
138+
<para>
139+
Finally, remove the <literal>allow_system_table_mods</> configuration
140+
setting, and again restart the postmaster.
141+
</para>
142+
</step>
143+
</procedure>
144+
</listitem>
145+
146+
<listitem>
147+
<para>
148+
Disallow empty passwords in all password-based authentication methods
149+
(Heikki Linnakangas)
150+
</para>
151+
152+
<para>
153+
<application>libpq</> ignores empty password specifications, and does
154+
not transmit them to the server. So, if a user's password has been
155+
set to the empty string, it's impossible to log in with that password
156+
via <application>psql</> or other <application>libpq</>-based
157+
clients. An administrator might therefore believe that setting the
158+
password to empty is equivalent to disabling password login.
159+
However, with a modified or non-<application>libpq</>-based client,
160+
logging in could be possible, depending on which authentication
161+
method is configured. In particular the most common
162+
method, <literal>md5</>, accepted empty passwords.
163+
Change the server to reject empty passwords in all cases.
164+
(CVE-2017-7546)
165+
</para>
166+
</listitem>
167+
43168
<listitem>
44169
<para>
45170
On Windows, retry process creation if we fail to reserve the address
@@ -410,77 +535,9 @@
410535
<para>
411536
By itself, this patch will only fix the behavior in newly initdb'd
412537
databases. If you wish to apply this change in an existing database,
413-
you will need to do the following:
538+
follow the corrected procedure shown in the changelog entry for
539+
CVE-2017-7547, in <xref linkend="release-9-2-22">.
414540
</para>
415-
416-
<procedure>
417-
<step>
418-
<para>
419-
Restart the postmaster after adding <literal>allow_system_table_mods
420-
= true</> to <filename>postgresql.conf</>. (In versions
421-
supporting <command>ALTER SYSTEM</>, you can use that to make the
422-
configuration change, but you'll still need a restart.)
423-
</para>
424-
</step>
425-
426-
<step>
427-
<para>
428-
In <emphasis>each</> database of the cluster,
429-
run the following commands as superuser:
430-
<programlisting>
431-
SET search_path = pg_catalog;
432-
CREATE OR REPLACE VIEW pg_user_mappings AS
433-
SELECT
434-
U.oid AS umid,
435-
S.oid AS srvid,
436-
S.srvname AS srvname,
437-
U.umuser AS umuser,
438-
CASE WHEN U.umuser = 0 THEN
439-
'public'
440-
ELSE
441-
A.rolname
442-
END AS usename,
443-
CASE WHEN (U.umuser &lt;&gt; 0 AND A.rolname = current_user)
444-
OR (U.umuser = 0 AND pg_has_role(S.srvowner, 'USAGE'))
445-
OR (SELECT rolsuper FROM pg_authid WHERE rolname = current_user)
446-
THEN U.umoptions
447-
ELSE NULL END AS umoptions
448-
FROM pg_user_mapping U
449-
LEFT JOIN pg_authid A ON (A.oid = U.umuser) JOIN
450-
pg_foreign_server S ON (U.umserver = S.oid);
451-
</programlisting>
452-
</para>
453-
</step>
454-
455-
<step>
456-
<para>
457-
Do not forget to include the <literal>template0</>
458-
and <literal>template1</> databases, or the vulnerability will still
459-
exist in databases you create later. To fix <literal>template0</>,
460-
you'll need to temporarily make it accept connections.
461-
In <productname>PostgreSQL</> 9.5 and later, you can use
462-
<programlisting>
463-
ALTER DATABASE template0 WITH ALLOW_CONNECTIONS true;
464-
</programlisting>
465-
and then after fixing <literal>template0</>, undo that with
466-
<programlisting>
467-
ALTER DATABASE template0 WITH ALLOW_CONNECTIONS false;
468-
</programlisting>
469-
In prior versions, instead use
470-
<programlisting>
471-
UPDATE pg_database SET datallowconn = true WHERE datname = 'template0';
472-
UPDATE pg_database SET datallowconn = false WHERE datname = 'template0';
473-
</programlisting>
474-
</para>
475-
</step>
476-
477-
<step>
478-
<para>
479-
Finally, remove the <literal>allow_system_table_mods</> configuration
480-
setting, and again restart the postmaster.
481-
</para>
482-
</step>
483-
</procedure>
484541
</listitem>
485542

486543
<listitem>

0 commit comments

Comments
 (0)