mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 05:04:56 +09:00
M #-: Validate username before authentication
This commit is contained in:
1 file changed
+7
@@ -1351,6 +1351,7 @@ bool UserPool::authenticate(const string& session,
|
||||
User * user = 0;
|
||||
string username;
|
||||
string token;
|
||||
string error_str;
|
||||
|
||||
int rc;
|
||||
bool ar;
|
||||
@@ -1362,6 +1363,12 @@ bool UserPool::authenticate(const string& session,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!PoolObjectSQL::name_is_valid(username, User::INVALID_NAME_CHARS, error_str))
|
||||
{
|
||||
NebulaLog::log("AuM",Log::ERROR, "User is invalid, " + error_str );
|
||||
return false;
|
||||
}
|
||||
|
||||
user = get(username);
|
||||
|
||||
if (user != 0 ) //User known to OpenNebula
|
||||
|
||||
Reference in new issue
Block a user