summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/extern.h1
-rw-r--r--libexec/ftpd/ftpcmd.y3
-rw-r--r--libexec/ftpd/ftpd.c5
3 files changed, 6 insertions, 3 deletions
diff --git a/libexec/ftpd/extern.h b/libexec/ftpd/extern.h
index 9f825d7baf1..23dbb82fbc0 100644
--- a/libexec/ftpd/extern.h
+++ b/libexec/ftpd/extern.h
@@ -65,3 +65,4 @@ void store __P((char *, char *, int));
void upper __P((char *));
void user __P((char *));
void yyerror __P((char *));
+void toolong __P((int));
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y
index da68aedae6e..95f11b64203 100644
--- a/libexec/ftpd/ftpcmd.y
+++ b/libexec/ftpd/ftpcmd.y
@@ -845,7 +845,6 @@ static void help __P((struct tab *, char *));
static struct tab *
lookup __P((struct tab *, char *));
static void sizecmd __P((char *));
-static void toolong __P((int));
static int yylex __P((void));
static struct tab *
@@ -941,7 +940,7 @@ getline(s, n, iop)
return (s);
}
-static void
+void
toolong(signo)
int signo;
{
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 76d3b2811ab..6376883dc97 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.25 1996/12/03 03:07:17 deraadt Exp $ */
+/* $OpenBSD: ftpd.c,v 1.26 1996/12/07 09:00:22 bitblt Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -1114,7 +1114,10 @@ dataconn(name, size, mode)
struct sockaddr_in from;
int s, fromlen = sizeof(from);
+ signal (SIGALRM, toolong);
+ (void) alarm ((unsigned) timeout);
s = accept(pdata, (struct sockaddr *)&from, &fromlen);
+ (void) alarm (0);
if (s < 0) {
reply(425, "Can't open data connection.");
(void) close(pdata);