mirror of
https://repo.or.cz/socat.git
synced 2025-01-09 06:22:33 +00:00
Option stderr leaked a temporary FD into child process
This commit is contained in:
parent
80f4aa8bcd
commit
b3dde9a009
2 changed files with 4 additions and 0 deletions
3
CHANGES
3
CHANGES
|
@ -37,6 +37,9 @@ Corrections:
|
||||||
The FDs of the socketpair that queues messages from signal handlers
|
The FDs of the socketpair that queues messages from signal handlers
|
||||||
lacked FD_CLOEXEC and thus leaked into EXEC and SYSTEM child processes.
|
lacked FD_CLOEXEC and thus leaked into EXEC and SYSTEM child processes.
|
||||||
|
|
||||||
|
Option stderr on addresses EXEC and SYSTEM uses a temporary FD. It
|
||||||
|
lacked the FD_CLOEXEC setting and thus leakt into child processes.
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
VSOCK, VSOCK-L support options pf, socktype, prototype (currently
|
VSOCK, VSOCK-L support options pf, socktype, prototype (currently
|
||||||
useless)
|
useless)
|
||||||
|
|
1
error.c
1
error.c
|
@ -472,6 +472,7 @@ int diag_dup(void) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
newfd = dup(fileno(diagopts.logfile));
|
newfd = dup(fileno(diagopts.logfile));
|
||||||
|
Fcntl_l(newfd, F_SETFD, FD_CLOEXEC);
|
||||||
if (diagopts.logfile != stderr) {
|
if (diagopts.logfile != stderr) {
|
||||||
fclose(diagopts.logfile);
|
fclose(diagopts.logfile);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue