Issue information

Issue ID
#8595
Status
Invalid
Severity
None
Started
Dastgir
Mar 29, 2015 7:49
Last Post
Dastgir
Apr 2, 2015 11:22
Confirmation
N/A

Dastgir - Mar 29, 2015 7:49

We are unable to disable ipban upon fail attempts of wrong password.

Cause:
[code=auto:0]if( result == 1 && login_config.dynamic_pass_failure_ban ) ipban_log(ip); // log failed password attempt#if PACKETVER >= 20120000 /* not sure when this started */ WFIFOHEAD(fd,26); WFIFOW(fd,0) = 0x83e; WFIFOL(fd,2) = result; if( result != 6 ) memset(WFIFOP(fd,6), '\0', 20); else { // 6 = Your are Prohibited to log in until %s struct mmo_account acc; time_t unban_time = ( accounts->load_str(accounts, &acc, sd->userid) ) ? acc.unban_time : 0; timestamp2string((char*)WFIFOP(fd,6), 20, unban_time, login_config.date_format); } WFIFOSET(fd,26);#else WFIFOHEAD(fd,23); WFIFOW(fd,0) = 0x6a; WFIFOB(fd,2) = (uint8)result; if( result != 6 ) memset(WFIFOP(fd,3), '\0', 20); else { // 6 = Your are Prohibited to log in until %s struct mmo_account acc; time_t unban_time = ( accounts->load_str(accounts, &acc, sd->userid) ) ? acc.unban_time : 0; timestamp2string((char*)WFIFOP(fd,3), 20, unban_time, login_config.date_format); } WFIFOSET(fd,23);#endif[/code]If result is 1 , it should have check if ipban is enabled or not, if not, then end the function.


Solution:
[code=auto:0]if( result == 1){ if (!login_config.dynamic_pass_failure_ban )return;ipban_log(ip);}[/code]Thanks to @Zeira for pointing this point.

This post has been edited by Dastgir on Mar 29, 2015 7:57

Dastgir - Mar 29, 2015 7:57

Hmm, seems like editing messed up formatting.

Haru - Mar 29, 2015 21:49

I don't understand, why should it terminate the function?
If you terminate it at that point, it will not show the appropriate message to the client, explaining why the login failed.

Dastgir - Apr 2, 2015 11:22

Marked as Invalid, seems like I was thinking something else and doing something else o_O.....