Compare commits

...

3 Commits

Author SHA1 Message Date
Bruce Momjian
596eeb1097 Update copyright for 2024
Reported-by: Michael Paquier

Discussion: https://postgr.es/m/ZZKTDPxBBMt3C0J9@paquier.xyz

Backpatch-through: 12
2024-01-03 20:49:04 -05:00
Tom Lane
a0d016393b Avoid masking EOF (no-password-supplied) conditions in auth.c.
CheckPWChallengeAuth() would return STATUS_ERROR if the user does not
exist or has no password assigned, even if the client disconnected
without responding to the password challenge (as libpq often will,
for example).  We should return STATUS_EOF in that case, and the
lower-level functions do, but this code level got it wrong since the
refactoring done in 7ac955b34.  This breaks the intent of not logging
anything for EOF cases (cf. comments in auth_failed()) and might
also confuse users of ClientAuthentication_hook.

Per report from Liu Lang.  Back-patch to all supported versions.

Discussion: https://postgr.es/m/b725238c-539d-cb09-2bff-b5e6cb2c069c@esgyn.cn
2024-01-03 17:40:38 -05:00
Tom Lane
272f857aed Doc: Python's control flow construct is try/except not try/catch.
Very ancient thinko, dating evidently to 22690719e.
Spotted by gweatherby.

Discussion: https://postgr.es/m/170423637139.1288848.11840082988774620003@wrigleys.postgresql.org
2024-01-03 12:22:00 -05:00
4 changed files with 10 additions and 12 deletions

View File

@ -1,7 +1,7 @@
PostgreSQL Database Management System
(formerly known as Postgres, then as Postgres95)
Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
Portions Copyright (c) 1994, The Regents of the University of California

View File

@ -1,9 +1,9 @@
<!-- doc/src/sgml/legal.sgml -->
<date>2023</date>
<date>2024</date>
<copyright>
<year>1996&ndash;2023</year>
<year>1996&ndash;2024</year>
<holder>The PostgreSQL Global Development Group</holder>
</copyright>
@ -11,7 +11,7 @@
<title>Legal Notice</title>
<para>
<productname>PostgreSQL</productname> is Copyright &copy; 1996&ndash;2023
<productname>PostgreSQL</productname> is Copyright &copy; 1996&ndash;2024
by the PostgreSQL Global Development Group.
</para>

View File

@ -1175,7 +1175,7 @@ plan = plpy.prepare("INSERT INTO operations (result) VALUES ($1)", ["text"])
plpy.execute(plan, [result])
$$ LANGUAGE plpython3u;
</programlisting>
Note that the use of <literal>try/catch</literal> is still
Note that the use of <literal>try</literal>/<literal>except</literal> is still
required. Otherwise the exception would propagate to the top of
the Python stack and would cause the whole function to abort with
a <productname>PostgreSQL</productname> error, so that the

View File

@ -850,15 +850,13 @@ CheckPWChallengeAuth(Port *port, const char **logdetail)
if (shadow_pass)
pfree(shadow_pass);
/*
* If get_role_password() returned error, return error, even if the
* authentication succeeded.
*/
if (!shadow_pass)
else
{
/*
* If get_role_password() returned error, authentication better not
* have succeeded.
*/
Assert(auth_result != STATUS_OK);
return STATUS_ERROR;
}
if (auth_result == STATUS_OK)