[patch] busybox-1.14.1 ftpd: fix unknown command if write enabled

Stefan Seyfried seife at suse.de
Sun May 31 12:36:29 UTC 2009


When ftpd is started with "-w", it does no longer recognize unknown
commands - which, in turn, confuses e.g. ncftpput.
(Patch additionally attached in case thunderbird messes it up)

diff -rup busybox-1.14.1/networking/ftpd.c busybox-1.14.1-fixed/networking//ftpd.c
--- busybox-1.14.1/networking/ftpd.c	2009-05-27 18:00:23.000000000 +0200
+++ busybox-1.14.1-fixed/networking//ftpd.c	2009-05-31 14:26:13.713676864 +0200
@@ -1320,8 +1320,10 @@ int ftpd_main(int argc UNUSED_PARAM, cha
 				handle_appe();
 			else if (cmdval == const_STOU) /* "store unique" */
 				handle_stou();
+			else
+				cmdio_write_raw(STR(FTP_BADCMD)" Unknown command\r\n");
 		}
-#endif
+#else
 #if 0
 		else if (cmdval == const_STOR
 		 || cmdval == const_MKD
@@ -1342,5 +1344,6 @@ int ftpd_main(int argc UNUSED_PARAM, cha
 			 */
 			cmdio_write_raw(STR(FTP_BADCMD)" Unknown command\r\n");
 		}
+#endif
 	}
 }


Thanks,
    Stefan
-- 
Stefan Seyfried
R&D Team Mobile Devices            |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg | "Well, surrounding them's out."

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-1.14.1-ftpd-write-fix.diff
Type: text/x-patch
Size: 704 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090531/378b7842/attachment.bin>


More information about the busybox mailing list