diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-04-23 22:38:03 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-04-23 22:38:03 +0200 |
commit | 922d6d0780e3935c0e7e0a25ad781d011f5db941 (patch) | |
tree | 68282729ed762c5155cdf5a18ad56e5c655ca750 | |
parent | 8ff7d518c60104f5d6aa033737d079f8f04f9ac0 (diff) | |
download | plan9front-922d6d0780e3935c0e7e0a25ad781d011f5db941.tar.xz |
ftpd: implement "OPTS UTF-8 ON", fix uninitialized printing uninitialized memory in HELP command
-rw-r--r-- | sys/src/cmd/ip/ftpd.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/src/cmd/ip/ftpd.c b/sys/src/cmd/ip/ftpd.c index 582e0a918..e244c39be 100644 --- a/sys/src/cmd/ip/ftpd.c +++ b/sys/src/cmd/ip/ftpd.c @@ -49,6 +49,7 @@ int mkdircmd(char*); int modecmd(char*); int namelistcmd(char*); int nopcmd(char*); +int optscmd(char*); int passcmd(char*); int pasvcmd(char*); int portcmd(char*); @@ -96,6 +97,7 @@ Cmd cmdtab[] = { "mode", modecmd, 0, }, { "nlst", namelistcmd, 1, }, { "noop", nopcmd, 0, }, + { "opts", optscmd, 0, }, { "pass", passcmd, 0, }, { "pasv", pasvcmd, 1, }, { "pwd", pwdcmd, 0, }, @@ -478,6 +480,20 @@ transfer(char *cmd, char *a1, char *a2, char *a3, int image) return bytes; } +int +optscmd(char *arg) +{ + char *p; + + if(p = strchr(arg, ' ')) + *p = 0; + if(cistrcmp(arg, "UTF-8") == 0){ + reply("200 Command okay"); + return 0; + } + reply("502 %s option not implemented", arg); + return 0; +} /* * just reply OK @@ -1593,6 +1609,7 @@ helpcmd(char *arg) USED(arg); reply("214- the following commands are implemented:"); + buf[0] = 0; p = buf; e = buf+sizeof buf; for(i = 0; cmdtab[i].name; i++){ |