diff options
author | nik <nik@FreeBSD.org> | 2001-08-28 11:59:21 +0000 |
---|---|---|
committer | nik <nik@FreeBSD.org> | 2001-08-28 11:59:21 +0000 |
commit | 28e8743f4b4b3dfe294fa82312f20d891d119846 (patch) | |
tree | b5001d0b73b93ace9a47b73c0ce00bc18a1afd5e /libexec/ftpd/ftpcmd.y | |
parent | 6858a135d88590e8cc016be47aa6f7d379b63c96 (diff) | |
download | FreeBSD-src-28e8743f4b4b3dfe294fa82312f20d891d119846.zip FreeBSD-src-28e8743f4b4b3dfe294fa82312f20d891d119846.tar.gz |
Add a new option, '-o', for "Write-only". Disables the RETR command,
preventing anyone from downloading files. In conjunction with -A, and some
appropriate file permissions, this lets you create an anonymous FTP drop
box for people to upload files to.
The more obvious "-w" flag is already taken by NetBSD's ftpd. "-o" was
available as an option letter in all three BSDs.
Diffstat (limited to 'libexec/ftpd/ftpcmd.y')
-rw-r--r-- | libexec/ftpd/ftpcmd.y | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 1ae6e41..2da3ef2 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -93,6 +93,7 @@ extern int transflag; extern char tmpline[]; extern int readonly; extern int noepsv; +extern int noretr; off_t restart_point; @@ -439,8 +440,11 @@ cmd } | RETR check_login SP pathname CRLF { - if ($2 && $4 != NULL) + if (noretr) + reply(500, "RETR command is disabled"); + else if ($2 && $4 != NULL) retrieve((char *) 0, $4); + if ($4 != NULL) free($4); } |