Skip to content

Commit

Permalink
Avoid slurping with <> during compile time
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurp committed Mar 15, 2023
1 parent 9663d7f commit 037b3bb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/Rex/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,11 @@ sub read_config_file {
$config_file ||= _home_dir() . "/.rex/config.yml";

if ( -f $config_file ) {
my $yaml = eval { local ( @ARGV, $/ ) = ($config_file); <>; };
my $yaml = do {
use IO::File;
my $fh = IO::File->new( $config_file, 'r' );
join '', $fh->getlines();
};
eval { $HOME_CONFIG_YAML = Load($yaml); };

if ($@) {
Expand All @@ -1762,7 +1766,11 @@ sub read_ssh_config_file {
$config_file ||= _home_dir() . '/.ssh/config';

if ( -f $config_file ) {
my @lines = eval { local (@ARGV) = ($config_file); <>; };
my @lines = do {
use IO::File;
my $fh = IO::File->new( $config_file, 'r' );
join '', $fh->getlines();
};
%SSH_CONFIG_FOR = _parse_ssh_config(@lines);
}
}
Expand Down

0 comments on commit 037b3bb

Please sign in to comment.