summaryrefslogtreecommitdiff
path: root/networking/ftpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/ftpd.c')
-rw-r--r--networking/ftpd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c
index 4e9f65c..fdc6f5e 100644
--- a/networking/ftpd.c
+++ b/networking/ftpd.c
@@ -632,6 +632,18 @@ popen_ls(const char *opt)
argv[3] = G.ftp_arg;
argv[4] = NULL;
+ /* Improve compatibility with non-RFC conforming FTP clients
+ * which send e.g. "LIST -l", "LIST -la".
+ * See https://bugs.kde.org/show_bug.cgi?id=195578 */
+ if (ENABLE_FEATURE_FTPD_ACCEPT_BROKEN_LIST
+ && G.ftp_arg && G.ftp_arg[0] == '-' && G.ftp_arg[1] == 'l'
+ ) {
+ const char *tmp = strchr(G.ftp_arg, ' ');
+ if (tmp) /* skip the space */
+ tmp++;
+ argv[3] = tmp;
+ }
+
xpiped_pair(outfd);
/*fflush_all(); - so far we dont use stdio on output */