mirror of
https://repo.or.cz/socat.git
synced 2025-01-08 22:12:33 +00:00
Apply FD_CLOEXEC to FDs of message queuing socketpair
This commit is contained in:
parent
8539e6e887
commit
80f4aa8bcd
2 changed files with 5 additions and 0 deletions
3
CHANGES
3
CHANGES
|
@ -34,6 +34,9 @@ Corrections:
|
||||||
|
|
||||||
Fixed an internal FD leak in the EXEC,SYSTEM addresses.
|
Fixed an internal FD leak in the EXEC,SYSTEM addresses.
|
||||||
|
|
||||||
|
The FDs of the socketpair that queues messages from signal handlers
|
||||||
|
lacked FD_CLOEXEC and thus leaked into EXEC and SYSTEM child processes.
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
VSOCK, VSOCK-L support options pf, socktype, prototype (currently
|
VSOCK, VSOCK-L support options pf, socktype, prototype (currently
|
||||||
useless)
|
useless)
|
||||||
|
|
2
error.c
2
error.c
|
@ -119,6 +119,8 @@ static int diag_sock_pair(void) {
|
||||||
diag_sock_recv = -1;
|
diag_sock_recv = -1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
fcntl(handlersocks[0], F_SETFD, FD_CLOEXEC);
|
||||||
|
fcntl(handlersocks[1], F_SETFD, FD_CLOEXEC);
|
||||||
diag_sock_send = handlersocks[1];
|
diag_sock_send = handlersocks[1];
|
||||||
diag_sock_recv = handlersocks[0];
|
diag_sock_recv = handlersocks[0];
|
||||||
#if !defined(MSG_DONTWAIT)
|
#if !defined(MSG_DONTWAIT)
|
||||||
|
|
Loading…
Reference in a new issue