Re: get_controlfile() can leak fds in the backend - Mailing list pgsql-hackers

From Joe Conway
Subject Re: get_controlfile() can leak fds in the backend
Date
Msg-id c49b69ec-e2f7-ff33-4f17-0eaa4f2cef27@joeconway.com
Whole thread Raw
In response to Re: get_controlfile() can leak fds in the backend  (Michael Paquier <michael@paquier.xyz>)
Responses Re: get_controlfile() can leak fds in the backend
List pgsql-hackers
On 2/28/19 7:20 AM, Michael Paquier wrote:
> On Thu, Feb 28, 2019 at 07:11:04AM -0500, Joe Conway wrote:
>> Sure, will do. What are your thoughts on backpatching? This seems
>> unlikely to be a practical concern in the field, so my inclination is a
>> master only fix.
>
> I agree that this would unlikely become an issue as an error on the
> control file would most likely be a PANIC when updating it, so fixing
> only HEAD sounds fine to me.  Thanks for asking!


Committed and push that way.

By the way, while looking at this, I noted at least a couple of places
where OpenTransientFile() is being passed O_RDWR when the usage is
pretty clearly intended to be read-only. For example at least two
instances in slru.c -- SlruPhysicalReadPage() and
SimpleLruDoesPhysicalPageExist(). Is it worth while searching for and
fixing those instances?

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development


Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: get_controlfile() can leak fds in the backend
Next
From: Thomas Munro
Date:
Subject: Re: Drop type "smgr"?