summaryrefslogtreecommitdiff
path: root/lib/libc/rpc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-05 00:34:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-05 00:34:47 +0000
commit0bb655c866b74cdcd15bde96398ed3f98c72723a (patch)
tree95d7f6d3b0ab5d60a49ddc3155c317e70f6ac4fa /lib/libc/rpc
parent81dbd55ac598ad8e23c798d7322c3531b6b6fad3 (diff)
if port 20 incoming, kill it and try again
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r--lib/libc/rpc/svc_tcp.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libc/rpc/svc_tcp.c b/lib/libc/rpc/svc_tcp.c
index 758b9d998a4..c03659b4520 100644
--- a/lib/libc/rpc/svc_tcp.c
+++ b/lib/libc/rpc/svc_tcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svc_tcp.c,v 1.3 1996/07/20 06:12:45 deraadt Exp $ */
+/* $OpenBSD: svc_tcp.c,v 1.4 1996/08/05 00:34:28 deraadt Exp $ */
/* $NetBSD: svc_tcp.c,v 1.6 1995/06/03 22:37:27 mycroft Exp $ */
/*
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC";*/
-static char *rcsid = "$OpenBSD: svc_tcp.c,v 1.3 1996/07/20 06:12:45 deraadt Exp $";
+static char *rcsid = "$OpenBSD: svc_tcp.c,v 1.4 1996/08/05 00:34:28 deraadt Exp $";
#endif
/*
@@ -247,6 +247,14 @@ rendezvous_request(xprt)
return (FALSE);
}
/*
+ * XXX careful for ftp bounce attacks. If discovered, close the
+ * socket and look for another connection.
+ */
+ if (addr.sin_port == htons(20)) {
+ close(sock);
+ goto again;
+ }
+ /*
* make a new transporter (re-uses xprt)
*/
xprt = makefd_xprt(sock, r->sendsize, r->recvsize);