Skip to content

Commit fc59cb9

Browse files
committed
avoid slurping with <> during compile time
1 parent 9663d7f commit fc59cb9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/Rex/Config.pm

+10-2
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,11 @@ sub read_config_file {
17391739
$config_file ||= _home_dir() . "/.rex/config.yml";
17401740

17411741
if ( -f $config_file ) {
1742-
my $yaml = eval { local ( @ARGV, $/ ) = ($config_file); <>; };
1742+
my $yaml = do {
1743+
use IO::File;
1744+
my $fh = IO::File->new( $config_file, 'r' );
1745+
join '', $fh->getlines();
1746+
};
17431747
eval { $HOME_CONFIG_YAML = Load($yaml); };
17441748

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

17641768
if ( -f $config_file ) {
1765-
my @lines = eval { local (@ARGV) = ($config_file); <>; };
1769+
my @lines = do {
1770+
use IO::File;
1771+
my $fh = IO::File->new( $config_file, 'r' );
1772+
join '', $fh->getlines();
1773+
};
17661774
%SSH_CONFIG_FOR = _parse_ssh_config(@lines);
17671775
}
17681776
}

0 commit comments

Comments
 (0)