mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 14:05:08 -05:00
privops: keep stdin/out/err open
This commit is contained in:
@@ -694,8 +694,9 @@ PRV_StartHelper(void)
|
|||||||
/* child process */
|
/* child process */
|
||||||
close(sock_pair[0]);
|
close(sock_pair[0]);
|
||||||
|
|
||||||
/* close other descriptors inherited from the parent process */
|
/* close other descriptors inherited from the parent process, except
|
||||||
for (fd = 0; fd < 1024; fd++) {
|
stdin, stdout, and stderr */
|
||||||
|
for (fd = STDERR_FILENO + 1; fd < 1024; fd++) {
|
||||||
if (fd != sock_pair[1])
|
if (fd != sock_pair[1])
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user