mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 21:56:35 +00:00
No credential size limit and anonymous login
This commit is contained in:
parent
64b5b0a084
commit
84e20ac39a
@ -70,9 +70,9 @@ void FtpServer::end()
|
|||||||
ftpServer.end();
|
ftpServer.end();
|
||||||
dataServer.end();
|
dataServer.end();
|
||||||
|
|
||||||
cmdStage = FTP_Stop;
|
cmdStage = FTP_Init;
|
||||||
transferStage = FTP_Close;
|
transferStage = FTP_Close;
|
||||||
dataConn = FTP_NoConn;
|
dataConn = FTP_NoConn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FtpServer::begin(const char* _user, const char* _pass, const char* _welcomeMessage)
|
void FtpServer::begin(const char* _user, const char* _pass, const char* _welcomeMessage)
|
||||||
@ -118,12 +118,16 @@ void FtpServer::begin(const char* _user, const char* _pass, const char* _welcome
|
|||||||
|
|
||||||
void FtpServer::credentials(const char* _user, const char* _pass)
|
void FtpServer::credentials(const char* _user, const char* _pass)
|
||||||
{
|
{
|
||||||
|
this->user = user;
|
||||||
|
this->pass = _pass;
|
||||||
|
|
||||||
|
/*
|
||||||
if(strlen(_user) > 0 && strlen(_user) < FTP_CRED_SIZE)
|
if(strlen(_user) > 0 && strlen(_user) < FTP_CRED_SIZE)
|
||||||
// strcpy( user, _user );
|
// strcpy( user, _user );
|
||||||
this->user = user;
|
this->user = user;
|
||||||
if(strlen(_pass) > 0 && strlen(_pass) < FTP_CRED_SIZE)
|
if(strlen(_pass) > 0 && strlen(_pass) < FTP_CRED_SIZE)
|
||||||
// strcpy( pass, _pass );
|
// strcpy( pass, _pass );
|
||||||
this->pass = _pass;
|
this->pass = _pass; */
|
||||||
}
|
}
|
||||||
|
|
||||||
void FtpServer::iniVariables()
|
void FtpServer::iniVariables()
|
||||||
@ -313,10 +317,14 @@ bool FtpServer::processCommand()
|
|||||||
if(cmdStage != FTP_Pass) {
|
if(cmdStage != FTP_Pass) {
|
||||||
client.println(F("503 "));
|
client.println(F("503 "));
|
||||||
cmdStage = FTP_Stop;
|
cmdStage = FTP_Stop;
|
||||||
}
|
} else if(!strcmp(parameter, pass)) {
|
||||||
if(!strcmp(parameter, pass)) {
|
|
||||||
DEBUG_PRINTLN(F(" Authentication Ok. Waiting for commands."));
|
DEBUG_PRINTLN(F(" Authentication Ok. Waiting for commands."));
|
||||||
|
|
||||||
|
client.println(F("230 Ok"));
|
||||||
|
cmdStage = FTP_Cmd;
|
||||||
|
} else if(!strcmp("anonymous", user)) {
|
||||||
|
DEBUG_PRINTLN(F(" Anonymous login. Waiting for commands."));
|
||||||
|
|
||||||
client.println(F("230 Ok"));
|
client.println(F("230 Ok"));
|
||||||
cmdStage = FTP_Cmd;
|
cmdStage = FTP_Cmd;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user