From 11f9571725cbfee8ccf44f7ead3d1c0530b38e2d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 26 Dec 2021 01:11:01 +0000 Subject: [PATCH] Do not leak a harmless fd into the service program environment I have double-checked and this fd is the other end of a socketpair that the server closes immediately after it reads our byte, so this is indeed purely a harmless leak. Closes: #864876 Reported-by: Ben Harris Signed-off-by: Ian Jackson --- servexec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/servexec.c b/servexec.c index 5fa8e1f..6b55ea7 100644 --- a/servexec.c +++ b/servexec.c @@ -250,6 +250,7 @@ void execservice(const int synchsocket[], int clientfd) { if (r!=1) serv_syscallfail("write synch byte to parent"); r= synchread(synchsocket[1],'g'); if (r) serv_syscallfail("reach synch byte from parent"); + if (close(synchsocket[1])) serv_syscallfail("close our synch socket"); if (close(clientfd)) serv_syscallfail("close client socket fd"); -- 2.30.2