diff options
-rw-r--r-- | networking/Config.in | 11 | ||||
-rw-r--r-- | networking/ftpd.c | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/networking/Config.in b/networking/Config.in index 80834c6d4..788e128ea 100644 --- a/networking/Config.in +++ b/networking/Config.in | |||
@@ -117,6 +117,17 @@ config FEATURE_FTP_WRITE | |||
117 | help | 117 | help |
118 | Enable all kinds of FTP upload commands (-w option) | 118 | Enable all kinds of FTP upload commands (-w option) |
119 | 119 | ||
120 | config FEATURE_FTPD_ACCEPT_BROKEN_LIST | ||
121 | bool "Enable workaround for RFC-violating clients" | ||
122 | default y | ||
123 | depends on FTPD | ||
124 | help | ||
125 | Some ftp-clients (among them KDE's Konqueror) issue illegal | ||
126 | "LIST -la" requests. This option works around those problems. | ||
127 | It might prevent you from listing files starting with "-" and | ||
128 | it increases the code size by ~40 bytes. | ||
129 | Most other ftp servers seem to behave similar to this. | ||
130 | |||
120 | config FTPGET | 131 | config FTPGET |
121 | bool "ftpget" | 132 | bool "ftpget" |
122 | default n | 133 | default n |
diff --git a/networking/ftpd.c b/networking/ftpd.c index 4e9f65ca3..fdc6f5e45 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c | |||
@@ -632,6 +632,18 @@ popen_ls(const char *opt) | |||
632 | argv[3] = G.ftp_arg; | 632 | argv[3] = G.ftp_arg; |
633 | argv[4] = NULL; | 633 | argv[4] = NULL; |
634 | 634 | ||
635 | /* Improve compatibility with non-RFC conforming FTP clients | ||
636 | * which send e.g. "LIST -l", "LIST -la". | ||
637 | * See https://bugs.kde.org/show_bug.cgi?id=195578 */ | ||
638 | if (ENABLE_FEATURE_FTPD_ACCEPT_BROKEN_LIST | ||
639 | && G.ftp_arg && G.ftp_arg[0] == '-' && G.ftp_arg[1] == 'l' | ||
640 | ) { | ||
641 | const char *tmp = strchr(G.ftp_arg, ' '); | ||
642 | if (tmp) /* skip the space */ | ||
643 | tmp++; | ||
644 | argv[3] = tmp; | ||
645 | } | ||
646 | |||
635 | xpiped_pair(outfd); | 647 | xpiped_pair(outfd); |
636 | 648 | ||
637 | /*fflush_all(); - so far we dont use stdio on output */ | 649 | /*fflush_all(); - so far we dont use stdio on output */ |