Re: Allow root ownership of client certificate key

From: David Steele <david(at)pgmasters(dot)net>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: Allow root ownership of client certificate key
Date: 2022-01-18 21:44:29
Message-ID: 86a05828-6396-314a-58c8-45e50eb2cfb8@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/18/22 15:41, Tom Lane wrote:
> David Steele <david(at)pgmasters(dot)net> writes:
>
> I took a quick look at this and agree with the proposed behavior
> change, but also with your self-criticisms:
>
>> We may want to do the same on the server side to make the code blocks
>> look more similar.
>>
>> Also, on the server side the S_ISREG() check gets its own error and that
>> might be a good idea on the client side as well. As it is, the error
>> message on the client is going to be pretty confusing in this case.
>
> Particularly, I think the S_ISREG check should happen before any
> ownership/permissions checks; it just seems saner that way.

I was worried about doing too much refactoring in this commit since I
have hopes and dreams of it being back-patched. But I'll go ahead and do
that and if any part of this can be back-patched we'll consider that
separately.

> The only other nitpick I have is that I'd make the cross-references be
> to the two file names, ie like "Note that similar checks are performed
> in fe-secure-openssl.c ..." References to the specific functions seem
> likely to bit-rot in the face of future code rearrangements.
> I suppose filename references could become obsolete too, but it
> seems less likely.

It's true that functions are more likely to be renamed, but when I
rename a function I then search for all the places where it is used so I
can update them. If the function name appears in a comment that gets
updated as well.

If you would still prefer filenames I have no strong argument against
that, just wanted to explain my logic.

Regards,
-David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-01-18 21:51:48 Re: Allow root ownership of client certificate key
Previous Message Andres Freund 2022-01-18 21:40:40 Re: slowest tap tests - split or accelerate?