Re: [PATCH] Log details for client certificate failures
| От | Peter Eisentraut |
|---|---|
| Тема | Re: [PATCH] Log details for client certificate failures |
| Дата | |
| Msg-id | 49b48719-d6cf-9e03-fab3-e4505cf9d585@enterprisedb.com обсуждение |
| Ответ на | Re: [PATCH] Log details for client certificate failures (Jacob Champion <jchampion@timescale.com>) |
| Ответы |
Re: [PATCH] Log details for client certificate failures
|
| Список | pgsql-hackers |
On 13.07.22 01:06, Jacob Champion wrote: >> I had to read up on this "ex_data" API. Interesting. But I'm wondering >> a bit about how the life cycle of these objects is managed. What >> happens if the allocated error string is deallocated before its >> containing object? Or vice versa? > > Yeah, I'm currently leaning heavily on the lack of any memory context > switches here. And I end up leaking out a pointer to the stale stack > of be_tls_open_server(), which is gross -- it works since there are no > other clients, but that could probably come back to bite us. > > The ex_data API exposes optional callbacks for new/dup/free (I'm > currently setting those to NULL), so we can run custom code whenever > the SSL* is destroyed. If you'd rather the data have the same lifetime > of the SSL* object, we can switch to malloc/strdup/free (or even > OPENSSL_strdup() in later versions). But since we don't have any use > for the ex_data outside of this function, maybe we should just clear > it before we return, rather than carrying it around. Concretely, I was thinking like the attached top-up patch. The other way can surely be made to work somehow, but this seems much simpler and with fewer questions about the details.
Вложения
В списке pgsql-hackers по дате отправления: