Skip to content

Commit

Permalink
fix: avoid a warn() when an non-resolvable host is specified with scp…
Browse files Browse the repository at this point in the history
… or sftp
  • Loading branch information
speed47 committed Mar 22, 2024
1 parent 496fe94 commit 28a02d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/shell/osh.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,11 @@ sub do_plugin_jit_mfa {
main_exit(OVH::Bastion::EXIT_NO_HOST, 'no_host', "A host is required for this plugin but none was specified");
}

# if $ip is undef it's because $host didn't resolve, exit
if (!$ip) {
main_exit OVH::Bastion::EXIT_HOST_NOT_FOUND, 'host_not_found', "Unable to resolve host '$host'";
}

# if no user yet, fix it to remote user
# we need it to be able to get the proper answer for is_access_granted, and we need to
# call is_access_granted so that we know whether we need to trigger JIT MFA for this
Expand Down

0 comments on commit 28a02d5

Please sign in to comment.