diff options
author | pst <pst@FreeBSD.org> | 1996-08-05 00:21:15 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1996-08-05 00:21:15 +0000 |
commit | fca5bc38ec00d8cb5087036679424e8817d2b782 (patch) | |
tree | 12d2de9b0d4e2a49a22dcb35f943c6b5f2e301fb /libexec/ftpd/ftpcmd.y | |
parent | 1d37bd800534129c143f350649cec9fa9248e26b (diff) | |
download | FreeBSD-src-fca5bc38ec00d8cb5087036679424e8817d2b782.zip FreeBSD-src-fca5bc38ec00d8cb5087036679424e8817d2b782.tar.gz |
Convert STATS and PARANOID to run-time options.
Document the new -R (relax paranoia) option.
From NetBSD/Lite2: code and man page cleanups, Kerberos IV hooks
(relax, we're still exportable), and /etc/ftpchroot feature for
semi-anonymous accounts
Diffstat (limited to 'libexec/ftpd/ftpcmd.y')
-rw-r--r-- | libexec/ftpd/ftpcmd.y | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index aa0a67d..4a162c6 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -71,6 +71,7 @@ extern struct sockaddr_in data_dest, his_addr; extern int logged_in; extern struct passwd *pw; extern int guest; +extern int paranoid; extern int logging; extern int type; extern int form; @@ -152,19 +153,16 @@ cmd | PORT check_login SP host_port CRLF { if ($2) { -#ifdef PARANOID - if ((ntohs(data_dest.sin_port) < - IPPORT_RESERVED) || - memcmp(&data_dest.sin_addr, - &his_addr.sin_addr, - sizeof(data_dest.sin_addr))) - { + if (paranoid && + ((ntohs(data_dest.sin_port) < + IPPORT_RESERVED) || + memcmp(&data_dest.sin_addr, + &his_addr.sin_addr, + sizeof(data_dest.sin_addr)))) { usedefault = 1; reply(500, "Illegal PORT range rejected."); - } else -#endif - { + } else { usedefault = 0; if (pdata >= 0) { (void) close(pdata); @@ -510,8 +508,9 @@ cmd struct tm *t; t = gmtime(&stbuf.st_mtime); reply(213, - "19%02d%02d%02d%02d%02d%02d", - t->tm_year, t->tm_mon+1, t->tm_mday, + "%04d%02d%02d%02d%02d%02d", + 1900 + t->tm_year, + t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); } } @@ -572,11 +571,12 @@ host_port { char *a, *p; - a = (char *)&data_dest.sin_addr; - a[0] = $1; a[1] = $3; a[2] = $5; a[3] = $7; + data_dest.sin_len = sizeof(struct sockaddr_in); + data_dest.sin_family = AF_INET; p = (char *)&data_dest.sin_port; p[0] = $9; p[1] = $11; - data_dest.sin_family = AF_INET; + a = (char *)&data_dest.sin_addr; + a[0] = $1; a[1] = $3; a[2] = $5; a[3] = $7; } ; |