//config: help
//config: simple FTP daemon. You have to run it via inetd.
//config:
-//config:config FEATURE_FTP_WRITE
+//config:config FEATURE_FTPD_WRITE
//config: bool "Enable upload commands"
//config: default y
//config: depends on FTPD
//config: it increases the code size by ~40 bytes.
//config: Most other ftp servers seem to behave similar to this.
//config:
-//config:config FEATURE_FTP_AUTHENTICATION
+//config:config FEATURE_FTPD_AUTHENTICATION
//config: bool "Enable authentication"
//config: default y
//config: depends on FTPD
len_and_sockaddr *port_addr;
char *ftp_cmd;
char *ftp_arg;
-#if ENABLE_FEATURE_FTP_WRITE
+#if ENABLE_FEATURE_FTPD_WRITE
char *rnfr_filename;
#endif
/* We need these aligned to uint32_t */
/* Upload commands */
-#if ENABLE_FEATURE_FTP_WRITE
+#if ENABLE_FEATURE_FTPD_WRITE
static void
handle_mkd(void)
{
G.restart_pos = 0;
handle_upload_common(0, 1);
}
-#endif /* ENABLE_FEATURE_FTP_WRITE */
+#endif /* ENABLE_FEATURE_FTPD_WRITE */
static uint32_t
cmdio_get_cmd_and_arg(void)
#endif
OPT_v = (1 << ((!BB_MMU) * 3 + 0)),
OPT_S = (1 << ((!BB_MMU) * 3 + 1)),
- OPT_w = (1 << ((!BB_MMU) * 3 + 2)) * ENABLE_FEATURE_FTP_WRITE,
+ OPT_w = (1 << ((!BB_MMU) * 3 + 2)) * ENABLE_FEATURE_FTPD_WRITE,
};
int ftpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int ftpd_main(int argc UNUSED_PARAM, char **argv)
#endif
{
-#if ENABLE_FEATURE_FTP_AUTHENTICATION
+#if ENABLE_FEATURE_FTPD_AUTHENTICATION
struct passwd *pw = NULL;
#endif
unsigned abs_timeout;
G.timeout = 2 * 60;
opt_complementary = "vv:SS";
#if BB_MMU
- opts = getopt32(argv, "vS" IF_FEATURE_FTP_WRITE("w") "t:+T:+", &G.timeout, &abs_timeout, &G.verbose, &verbose_S);
+ opts = getopt32(argv, "vS" IF_FEATURE_FTPD_WRITE("w") "t:+T:+", &G.timeout, &abs_timeout, &G.verbose, &verbose_S);
#else
- opts = getopt32(argv, "l1AvS" IF_FEATURE_FTP_WRITE("w") "t:+T:+", &G.timeout, &abs_timeout, &G.verbose, &verbose_S);
+ opts = getopt32(argv, "l1AvS" IF_FEATURE_FTPD_WRITE("w") "t:+T:+", &G.timeout, &abs_timeout, &G.verbose, &verbose_S);
if (opts & (OPT_l|OPT_1)) {
/* Our secret backdoor to ls */
/* TODO: pass --group-directories-first? would be nice, but ls doesn't do that yet */
WRITE_OK(FTP_GREET);
signal(SIGALRM, timeout_handler);
-#if ENABLE_FEATURE_FTP_AUTHENTICATION
+#if ENABLE_FEATURE_FTPD_AUTHENTICATION
while (1) {
uint32_t cmdval = cmdio_get_cmd_and_arg();
if (cmdval == const_USER) {
xchdir(basedir);
}
-#if ENABLE_FEATURE_FTP_AUTHENTICATION
+#if ENABLE_FEATURE_FTPD_AUTHENTICATION
change_identity(pw);
#endif
handle_port();
else if (cmdval == const_REST)
handle_rest();
-#if ENABLE_FEATURE_FTP_WRITE
+#if ENABLE_FEATURE_FTPD_WRITE
else if (opts & OPT_w) {
if (cmdval == const_STOR)
handle_stor();
* (doesn't necessarily mean "we must support them")
* foo 1.2.3: XXXX - comment
*/
-#if ENABLE_FEATURE_FTP_WRITE
+#if ENABLE_FEATURE_FTPD_WRITE
bad_cmd:
#endif
cmdio_write_raw(STR(FTP_BADCMD)" Unknown command\r\n");