Sudden death of PDF::API2

2009-02-15 Thread Alan Fry
I have an Intel MacPro running Mac OS X 10.5.6 (Perl 5.8.8) and a copy  
of PDF::API2. This has worked flawlessly for a long time.


Suddenly it has failed. There have been no changes at all to the  
machine apart from a recent 'Security Update', which I think had to do  
mostly with a loophole in Safari.


This minimal script:

my $pdf_in = PDF::API2-open($file_in) or die $!\n;
my $pdf_out = PDF::API2-new or die $!\n;

$page = $pdf_out-page;
$page-mediabox(595, 842);
$gfx = $page-gfx;
#$xo = $pdf_out-importPageIntoForm($pdf_in, 1);
#$gfx-formimage($xo, 0, 0, 1);

fails with the error message:

Undefined subroutine Compress::Zlib::compress called at /Library/Perl/ 
5.8.8/PDF/API2/Content.pm line 103.


However the folder 'Compress' is there, (alongside the folder  
'PDFwhich contains the module), the file 'Zlib' in that folder, and  
Zlib has a subroutine named 'compress'. So what can possibly have gone  
wrong here?


If the last two lines above are uncommented, the error message becomes:

Can't call method infilt on an undefined value at /Library/Perl/ 
5.8.8/PDF/API2/Util.pm line 667.


presumably as a result of failure to access Zlib subroutines?

I have run 'repair permissions' which has not altered the situation  
and run out of ideas of what to do next.


I would be most grateful if anyone could help.

Alan Fry

Re: Sudden death of PDF::API2

2009-02-15 Thread Landry Le Chevanton
I did also had problems with perl scripts after installing the security
patch. Strategy for fixing has been worked out and reported here:

http://bulknews.typepad.com/blog/2009/02/mac-os-x-security-update-2009001-br
eaks-perl-cpan.html

As well as in Apple forum
http://discussions.apple.com/thread.jspa?threadID=1905157tstart=0

This recipe worked for me so far.

Landry


Le 15/02/09 12:10, « Alan Fry » a...@afco.demon.co.uk a écrit :

 I have an Intel MacPro running Mac OS X 10.5.6 (Perl 5.8.8) and a copy
 of PDF::API2. This has worked flawlessly for a long time.
 
 Suddenly it has failed. There have been no changes at all to the
 machine apart from a recent 'Security Update', which I think had to do
 mostly with a loophole in Safari.
 
 This minimal script:
 
 my $pdf_in = PDF::API2-open($file_in) or die $!\n;
 my $pdf_out = PDF::API2-new or die $!\n;
 
 $page = $pdf_out-page;
 $page-mediabox(595, 842);
 $gfx = $page-gfx;
 #$xo = $pdf_out-importPageIntoForm($pdf_in, 1);
 #$gfx-formimage($xo, 0, 0, 1);
 
 fails with the error message:
 
 Undefined subroutine Compress::Zlib::compress called at /Library/Perl/
 5.8.8/PDF/API2/Content.pm line 103.
 
 However the folder 'Compress' is there, (alongside the folder
 'PDFwhich contains the module), the file 'Zlib' in that folder, and
 Zlib has a subroutine named 'compress'. So what can possibly have gone
 wrong here?
 
 If the last two lines above are uncommented, the error message becomes:
 
 Can't call method infilt on an undefined value at /Library/Perl/
 5.8.8/PDF/API2/Util.pm line 667.
 
 presumably as a result of failure to access Zlib subroutines?
 
 I have run 'repair permissions' which has not altered the situation
 and run out of ideas of what to do next.
 
 I would be most grateful if anyone could help.
 
 Alan Fry





Re: Sudden death of PDF::API2

2009-02-15 Thread Daniel Staal
--As of February 15, 2009 11:10:33 AM +, Alan Fry is alleged to have 
said:



I have an Intel MacPro running Mac OS X 10.5.6 (Perl 5.8.8) and a copy of
PDF::API2. This has worked flawlessly for a long time.

Suddenly it has failed. There have been no changes at all to the machine
apart from a recent 'Security Update', which I think had to do mostly
with a loophole in Safari.


--As for the rest, it is mine.


From the notes on the recent Security Update:



perl
CVE-ID:  CVE-2008-1927
Available for:  Mac OS X v10.4.11, Mac OS X Server v10.4.11,
Mac OS X v10.5.6, Mac OS X Server v10.5.6
Impact:  Using regular expressions containing UTF-8 characters may
lead to an unexpected application termination or arbitrary code
execution
Description:  A memory corruption issue exists in the handling of
certain UTF-8 characters in regular expressions. Parsing maliciously
crafted regular expressions may lead to an unexpected application
termination or arbitrary code execution. This update addresses the
issue by performing additional validation of regular expressions.


So, they definitely updated Perl.  Likely any/all XS modules will need to 
be recompiled.  I'd _hope_ that Apple updated the ones they shipped, but 
you'll still have to update any you've installed yourself.


(I haven't gotten around to installing the update myself yet...)

Daniel T. Staal

---
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---