Allow access to unvalidated authstrings (bug 5587, r=psychonic).

This commit is contained in:
Asher Baker
2013-03-07 00:58:17 +00:00
parent d44e334524
commit 8da56ff98c
8 changed files with 59 additions and 38 deletions
+10 -2
View File
@@ -156,12 +156,20 @@ static cell_t sm_GetClientAuthStr(IPluginContext *pCtx, const cell_t *params)
return pCtx->ThrowNativeError("Client %d is not connected", index);
}
if (!pPlayer->IsAuthorized())
bool validate = true;
if (params[0] > 3)
{
validate = !!params[4];
}
const char *authstr = pPlayer->GetAuthString(validate);
if (!authstr || authstr[0] == '\0')
{
return 0;
}
pCtx->StringToLocal(params[2], static_cast<size_t>(params[3]), pPlayer->GetAuthString());
pCtx->StringToLocal(params[2], static_cast<size_t>(params[3]), authstr);
return 1;
}