diff --git a/bin/helper/osh-groupGenerateSshdConfig b/bin/helper/osh-groupGenerateSshdConfig index 8c43e0e..df8b367 100644 --- a/bin/helper/osh-groupGenerateSshdConfig +++ b/bin/helper/osh-groupGenerateSshdConfig @@ -17,11 +17,11 @@ use OVH::Bastion::Helper; # Fetch command options my $fnret; my ($result, @optwarns); -my $group; +my ($group, $deletedLocalPort); eval { local $SIG{__WARN__} = sub { push @optwarns, shift }; $result = GetOptions( - "group=s" => sub { $group //= $_[1] }, + "group=s" => sub { $group //= $_[1] }, "deleted-local-port=i" => sub { $deletedLocalPort //= $_[1] }, ); }; @@ -82,7 +82,8 @@ foreach my $member (@$members) { my @errors; my @success; foreach my $account (@accounts_to_update) { - $fnret = OVH::Bastion::generate_account_sshd_forwarding_config(account => $account, deletedLocalPort => $deletedLocalPort); + $fnret = + OVH::Bastion::generate_account_sshd_forwarding_config(account => $account, deletedLocalPort => $deletedLocalPort); if ($fnret) { push @success, $account; } diff --git a/bin/plugin/group-aclkeeper/groupDelServer b/bin/plugin/group-aclkeeper/groupDelServer index 8a1f2ca..1c2de04 100755 --- a/bin/plugin/group-aclkeeper/groupDelServer +++ b/bin/plugin/group-aclkeeper/groupDelServer @@ -145,7 +145,7 @@ if ($fnret && $fnret->err ne 'OK_NO_CHANGE' && $remotePort) { # Now regenerate the sshd config for all members of this group my @sshd_command = qw{ sudo -n -u root -- /usr/bin/env perl -T }; push @sshd_command, $OVH::Bastion::BASEPATH . '/bin/helper/osh-groupGenerateSshdConfig'; - push @sshd_command, '--group', $group; + push @sshd_command, '--group', $group; push @sshd_command, '--deleted-local-port', $fnret->value->{'localPort'} if defined $fnret->value->{'localPort'}; my $sshd_fnret = OVH::Bastion::helper(cmd => \@sshd_command);