X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fdaemon.c;h=3db9be374214e9e3f37b54af3e1c219c8c7f2cd1;hb=33191679e1a86ba6d9c38a74d0795d00c300f2c5;hp=8e6d6673adf5f8e73539ba7fbc36f60e9a5c633d;hpb=0a49a7a4f1090b6f1ce1d0f9d969804c9226b53e;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/daemon.c b/src/src/daemon.c index 8e6d6673a..3db9be374 100644 --- a/src/src/daemon.c +++ b/src/src/daemon.c @@ -425,6 +425,13 @@ if (pid == 0) for (i = 0; i < listen_socket_count; i++) (void)close(listen_sockets[i]); + /* Set FD_CLOEXEC on the SMTP socket. We don't want any rogue child processes + to be able to communicate with them, under any circumstances. */ + (void)fcntl(accept_socket, F_SETFD, + fcntl(accept_socket, F_GETFD) | FD_CLOEXEC); + (void)fcntl(dup_accept_socket, F_SETFD, + fcntl(dup_accept_socket, F_GETFD) | FD_CLOEXEC); + #ifdef SA_NOCLDWAIT act.sa_handler = SIG_IGN; sigemptyset(&(act.sa_mask));