Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 162303 - Installation of perl module Archive::Zip fails - Read only directory being written too
Summary: Installation of perl module Archive::Zip fails - Read only directory being wr...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-Archive-Zip
Version: 4
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Warren Togami
QA Contact:
URL: http://www.perlmonks.com/?node_id=471824
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-07-02 03:44 UTC by Adam
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-07-02 08:27:39 UTC


Attachments (Terms of Use)

Description Adam 2005-07-02 03:44:41 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1

Description of problem:
When installing Archive::Zip from cpan, the "make test" fails.  It fails the test when it sets the ziptest directory to read-only yet Archive::Zip seems to still be able to create a temporary file.  So it looks like fedora is allowing a directory set to read only, be written to.

Here is the code of the 'test' it's failing, allowing you to write to a read-only directory:
Archive::Zip::setErrorHandler( \&error );
ok(mkdir('ziptest'), "Create ziptemp directory");
ok(-d 'ziptest', "Does ./ziptest exist");
ok(chmod(0400, 'ziptest'), "chmod ziptemp directory");
my $fh1;
my $name3;
eval { ($fh1, $name3) = Archive::Zip::tempFile("ziptest"); };
ok($@, "Test that tempfile() failed");
is($fh1, undef, "Test correct returns from failed tempFile call" );
is($name3, undef, "Test correct returns from failed tempFile call");
ok(chmod(0700, 'ziptest'), "chmod ziptemp directory to cleanup");
is(rmdir('ziptest'), 1, "Remove ziptemp") || diag $!; 
ok(! -d 'ziptest', "Was ziptest deleted?");


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Enter CPAN ">cpan"
2. Type "install Archive::Zip"
3. Watch the test part fail.
  

Actual Results:  cpan> test Archive::Zip
Running test for module Archive::Zip
Running make for S/SM/SMPETERS/Archive-Zip-1.15.tar.gz
  Is already unwrapped into directory /root/.cpan/build/Archive-Zip-1.15
  Has already been processed within this session
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00.load...........ok 2/2# Testing Archive::Zip 1.15, Perl 5.008006, /usr/bin/perl
t/00.load...........ok
t/pod...............ok
t/test..............ok
t/testex............ok
t/testMemberRead....ok
t/testTree..........ok
t/testUpdate........ok
t/za_archive_zip....NOK 12#     Failed test (t/za_archive_zip.t at line 36)
t/za_archive_zip....NOK 15#     Failed test (t/za_archive_zip.t at line 42)
t/za_archive_zip....NOK 16#     Failed test (t/za_archive_zip.t at line 43)
#          got: 'IO::File=GLOB(0x8af4114)'
#     expected: undef
t/za_archive_zip....NOK 17#     Failed test (t/za_archive_zip.t at line 44)
#          got: 'ziptest/XEPEntCx6a.zip'
#     expected: undef
t/za_archive_zip....NOK 19#     Failed test (t/za_archive_zip.t at line 46)
#          got: '0'
#     expected: '1'
# Directory not empty
t/za_archive_zip....NOK 20#     Failed test (t/za_archive_zip.t at line 47)
t/za_archive_zip....ok 22/0# Looks like you failed 6 tests of 22.
t/za_archive_zip....dubious
        Test returned status 6 (wstat 1536, 0x600)
DIED. FAILED tests 12, 15-17, 19-20
        Failed 6/22 tests, 72.73% okay
Failed Test        Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/za_archive_zip.t    6  1536    22    6  27.27%  12 15-17 19-20
Failed 1/8 test scripts, 87.50% okay. 6/195 subtests failed, 96.92% okay.
make: *** [test_dynamic] Error 2
  /usr/bin/make test -- NOT OK

cpan>

Expected Results:  All tests should have passed

Additional info:

Comment 1 Warren Togami 2005-07-02 08:27:39 UTC
Fedora is not responsible for CPAN installations, which you use at your own
risk, so I have to mark this NOTABUG.  If you want Archive::Zip conveniently in
FC4, you could just run 'yum install perl-Archive-Zip'.  The package is a
standard component in Core.

Comment 2 Paul Howarth 2005-07-02 09:29:11 UTC
I suspect that the issue here is down to running "make test" as root anyway.
root can write to directories that don't have the write enable bit set. Try
building and testing the module as a regular user.

Comment 3 Jose Pedro Oliveira 2005-07-02 21:49:28 UTC
Adam,

The correct way to report problems in CPAN perl modules
is to use the CPAN bug reporting system which is
located at the following address:

  http://rt.cpan.org/


This particular problem has already been reported
upstream.  Please see:

  Bug #13426 make test fail in Archive::Zip 1.15 
  http://rt.cpan.org/NoAuth/Bug.html?id=13426


Additional info

* CPAN: Archive::Zip module page
  http://search.cpan.org/dist/Archive-Zip/

* Archive::Zip opened bugs
  http://rt.cpan.org/NoAuth/Bugs.html?Dist=Archive-Zip

  The opened bugs page can also be reached from the CPAN
  module page. Just follow the "View/Report Bugs" link:

     Links: [...] [...] [View/Report bugs] [...]


Regards,
jpo


[1] Unless stated otherwise by the module author/maintainer
    (the README file is a good place to start looking
     for this information)


Note You need to log in before you can comment on or make changes to this bug.