diff options
author | torstenb <torstenb@FreeBSD.org> | 1996-11-30 12:00:25 +0000 |
---|---|---|
committer | torstenb <torstenb@FreeBSD.org> | 1996-11-30 12:00:25 +0000 |
commit | ad7885a3f4f5df29c84f126e005f877f039781ab (patch) | |
tree | 82830bdb47044ad65f93209911ceaa35e5974bc5 /libexec/ftpd | |
parent | a93c2eaccb6a90c36f15f7563d91de1cf9026058 (diff) | |
download | FreeBSD-src-ad7885a3f4f5df29c84f126e005f877f039781ab.zip FreeBSD-src-ad7885a3f4f5df29c84f126e005f877f039781ab.tar.gz |
add flag to allow only anonymous ftp logins
Reviewed by: pst
Diffstat (limited to 'libexec/ftpd')
-rw-r--r-- | libexec/ftpd/ftpd.8 | 4 | ||||
-rw-r--r-- | libexec/ftpd/ftpd.c | 13 |
2 files changed, 14 insertions, 3 deletions
diff --git a/libexec/ftpd/ftpd.8 b/libexec/ftpd/ftpd.8 index 11d7254..eb5d3b5 100644 --- a/libexec/ftpd/ftpd.8 +++ b/libexec/ftpd/ftpd.8 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94 -.\" $Id$ +.\" $Id: ftpd.8,v 1.9 1996/09/22 21:53:26 wosch Exp $ .\" .Dd April 19, 1994 .Dt FTPD 8 @@ -130,6 +130,8 @@ When .Fl D is specified, write the daemon's process ID to .Ar file . +.It Fl A +Allow only anonymous ftp access .El .Pp The file diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index e5d92a7..6c02c75 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ftpd.c,v 1.25 1996/10/18 17:09:25 ache Exp $ + * $Id: ftpd.c,v 1.26 1996/11/20 22:13:51 pst Exp $ */ #if 0 @@ -122,6 +122,7 @@ int maxtimeout = 7200;/* don't allow idle time to be set beyond 2 hours */ int logging; int restricted_data_ports = 1; int paranoid = 1; /* be extra careful about security */ +int anon_only = 0; /* Only anonymous ftp allowed */ int guest; int dochroot; int stats; @@ -259,7 +260,7 @@ main(argc, argv, envp) bind_address.s_addr = htonl(INADDR_ANY); - while ((ch = getopt(argc, argv, "dlDSUt:T:u:va:p:")) != EOF) { + while ((ch = getopt(argc, argv, "AdlDSUt:T:u:va:p:")) != EOF) { switch (ch) { case 'D': daemon_mode++; @@ -317,6 +318,9 @@ main(argc, argv, envp) defumask = val; break; } + case 'A': + anon_only = 1; + break; case 'v': debug = 1; @@ -605,6 +609,11 @@ user(name) "ANONYMOUS FTP LOGIN REFUSED FROM %s", remotehost); return; } + if (anon_only != 0) { + reply(530, "Sorry, only anonymous ftp allowed."); + return; + } + if ((pw = sgetpwnam(name))) { if ((shell = pw->pw_shell) == NULL || *shell == 0) shell = _PATH_BSHELL; |