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:
parent
0cdd029e8d
commit
91234e0ba4
@ -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;
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user