Skip to content

Commit e793a9c

Browse files
Fixed bug that let clients log into the anonymous user without providing a username
Before, the server accepted an empty username as anonymous username, even though it reported an error. Now, the server still reports an error, but also rejects the login. Clients have to use "anonymous" or "ftp" as username to log in as anonymous user and cannot leave the username empty anymore.
1 parent 9687c1d commit e793a9c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fineftp-server/src/ftp_session.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ namespace fineftp
321321

322322
void FtpSession::handleFtpCommandPASS(const std::string& param)
323323
{
324-
if (last_command_ != "USER")
324+
if (last_command_ != "USER" || username_for_login_.empty())
325325
{
326326
sendFtpMessage(FtpReplyCode::COMMANDS_BAD_SEQUENCE, "Please specify username first");
327327
return;

0 commit comments

Comments
 (0)