summaryrefslogtreecommitdiffstats
path: root/tcpd/starttls.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcpd/starttls.c')
-rw-r--r--tcpd/starttls.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tcpd/starttls.c b/tcpd/starttls.c
index 76fcf3b..6e6229b 100644
--- a/tcpd/starttls.c
+++ b/tcpd/starttls.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <netdb.h>
+#include <signal.h>
#if HAVE_DIRENT_H
#include <dirent.h>
#define NAMLEN(dirent) strlen((dirent)->d_name)
@@ -526,6 +527,21 @@ static int connect_completed(ssl_handle ssl, int fd)
return (1);
}
+static void child_handler()
+{
+ alarm(10);
+}
+
+static void trapexit()
+{
+ struct sigaction sa;
+
+ memset(&sa, 0, sizeof(sa));
+
+ sa.sa_handler=child_handler;
+ sigaction(SIGCHLD, &sa, NULL);
+}
+
static int dossl(int fd, int argn, int argc, char **argv)
{
ssl_context ctx;
@@ -563,6 +579,7 @@ static int dossl(int fd, int argn, int argc, char **argv)
}
startclient(argn, argc, argv, fd, &stdin_fd, &stdout_fd);
+ trapexit();
if (username)
libmail_changeusername(username, 0);