Re: [PATCH s6-networking 1/1] Close a read end of a handshake notification pipe

2022-08-30 Thread Petr Vaněk
On Tue, Aug 30, 2022 at 11:00:03AM +, Laurent Bercot wrote:
> >The write end of the pipe is closed when envs are written, therefore it
> >make sense to close read end as well after envs are read. This prevents
> >fd leaking to the app.
> 
>   Good catch, thanks. Applied with a little modification: since close()
> can set errno, it shouldn't be called between read() and
> strerr_diefu1sys() (which reads errno).

Ah, I see, thanks!

>   Not going to cut a release just for this, because the bug is minor
> (the leaked fd is completely unusable).

Makes sense, no problem at all.

Petr


Re: [PATCH s6-networking 1/1] Close a read end of a handshake notification pipe

2022-08-30 Thread Laurent Bercot

The write end of the pipe is closed when envs are written, therefore it
make sense to close read end as well after envs are read. This prevents
fd leaking to the app.


 Good catch, thanks. Applied with a little modification: since close()
can set errno, it shouldn't be called between read() and
strerr_diefu1sys() (which reads errno).

 Not going to cut a release just for this, because the bug is minor
(the leaked fd is completely unusable).

--
 Laurent