Re: [PATCH] Log details for client certificate failures

From: Jacob Champion <jchampion(at)timescale(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Log details for client certificate failures
Date: 2022-07-20 22:11:10
Message-ID: CAAWbhmhGOh_1C6x1A8K5hsMuSeOF5hxQ4ZMGkFhqmVTZ0otzRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 19, 2022 at 3:38 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> Or alternatively, perhaps we can just make pg_clean_ascii() return NULL
> if allocation failed and then guc_strdup() the result in guc.c?

The guc_strdup() approach really reduces the amount of code, so that's
what I did in v3. I'm not following why we need to return NULL on
failure, though -- both palloc() and guc_malloc() ERROR on failure, so
is it okay to keep those semantics the same?

> If we end up needing a two phase approach, why use the same function for
> both phases? That seems quite awkward.

Mostly so the byte counting always agrees between the two phases, no
matter how the implementation evolves. But it's hopefully moot now.

--Jacob

Attachment Content-Type Size
v3-0001-pg_clean_ascii-escape-bytes-rather-than-lose-them.patch text/x-patch 4.3 KB
v3-0002-Don-t-reflect-unescaped-cert-data-to-the-logs.patch text/x-patch 18.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-07-20 22:15:07 Re: [PATCH] Log details for client certificate failures
Previous Message Bruce Momjian 2022-07-20 20:32:46 Re: System catalog documentation chapter