diff options
Diffstat (limited to 'networking/ftpd.c')
-rw-r--r-- | networking/ftpd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c index 2c1d42ebf..f005d129c 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c | |||
@@ -692,6 +692,7 @@ handle_dir_common(int opts) | |||
692 | * are fed with ls output with bare '\n'. | 692 | * are fed with ls output with bare '\n'. |
693 | * Pity... that would be much simpler. | 693 | * Pity... that would be much simpler. |
694 | */ | 694 | */ |
695 | /* TODO: need to s/LF/NUL/g here */ | ||
695 | xwrite_str(remote_fd, line); | 696 | xwrite_str(remote_fd, line); |
696 | xwrite(remote_fd, "\r\n", 2); | 697 | xwrite(remote_fd, "\r\n", 2); |
697 | free(line); | 698 | free(line); |
@@ -710,6 +711,13 @@ handle_list(void) | |||
710 | static void | 711 | static void |
711 | handle_nlst(void) | 712 | handle_nlst(void) |
712 | { | 713 | { |
714 | /* NLST returns list of names, "\r\n" terminated without regard | ||
715 | * to the current binary flag. Names may start with "/", | ||
716 | * then they represent full names (we don't produce such names), | ||
717 | * otherwise names are relative to current directory. | ||
718 | * Embedded "\n" are replaced by NULs. This is safe since names | ||
719 | * can never contain NUL. | ||
720 | */ | ||
713 | handle_dir_common(0); | 721 | handle_dir_common(0); |
714 | } | 722 | } |
715 | static void | 723 | static void |