[FilterScript] TAdmin - A MySQL administration system
#7

Any script that loads permissions or sensitive information needs to check against race condition. You do not want regular players to suddenly become administrators if the query takes long enough.

Quote:
Originally Posted by KinderClans
View Post
In the account check on OnPlayerConnect you don't need LIMIT 1.

pawn Code:
mysql_format(db, query, sizeof(query), "SELECT `pPass`, `pID` FROM `accounts` WHERE `pUsername` = '%e'", GetName(playerid));
Is enough.
His initial query would stop searching if one record is found, however now it will continue searching as it expects there might be multiple rows.

If you remove it, set `pUsername` as UNIQUE column (it now knows there are no duplicates and expects ONLY one row).
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)