From ea32e5ab032857e459120ba979656cc04532b2f6 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 22 Mar 2017 13:00:41 +1000 Subject: [PATCH] add ftp to anonymous list --- users.c | 8 ++++++++ utils/magiftpd/magiftpd.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/users.c b/users.c index 2983189..a267ca7 100644 --- a/users.c +++ b/users.c @@ -466,6 +466,14 @@ struct user_record *new_user() { s_printf(get_string(169)); continue; } + if (strcasecmp(buffer, "anonymous") == 0) { + s_printf(get_string(169)); + continue; + } + if (strcasecmp(buffer, "ftp") == 0) { + s_printf(get_string(169)); + continue; + } user->loginname = strdup(buffer); nameok = check_user(user->loginname); if (!nameok) { diff --git a/utils/magiftpd/magiftpd.c b/utils/magiftpd/magiftpd.c index 959ddc7..8584e97 100644 --- a/utils/magiftpd/magiftpd.c +++ b/utils/magiftpd/magiftpd.c @@ -548,7 +548,7 @@ void handle_PASS(struct ftpserver *cfg, struct ftpclient *client, char *password return; } - if (strcmp(client->name, "anonymous") == 0) { + if (strcmp(client->name, "anonymous") == 0 || strcmp(client->name, "ftp") == 0) { strncpy(client->password, password, 32); client->password[31] = '\0'; send_msg(client, "230 User Logged in, Proceed.\r\n"); @@ -597,7 +597,7 @@ void handle_PASS(struct ftpserver *cfg, struct ftpclient *client, char *password void handle_USER(struct ftpserver *cfg, struct ftpclient *client, char *username) { strncpy(client->name, username, 16); client->name[15] = '\0'; - if (strcmp(client->name, "anonymous") == 0) { + if (strcmp(client->name, "anonymous") == 0 || strcmp(client->name, "ftp") == 0) { send_msg(client, "331 Guest login ok, send your complete e-mail address as password.\r\n"); } else { send_msg(client, "331 User name ok, need password.\r\n");