Skip to content

Commit 66579d7

Browse files
committed
Merge branch 'PGPRO9_6' into PGPROEE9_6
Update PGPROEE up to upstream 9.6.4 Conflicts: src/backend/libpq/crypt.c src/include/pg_config.h.win32
2 parents d6b785d + 23802e2 commit 66579d7

File tree

66 files changed

+22100
-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

+22100
-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

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

14121412
Usage: $0 [OPTION]... [VAR=VALUE]...
14131413

@@ -1472,7 +1472,7 @@ fi
14721472

14731473
if test -n "$ac_init_help"; then
14741474
case $ac_init_help in
1475-
short | recursive ) echo "Configuration of PostgreSQL 9.6.3:";;
1475+
short | recursive ) echo "Configuration of PostgreSQL 9.6.4:";;
14761476
esac
14771477
cat <<\_ACEOF
14781478

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

16321632
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2338,7 +2338,7 @@ cat >config.log <<_ACEOF
23382338
This file contains any messages produced by compilers while
23392339
running configure, to aid debugging if configure makes a mistake.
23402340

2341-
It was created by PostgreSQL $as_me 9.6.3, which was
2341+
It was created by PostgreSQL $as_me 9.6.4, which was
23422342
generated by GNU Autoconf 2.69. Invocation command line was
23432343

23442344
$ $0 $@
@@ -2755,7 +2755,7 @@ else
27552755
fi
27562756

27572757

2758-
PGPRO_VERSION="$PACKAGE_VERSION.3"
2758+
PGPRO_VERSION="$PACKAGE_VERSION.1"
27592759
PGPRO_PACKAGE_NAME="PostgresPro"
27602760
PGPRO_EDITION="enterprise"
27612761

@@ -18785,7 +18785,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1878518785
# report actual input values of CONFIG_FILES etc. instead of their
1878618786
# values after options handling.
1878718787
ac_log="
18788-
This file was extended by PostgreSQL $as_me 9.6.3, which was
18788+
This file was extended by PostgreSQL $as_me 9.6.4, which was
1878918789
generated by GNU Autoconf 2.69. Invocation command line was
1879018790

1879118791
CONFIG_FILES = $CONFIG_FILES
@@ -18855,7 +18855,7 @@ _ACEOF
1885518855
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1885618856
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1885718857
ac_cs_version="\\
18858-
PostgreSQL config.status 9.6.3
18858+
PostgreSQL config.status 9.6.4
1885918859
configured by $0, generated by GNU Autoconf 2.69,
1886018860
with options \\"\$ac_cs_config\\"
1886118861

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="enterprise"
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
@@ -10063,17 +10063,37 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
1006310063
<entry><type>text[]</type></entry>
1006410064
<entry></entry>
1006510065
<entry>
10066-
User mapping specific options, as <quote>keyword=value</>
10067-
strings. This column will show as null unless the current user
10068-
is the user being mapped, or the mapping is for
10069-
<literal>PUBLIC</literal> and the current user is the server
10070-
owner, or the current user is a superuser. The intent is
10071-
to protect password information stored as user mapping option.
10066+
User mapping specific options, as <quote>keyword=value</> strings
1007210067
</entry>
1007310068
</row>
1007410069
</tbody>
1007510070
</tgroup>
1007610071
</table>
10072+
10073+
<para>
10074+
To protect password information stored as a user mapping option,
10075+
the <structfield>umoptions</structfield> column will read as null
10076+
unless one of the following applies:
10077+
<itemizedlist>
10078+
<listitem>
10079+
<para>
10080+
current user is the user being mapped, and owns the server or
10081+
holds <literal>USAGE</> privilege on it
10082+
</para>
10083+
</listitem>
10084+
<listitem>
10085+
<para>
10086+
current user is the server owner and mapping is for <literal>PUBLIC</>
10087+
</para>
10088+
</listitem>
10089+
<listitem>
10090+
<para>
10091+
current user is a superuser
10092+
</para>
10093+
</listitem>
10094+
</itemizedlist>
10095+
</para>
10096+
1007710097
</sect1>
1007810098

1007910099

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)