PaulHowarth/Blog/2013-09-20

Friday 20th September 2013

Local Packages

  • Updated davfs2 to fix possibly insecure use of system() (CVE-2013-4362)

  • Updated perl-File-ShareDir-ProjectDistDir (version 0.4.4, as used for all releases prior to Fedora 19 as later versions' dependencies can't be satisfied on earlier Fedoras or RHEL without replacing modules bundled with the main perl package) to fix a problem that would manifest when it was used on Fedora 12 or earlier, e.g. when running File::pushd's author tests with Pod::Spell 1.07 (which has its own issues):

  • $ make test TEST_FILES="$(echo $(find xt/ -name '*.t'))"
    PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" xt/release/test-version.t xt/release/portability.t xt/release/pod-syntax.t xt/release/pod-coverage.t xt/release/minimum-version.t xt/release/distmeta.t xt/author/pod-spell.t xt/author/critic.t
    xt/author/critic..............Couldn't require Perl::Critic::Policy::Documentation::PodSpelling : Can't call method "stringify" on an undefined value at /usr/lib/perl5/vendor_perl/5.8.5/File/ShareDir/ProjectDistDir.pm line 206.
    Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.5/Pod/Spell.pm line 10.
    BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.5/Pod/Spell.pm line 10.
    Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/Policy/Documentation/PodSpelling.pm line 21.
    BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/Policy/Documentation/PodSpelling.pm line 21.
    Compilation failed in require at (eval 89) line 3.
     at /usr/lib/perl5/vendor_perl/5.8.5/Module/Pluggable.pm line 32
    #     Failed test (/usr/lib/perl5/vendor_perl/5.8.5/Test/Perl/Critic.pm at line 110)
    # 
    # Perl::Critic had errors in "blib/lib/File/pushd.pm":
    #       Exception::Fatal::PolicyDefinition: A bug in a policy was found.
    # 
    # Unable to create policy "Perl::Critic::Policy::Documentation::PodSpelling": Can't locate object method "new" via package "Perl::Critic::Policy::Documentation::PodSpelling" at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/PolicyFactory.pm line 260.
    # 
    # 
    # Fri Sep 20 15:12:31 2013
    # 
    # Trace begun at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/PolicyFactory.pm line 289
    # Perl::Critic::PolicyFactory::_handle_policy_instantiation_exception('Perl::Critic::Policy::Documentation::PodSpelling', undef, 'Can\'t locate object method "new" via package "Perl::Critic::Policy::Documentation::PodSpelling" at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/PolicyFactory.pm line 260.^J') called at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/PolicyFactory.pm line 261
    # Perl::Critic::PolicyFactory::_instantiate_policy('Perl::Critic::PolicyFactory=HASH(0x9b9525c)', 'Perl::Critic::Policy::Documentation::PodSpelling', 'Perl::Critic::PolicyConfig=HASH(0xb1fdb30)') called at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/PolicyFactory.pm line 204
    # Perl::Critic::PolicyFactory::create_policy('Perl::Critic::PolicyFactory=HASH(0x9b9525c)', '-name', 'Perl::Critic::Policy::Documentation::PodSpelling') called at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/PolicyFactory.pm line 220
    # eval {...} at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/PolicyFactory.pm line 220
    # Perl::Critic::PolicyFactory::create_all_policies('Perl::Critic::PolicyFactory=HASH(0x9b9525c)', 'Perl::Critic::Exception::AggregateConfiguration=HASH(0xb121f98)') called at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/Config.pm line 219
    # Perl::Critic::Config::_load_policies('Perl::Critic::Config=HASH(0xb128c78)', 'Perl::Critic::Exception::AggregateConfiguration=HASH(0xb121f98)') called at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/Config.pm line 150
    # Perl::Critic::Config::_init('Perl::Critic::Config=HASH(0xb128c78)', '-profile', 'perlcritic.rc') called at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic/Config.pm line 52
    # Perl::Critic::Config::new('Perl::Critic::Config', '-profile', 'perlcritic.rc') called at /usr/lib/perl5/vendor_perl/5.8.5/Perl/Critic.pm line 42
    # Perl::Critic::new('Perl::Critic', '-profile', 'perlcritic.rc') called at /usr/lib/perl5/vendor_perl/5.8.5/Test/Perl/Critic.pm line 71
    # eval {...} at /usr/lib/perl5/vendor_perl/5.8.5/Test/Perl/Critic.pm line 69
    # Test::Perl::Critic::critic_ok('blib/lib/File/pushd.pm') called at /usr/lib/perl5/vendor_perl/5.8.5/Test/Perl/Critic.pm line 110
    # Test::Perl::Critic::all_critic_ok at xt/author/critic.t line 12
    # Looks like you failed 1 tests of 1.
    dubious
            Test returned status 1 (wstat 256, 0x100)
    DIED. FAILED test 1
            Failed 1/1 tests, 0.00% okay
    xt/author/pod-spell...........Can't call method "stringify" on an undefined value at /usr/lib/perl5/vendor_perl/5.8.5/File/ShareDir/ProjectDistDir.pm line 206.
    Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.5/Pod/Spell.pm line 10.
    BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.5/Pod/Spell.pm line 10.
    Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.5/Test/Spelling.pm line 7.
    BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.5/Test/Spelling.pm line 7.
    Compilation failed in require at (eval 1) line 1.
    BEGIN failed--compilation aborted at (eval 1) line 1.
    # Looks like your test died before it could output anything.
    dubious
            Test returned status 2 (wstat 512, 0x200)
    xt/release/distmeta...........ok
    xt/release/minimum-version....ok
    xt/release/pod-coverage.......ok
    xt/release/pod-syntax.........ok
    xt/release/portability........ok
    xt/release/test-version.......ok
    Failed 2/8 test scripts, 75.00% okay. 1/14 subtests failed, 92.86% okay.
    Failed Test           Stat Wstat Total Fail  Failed  List of Failed
    -------------------------------------------------------------------------------
    xt/author/critic.t       1   256     1    1 100.00%  1
    xt/author/pod-spell.t    2   512    ??   ??       %  ??
  • This turned out to be due to the Perl vendor install directory being under /usr/lib in Fedora 12 and earlier, and /usr/share thereafter. File::ShareDir::ProjectDistDir searched upwards from the /usr/lib/perl5/vendor_perl/5.8.5/Pod/ directory and found a lib directory parallel to a share directory under /usr and presumed that this was a "development" environment and that Pod::Spell's word list should be under /usr/share whereas it was actually installed at /usr/lib/perl5/vendor_perl/5.8.5/auto/share/dist/Pod-Spell/wordlist. To fix this, I used this patch to add a further heuristic that any path under /usr was a production environment:

  • Add heuristic: any path under /usr is a production path
    
    --- lib/File/ShareDir/ProjectDistDir.pm
    +++ lib/File/ShareDir/ProjectDistDir.pm
    @@ -94,6 +94,10 @@
       my $root = File::Spec->rootdir();
     
       _debug( 'Working on: ' . $filename );
    +  if ( $dir->dir_list(1) eq 'usr' ) {
    +    _debug('ISPROD: In /usr hierarchy');
    +    return;
    +  }
       _debug('Trying to find parent \'lib\'');
       ## no critic ( ProhibitMagicNumbers )
       while (1) {
  • And the result:
  • $ make test TEST_FILES="$(echo $(find xt/ -name '*.t'))"
    PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" xt/release/test-version.t xt/release/portability.t xt/release/pod-syntax.t xt/release/pod-coverage.t xt/release/minimum-version.t xt/release/distmeta.t xt/author/pod-spell.t xt/author/critic.t
    xt/author/critic..............ok
    xt/author/pod-spell...........ok
    xt/release/distmeta...........ok
    xt/release/minimum-version....ok
    xt/release/pod-coverage.......ok
    xt/release/pod-syntax.........ok
    xt/release/portability........ok
    xt/release/test-version.......ok
    All tests successful.
    Files=8, Tests=15,  5 wallclock secs ( 3.57 cusr +  0.60 csys =  4.17 CPU)
  • Looking at the code, I don't think File::ShareDir::ProjectDistDir 0.5.x would have been affected by this issue if I'd been able to install it.

  • Updated perl-Module-CoreList to 2.99:

    • Updated for v5.19.4
    • Fixed Module::Build core deprecation

    • changes_between now has the same API as all other functions

    • Added is_core(), which returns true if a module is/was core in a specific version of Perl; can optionally specify minimum version of the module


Recent