diff --git a/src/um/UserPool.cc b/src/um/UserPool.cc index 2becedf6ae..21fa55d32b 100644 --- a/src/um/UserPool.cc +++ b/src/um/UserPool.cc @@ -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