Subject: | Bug in _is_fh of File::ExtAttr |
Date: | Fri, 28 Jan 2011 08:17:10 +0100 |
To: | <bug-File-ExtAttr [...] rt.cpan.org> |
From: | Stefan Walter <stefan.walter [...] inf.ethz.ch> |
Hi!
I am using File::ExtAttr to read and write SELinux attributes. In my application
I get stray messages like this:
Can't call method "isa" without a package or object reference at /usr/lib/perl5/vendor_perl/File/ExtAttr.pm line 206.
I am using file names instead of File::IO objects and there seems to be a problem in the detection function _is_fh.
I cannot provide a simple reproducer - If I just run something like
getfattr("/etc", "selinux", { namespace => "security" } );
in a simple script, it remains silent. I guess it is one of the many other CPAN modules I use that changes the behavior.
The fix I found (which seems right to me) is to add
local $SIG{'__DIE__'};
as the first line in the eval block in _is_fh. You may want to add that in your code.
Thanks and best regards,
Stefan
--
ETH Zürich, Stefan Walter, IT Service Group
CAB E 44.2, Universitätsstrasse 6, CH-8092 Zürich
Tel +41 44 632 82 15