Subject: | Conflict with Log::WarnDie |
Hi,
While using Log::WarnDie (Log-WarnDie-0.05) with Net::SFTP::Foreign (Net-
SFTP-Foreign-1.60), the backend cannot connect to the SSH client process
via IPC due to the strong *STDERR tie applied before globally by
Log::WarnDie.
The solution is very simple, see the attached diff which I've made against
the latest 1.60 release. You have to untie *STDERR before trying to use
IPC's open2() or open3().
Please apply this patch to the trunk.
Regards,
Barnabas (BSi) Bona
bsi@hosember.hu
Subject: | log_warndie_bug.diff |
diff -u -r a/lib/Net/SFTP/Foreign/Backend/Unix.pm b/lib/Net/SFTP/Foreign/Backend/Unix.pm
--- a/lib/Net/SFTP/Foreign/Backend/Unix.pm 2010-09-29 09:17:22.004245800 +0200
+++ b/lib/Net/SFTP/Foreign/Backend/Unix.pm 2010-09-29 13:39:17.517121800 +0200
@@ -61,11 +61,11 @@
return undef;
}
local ($@, $SIG{__DIE__}, $SIG{__WARN__});
- return eval { open3(@_[1,0], ">&SSHERR", @_[3..$#_]) }
+ return eval { untie *STDERR; open3(@_[1,0], ">&SSHERR", @_[3..$#_]) }
}
else {
local ($@, $SIG{__DIE__}, $SIG{__WARN__});
- return eval { open2(@_[0,1], @_[3..$#_]) };
+ return eval { untie *STDERR; open2(@_[0,1], @_[3..$#_]) };
}
}