summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko2009-03-17 13:03:06 +0000
committerDenis Vlasenko2009-03-17 13:03:06 +0000
commit3a7a1eba2e2b3cc05f000fc739d3548dd0a0872d (patch)
tree3861b7f148c5cab5bcaf26002d5a9ee32f46f7b9 /networking
parent1a825551083fa0b8e7ece6391a58dc417199a2e3 (diff)
downloadbusybox-3a7a1eba2e2b3cc05f000fc739d3548dd0a0872d.zip
busybox-3a7a1eba2e2b3cc05f000fc739d3548dd0a0872d.tar.gz
ftpd: document NLST format
Diffstat (limited to 'networking')
-rw-r--r--networking/ftpd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c
index 2c1d42e..f005d12 100644
--- a/networking/ftpd.c
+++ b/networking/ftpd.c
@@ -692,6 +692,7 @@ handle_dir_common(int opts)
* are fed with ls output with bare '\n'.
* Pity... that would be much simpler.
*/
+/* TODO: need to s/LF/NUL/g here */
xwrite_str(remote_fd, line);
xwrite(remote_fd, "\r\n", 2);
free(line);
@@ -710,6 +711,13 @@ handle_list(void)
static void
handle_nlst(void)
{
+ /* NLST returns list of names, "\r\n" terminated without regard
+ * to the current binary flag. Names may start with "/",
+ * then they represent full names (we don't produce such names),
+ * otherwise names are relative to current directory.
+ * Embedded "\n" are replaced by NULs. This is safe since names
+ * can never contain NUL.
+ */
handle_dir_common(0);
}
static void