1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B 4416: Fix restricted params for UserTemplate (#4433)

* B #4416: Fix restricted params for UserTemplate

* M #-: Fix crash on VM action with wrong user

(cherry picked from commit f652a5fbb8fdb4e2505ec381dc6fe0d6abe2e83b)
This commit is contained in:
Pavel Czerný 2020-03-26 11:16:36 +01:00 committed by Ruben S. Montero
parent 0cdd029e8d
commit 91234e0ba4
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 5 additions and 7 deletions

View File

@ -1123,10 +1123,9 @@ void RequestAttributes::set_auth_op(VMActions::Action action)
if (user != nullptr)
{
result = user->get_vm_auth_op(action);
user->unlock();
}
user->unlock();
if (result != AuthRequest::NONE)
{
auth_op = result;
@ -1138,10 +1137,9 @@ void RequestAttributes::set_auth_op(VMActions::Action action)
if (group != nullptr)
{
result = group->get_vm_auth_op(action);
group->unlock();
}
group->unlock();
if (result != AuthRequest::NONE)
{
auth_op = result;

View File

@ -75,6 +75,9 @@ UserPool::UserPool(SqlDB * db, time_t __session_expiration_time, bool is_slave,
_session_expiration_time = __session_expiration_time;
// Set restricted attributes
UserTemplate::parse_restricted(restricted_attrs);
User * oneadmin_user = get_ro(0);
//Slaves do not need to init the pool, just the oneadmin username
@ -183,9 +186,6 @@ UserPool::UserPool(SqlDB * db, time_t __session_expiration_time, bool is_slave,
goto error_serveradmin;
}
// Set restricted attributes
UserTemplate::parse_restricted(restricted_attrs);
return;
error_readoneauth: