Sophie

Sophie

distrib > Mageia > 9 > armv7hl > media > core-release-src > by-pkgid > 3e45031211c8302a680650a6bc0e2bf7 > files > 1

perl-App-ClusterSSH-4.160.0-3.mga9.src.rpm

From 5eae528662318193cf51856362b5b6c01a376638 Mon Sep 17 00:00:00 2001
From: tony mancill <tmancill@debian.org>
Date: Wed, 4 Jan 2023 21:23:35 -0800
Subject: [PATCH 1/2] Don't try to open a directory as the config file

This patches load_configs() to check that the $config being opened is
actually a file and not a directory, which was tripping up the tests
that assert that there is an error when the config file cannot be
written because a directory already exists.

Until recently, the attempt to read the directory as a file was being
silently ignored due to a latent bug in Perl; more about that here:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1016369

and

  https://github.com/Perl/perl5/pull/20103

This addresses a bug filed against the Debian package for clusterssh
when t/15config.t tests started failing after the Perl bug was fixed.

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1026735
---
 lib/App/ClusterSSH/Config.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/App/ClusterSSH/Config.pm b/lib/App/ClusterSSH/Config.pm
index 75fd04d..f66b2d4 100644
--- a/lib/App/ClusterSSH/Config.pm
+++ b/lib/App/ClusterSSH/Config.pm
@@ -314,7 +314,7 @@ sub load_configs {
         $ENV{HOME} . '/.clusterssh/config',
         )
     {
-        $self->parse_config_file($config) if ( -e $config );
+        $self->parse_config_file($config) if ( -e $config && ! -d _ );
     }
 
     # write out default config file if necesasry
@@ -329,10 +329,10 @@ sub load_configs {
     # relative to config directory
     for my $config (@configs) {
         next unless ($config);    # can be null when passed from Getopt::Long
-        $self->parse_config_file($config) if ( -e $config );
+        $self->parse_config_file($config) if ( -e $config && ! -d _ );
 
         my $file = $ENV{HOME} . '/.clusterssh/config_' . $config;
-        $self->parse_config_file($file) if ( -e $file );
+        $self->parse_config_file($file) if ( -e $file && ! -d _ );
     }
 
     return $self;

From cffe20e5ae22496c52bf827578f82ec2a79dac20 Mon Sep 17 00:00:00 2001
From: tony mancill <tmancill@debian.org>
Date: Wed, 4 Jan 2023 22:01:42 -0800
Subject: [PATCH 2/2] Update t/15config.t test note to differentiate from
 another test

---
 t/15config.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/15config.t b/t/15config.t
index db086c9..775a2d7 100644
--- a/t/15config.t
+++ b/t/15config.t
@@ -535,7 +535,7 @@ SKIP: {
     chmod( 0755, $ENV{HOME} . '/.csshrc.DISABLED', $ENV{HOME} );
 }
 
-note('check failure to write default config is caught');
+note('check failure to write default config is caught when loading config');
 $ENV{HOME} = tempdir( CLEANUP => 1 );
 mkdir( $ENV{HOME} . '/.clusterssh' );
 mkdir( $ENV{HOME} . '/.clusterssh/config' );