mirror of
https://github.com/ovh/the-bastion.git
synced 2025-01-09 08:47:50 +08:00
fix: groupSetRole: pass sudo param to subfuncs to avoid a security warning
This commit is contained in:
parent
4624f71ea2
commit
02b76d301a
1 changed files with 3 additions and 3 deletions
|
@ -163,7 +163,7 @@ sub act {
|
|||
|
||||
if ($type eq 'member') {
|
||||
|
||||
if ($action eq 'add' && OVH::Bastion::is_group_guest(group => $shortGroup, account => $account)) {
|
||||
if ($action eq 'add' && OVH::Bastion::is_group_guest(group => $shortGroup, account => $account, sudo => $params{'sudo'})) {
|
||||
|
||||
# if the user is a guest, must remove all his guest accesses first
|
||||
$fnret = OVH::Bastion::get_acl_way(way => 'groupguest', group => $shortGroup, account => $account);
|
||||
|
@ -242,7 +242,7 @@ sub act {
|
|||
}
|
||||
|
||||
# If the account is already a member, can't add/del them as guest
|
||||
if (OVH::Bastion::is_group_member(group => $shortGroup, account => $account)) {
|
||||
if (OVH::Bastion::is_group_member(group => $shortGroup, account => $account, sudo => $params{'sudo'})) {
|
||||
return R('ERR_MEMBER_CANNOT_BE_GUEST', msg => "Can't $action $account as a guest of group $shortGroup, they're already a member!");
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,7 @@ sub act {
|
|||
}
|
||||
}
|
||||
|
||||
if ($accessesFound == 0 && !OVH::Bastion::is_group_member(group => $shortGroup, account => $account)) {
|
||||
if ($accessesFound == 0 && !OVH::Bastion::is_group_member(group => $shortGroup, account => $account, sudo => $params{'sudo'})) {
|
||||
osh_debug "No guest access remains to group $shortGroup for account $account, removing group key access";
|
||||
#
|
||||
# remove account from group
|
||||
|
|
Loading…
Reference in a new issue