#856504 perl: should skip @INC paths with unsufficient permission

Package:
perl
Source:
perl
Description:
Larry Wall's Practical Extraction and Report Language
Submitter:
Bill Allombert
Date:
2020-11-14 23:24:02 UTC
Severity:
normal
#856504#5
Date:
2017-03-01 18:45:08 UTC
From:
To:
Package: perl
Version: 5.20.2-3+deb8u6
Severity: normal

Dear perl maintainers,

The following sequence gives:

% sudo chmod o-x /usr/local/lib

% perl -e "print join(' ',@INC);"
/etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2
/usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20
/usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20
/usr/share/perl/5.20 /usr/local/lib/site_perl .

% perl -e 'use strict;'
Can't locate strict.pm:
/usr/local/lib/x86_64-linux-gnu/perl/5.20.2/strict.pm: Permission denied
at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

I think it would be more useful to skip
/usr/local/lib/x86_64-linux-gnu/perl/5.20.2/
and proceed with the next directory, rather than fail.

See bug #855617 for reference.

Cheers,

#856504#10
Date:
2017-03-01 18:56:57 UTC
From:
To:
(Niko and Dom know more about this but for a starter:)

This was a deliberate upstream change made in 2012 and released in
2013 with the 5.18 release:

https://metacpan.org/pod/release/RJBS/perl-5.18.0/pod/perldelta.pod#require-dies-for-unreadable-files

  require dies for unreadable files

  When require encounters an unreadable file, it now dies. It used to
  ignore the file and continue searching the directories in @INC
  [perl #113422].

The referenced upstream bug is
https://rt.perl.org/Public/Bug/Display.html?id=113422


Cheers,
gregor

#856504#15
Date:
2017-03-01 19:11:38 UTC
From:
To:
This is a bit different. In my case,
/usr/local/lib/x86_64-linux-gnu/perl/5.20.2/strict.pm
does not exist at all.

A consequence of this is that it is only possible to add a directory to
the global @INC if it is world-accessible, which is a major interface
change.

Cheers,

#856504#20
Date:
2017-03-02 08:58:53 UTC
From:
To:
Sure; it's still the same commit that caused it.

#781120 is related fwiw.

Then there's https://rt.perl.org/Public/Bug/Display.html?id=123795 which
seems to match this bug.

No strong opinion about this on my part except that I'd of course want
to see it fixed upstream rather than deviate in Debian. I suppose
patches are welcome upstream.