diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 1996-12-03 10:53:06 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1996-12-03 10:53:06 +0000 |
| commit | 245110794e64da5b3c0b03419f1d25c96cd5e8bc (patch) | |
| tree | 65b3d8124f3df0198cbca095433c841b665f3897 /libexec/ftpd | |
| parent | 0a950567fc4726a72b5df4bb46667383c7486ade (diff) | |
Notes
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 11d72546ee98..eb5d3b55a526 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 e5d92a72f63d..2f02ff1f9b73 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.25.2.1 1996/11/21 16:35:50 phk 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; |
