Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/ftpd make LPRT on IPv4 work.
details: https://anonhg.NetBSD.org/src/rev/7d561863c0da
branches: trunk
changeset: 474569:7d561863c0da
user: itojun <itojun%NetBSD.org@localhost>
date: Sun Jul 11 20:03:41 1999 +0000
description:
make LPRT on IPv4 work.
make LPSV on IPv6 work.
diffstat:
libexec/ftpd/ftpcmd.y | 59 ++++++++++++++++++++++++++++++++++++++++++--------
libexec/ftpd/ftpd.8 | 8 +-----
2 files changed, 51 insertions(+), 16 deletions(-)
diffs (122 lines):
diff -r 5bf97e65f9c9 -r 7d561863c0da libexec/ftpd/ftpcmd.y
--- a/libexec/ftpd/ftpcmd.y Sun Jul 11 19:30:39 1999 +0000
+++ b/libexec/ftpd/ftpcmd.y Sun Jul 11 20:03:41 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ftpcmd.y,v 1.33 1999/07/02 07:11:36 itojun Exp $ */
+/* $NetBSD: ftpcmd.y,v 1.34 1999/07/11 20:03:41 itojun Exp $ */
/*
* Copyright (c) 1985, 1988, 1993, 1994
@@ -47,7 +47,7 @@
#if 0
static char sccsid[] = "@(#)ftpcmd.y 8.3 (Berkeley) 4/6/94";
#else
-__RCSID("$NetBSD: ftpcmd.y,v 1.33 1999/07/02 07:11:36 itojun Exp $");
+__RCSID("$NetBSD: ftpcmd.y,v 1.34 1999/07/11 20:03:41 itojun Exp $");
#endif
#endif /* not lint */
@@ -243,15 +243,37 @@
}
}
- | LPRT check_login SP host_long_port CRLF
+ | LPRT check_login SP host_long_port4 CRLF
{
/* be paranoid, if told so */
if (curclass.checkportcmd &&
- ((ntohs(data_dest.su_port) <
- IPPORT_RESERVED) ||
- memcmp(&data_dest.su_sin6.sin6_addr,
- &his_addr.su_sin6.sin6_addr,
- sizeof(data_dest.su_sin6.sin6_addr)) != 0)) {
+ ((ntohs(data_dest.su_port) < IPPORT_RESERVED) ||
+ memcmp(&data_dest.su_sin.sin_addr,
+ &his_addr.su_sin.sin_addr,
+ sizeof(data_dest.su_sin.sin_addr)) != 0)) {
+ reply(500, "Illegal LPRT command rejected");
+ return (NULL);
+ }
+ if (epsvall)
+ reply(501, "LPRT disallowed after EPSV ALL");
+ else {
+ usedefault = 0;
+ if (pdata >= 0) {
+ (void) close(pdata);
+ pdata = -1;
+ }
+ reply(200, "LPRT command successful.");
+ }
+ }
+
+ | LPRT check_login SP host_long_port6 CRLF
+ {
+ /* be paranoid, if told so */
+ if (curclass.checkportcmd &&
+ ((ntohs(data_dest.su_port) < IPPORT_RESERVED) ||
+ memcmp(&data_dest.su_sin6.sin6_addr,
+ &his_addr.su_sin6.sin6_addr,
+ sizeof(data_dest.su_sin6.sin6_addr)) != 0)) {
reply(500, "Illegal LPRT command rejected");
return (NULL);
}
@@ -392,7 +414,7 @@
if (epsvall)
reply(501, "LPSV disallowed after EPSV ALL");
else
- long_passive("LPSV", AF_INET6);
+ long_passive("LPSV", PF_UNSPEC);
}
| EPSV SP NUMBER CRLF
@@ -893,7 +915,24 @@
}
;
-host_long_port
+host_long_port4
+ : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA
+ NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA
+ NUMBER
+ {
+ char *a, *p;
+
+ data_dest.su_sin.sin_len =
+ sizeof(struct sockaddr_in);
+ data_dest.su_family = AF_INET;
+ p = (char *)&data_dest.su_port;
+ p[0] = $15; p[1] = $17;
+ a = (char *)&data_dest.su_sin.sin_addr;
+ a[0] = $5; a[1] = $7; a[2] = $9; a[3] = $11;
+ }
+ ;
+
+host_long_port6
: NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA
NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA
NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA
diff -r 5bf97e65f9c9 -r 7d561863c0da libexec/ftpd/ftpd.8
--- a/libexec/ftpd/ftpd.8 Sun Jul 11 19:30:39 1999 +0000
+++ b/libexec/ftpd/ftpd.8 Sun Jul 11 20:03:41 1999 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: ftpd.8,v 1.38 1999/07/02 05:54:21 itojun Exp $
+.\" $NetBSD: ftpd.8,v 1.39 1999/07/11 20:03:41 itojun Exp $
.\"
.\" Copyright (c) 1985, 1988, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -672,14 +672,10 @@
When running on IPv6, connection from IPv4 mapped address
.Pq IPv4 connection to IPv6 socket
is not supported yet.
-Please run two daemons, one for IPv4 and one for IPv6, for the moment.
+Please run two daemons, one for IPv4 and one for IPv6.
.Pp
Don't create
.Pa ~ftp/tmp
if you don't want anonymous users to upload files there.
That directory is only necessary if you want to display the error
messages of conversion commands to the user.
-.Pp
-.Nm
-Does not accept LPRT on IPv4 at this moment, which it should.
-.\" EPSV/EPRT is the way to go so it is non-issue.
Home |
Main Index |
Thread Index |
Old Index