You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int ftplib::Login(const char *user, const char *pass)
{
char tempbuf[64];
if (((strlen(user) + 7) > sizeof(tempbuf)) || ((strlen(pass) + 7) > sizeof(tempbuf))) return 0;
sprintf(tempbuf, "USER %s", user);
if (!FtpSendCmd(tempbuf,'3',mp_ftphandle))
{
if (mp_ftphandle->ctrl != NULL) return 1;
// ------> if (*LastResponse() == '2') return 1;
// <------------ HERE, is it to test for anonymous login ?
return 0;
}
sprintf(tempbuf,"PASS %s",pass);
return FtpSendCmd(tempbuf,'2',mp_ftphandle);
}
If we are losing the connection between the connect but before the Login operation this condition will be true and login function will return 1 (succeed) instead of returning 0 (failed) even if network are now down. If we remove this condition, the logic is going to be right.
What about removing this condition and leting the user use the Login function even if it was accepted as anonymous ?
The text was updated successfully, but these errors were encountered:
Hi,
What is the logic behind this
If we are losing the connection between the connect but before the Login operation this condition will be true and login function will return 1 (succeed) instead of returning 0 (failed) even if network are now down. If we remove this condition, the logic is going to be right.
What about removing this condition and leting the user use the Login function even if it was accepted as anonymous ?
The text was updated successfully, but these errors were encountered: