/usr/share/perl5/Archive/Peek/Zip.pm is in libarchive-peek-perl 0.35-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | package Archive::Peek::Zip;
use Moose;
use Archive::Zip qw(AZ_OK);
use Archive::Zip::MemberRead;
extends 'Archive::Peek';
sub zip {
my $self = shift;
my $filename = $self->filename;
my $zip = Archive::Zip->new();
unless ( $zip->read( $filename->stringify ) == AZ_OK ) {
confess("Error reading $filename");
}
return $zip;
}
sub files {
my $self = shift;
my $zip = $self->zip;
my @members = $zip->members();
my @files = sort map { $_->fileName } grep { !$_->isDirectory } @members;
return @files;
}
sub file {
my ( $self, $filename ) = @_;
my $zip = $self->zip;
my $fh = Archive::Zip::MemberRead->new( $zip, $filename );
my $file = '';
while (1) {
my $read = $fh->read( my $buffer, 1024 );
die "FATAL ERROR reading my secrets !\n" if ( !defined($read) );
last if ( !$read );
$file .= $buffer;
}
return $file;
}
1;
|