From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Christoph Moench-Tegeder <cmt@burggraben.net>
Cc: Michael Mühlbeyer <Michael.Muehlbeyer@trivadis.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: md5 issues Postgres14 on OL7
Date: Sat, 08 Jan 2022 14:00:16 -0500
Message-ID: <1521801.1641668416@sss.pgh.pa.us> (raw)
In-Reply-To: <Ydkpgvl+r7Nso2m3@paquier.xyz>
References: <YcCRp9QvQvCZ7ODI@elch.exwg.net>
<YdQ1GLqQ/Vq6LwW9@paquier.xyz>
<4038656.1641318875@sss.pgh.pa.us>
<YdUx+6Sm5T0II8Un@paquier.xyz>
<4190764.1641362933@sss.pgh.pa.us>
<YdVEGLO/Ft7FUWF6@paquier.xyz>
<YdamS8Sdwmiu4gsN@paquier.xyz>
<1084379.1641487204@sss.pgh.pa.us>
<YdeiBTC2cXqDhbpN@paquier.xyz>
<1387391.1641595209@sss.pgh.pa.us>
<Ydkpgvl+r7Nso2m3@paquier.xyz>
Michael Paquier <michael@paquier.xyz> writes:
> [ v3-0001-Improve-error-reporting-for-cryptohashes.patch ]
This is looking pretty solid to me. Just a couple of nitpicks:
* In most places you initialize variables holding error strings to NULL:
+ const char *logdetail = NULL;
but there are three or so spots that don't, eg PerformRadiusTransaction.
They should be consistent. (Even if there's no actual bug, I'd be
unsurprised to see Coverity carp about the inconsistency.)
* The comments for md5_crypt_verify and plain_crypt_verify claim that
the error string is "optionally" stored, but I don't see anything
optional about it. To me, "optional" would imply coding like
if (logdetail)
*logdetail = errstr;
which we don't have here, and I don't think we need it. But the
comments need adjustment. (They were wrong before too, but no
time like the present to clean them up.)
* I'd be inclined to just drop the existing comments like
- * We do not bother setting logdetail for any pg_md5_encrypt failure
- * below: the only possible error is out-of-memory, which is unlikely, and
- * if it did happen adding a psprintf call would only make things worse.
rather than modify them. Neither the premise nor the conclusion
of these comments is accurate anymore. (I think that the psprintf
they are talking about is the one that will happen inside elog.c
to construct an errdetail string. Yeah, there's some risk there,
but I think it's minimal because of the fact that we preallocate
some space in ErrorContext.)
Other than those things, I think v3 is good to go.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, cmt@burggraben.net, Michael.Muehlbeyer@trivadis.com
Subject: Re: md5 issues Postgres14 on OL7
In-Reply-To: <1521801.1641668416@sss.pgh.pa.us>
References: <YcCRp9QvQvCZ7ODI@elch.exwg.net> <YdQ1GLqQ/Vq6LwW9@paquier.xyz> <4038656.1641318875@sss.pgh.pa.us> <YdUx+6Sm5T0II8Un@paquier.xyz> <4190764.1641362933@sss.pgh.pa.us> <YdVEGLO/Ft7FUWF6@paquier.xyz> <YdamS8Sdwmiu4gsN@paquier.xyz> <1084379.1641487204@sss.pgh.pa.us> <YdeiBTC2cXqDhbpN@paquier.xyz> <1387391.1641595209@sss.pgh.pa.us> <Ydkpgvl+r7Nso2m3@paquier.xyz> <1521801.1641668416@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox