summaryrefslogtreecommitdiffstats
path: root/libexec/ftpd/ftpd.c
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2007-04-18 22:43:39 +0000
committeryar <yar@FreeBSD.org>2007-04-18 22:43:39 +0000
commit021deab651b9dfe702f6782a0cd84160cfde4879 (patch)
treee8d5084ca4e462ef12b2274ff9ba0ab5aaab315c /libexec/ftpd/ftpd.c
parentc44ef841d01c6fcd81a5059c28aba52e203f0a10 (diff)
downloadFreeBSD-src-021deab651b9dfe702f6782a0cd84160cfde4879.zip
FreeBSD-src-021deab651b9dfe702f6782a0cd84160cfde4879.tar.gz
Add support for RFC 2389 (FEAT) and RFC 2640 (UTF8) to ftpd(8).
The support for RFC 2640 (UTF8) is optional and rudimentary. The server just advertises its capability to handle UTF-8 file names and relies on its own 8-bit cleanness, as well as on the backward compatibility of UTF-8 with ASCII. So uploaded files will have UTF-8 names, but the initial server contents should be prepared in UTF-8 by hand, no on-the-fly conversion of file names will be done. PR: bin/111714 Submitted by: Zhang Weiwu <see email in the PR> MFC after: 1 week
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r--libexec/ftpd/ftpd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 1a6a373..5095f20 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -128,6 +128,7 @@ int logging;
int restricted_data_ports = 1;
int paranoid = 1; /* be extra careful about security */
int anon_only = 0; /* Only anonymous ftp allowed */
+int assumeutf8 = 0; /* Assume that server file names are in UTF-8 */
int guest;
int dochroot;
char *chrootdir;
@@ -308,7 +309,7 @@ main(int argc, char *argv[], char **envp)
openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP);
while ((ch = getopt(argc, argv,
- "46a:AdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) {
+ "468a:AdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) {
switch (ch) {
case '4':
family = (family == AF_INET6) ? AF_UNSPEC : AF_INET;
@@ -318,6 +319,10 @@ main(int argc, char *argv[], char **envp)
family = (family == AF_INET) ? AF_UNSPEC : AF_INET6;
break;
+ case '8':
+ assumeutf8 = 1;
+ break;
+
case 'a':
bindname = optarg;
break;
OpenPOWER on IntegriCloud