Recent CentOS 5.7 perl update broke sa-update

 Posted by at 12:27 am  Fix, Programming  Comments Off on Recent CentOS 5.7 perl update broke sa-update
Feb 092012
 

I recently noticed that a Perl update on my CentOS 5.7 servers broke the sa-update script for Spamassassin 3.3.1 2.el5.  The error trace given was:

"name2labels" is not exported by the Net::DNS module
Can't continue after import errors at /usr/lib/perl5/vendor_perl/5.8.8/Net/DNS/RR/NSEC3.pm line 24
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Net/DNS/RR/NSEC3.pm line 24.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS/RR.pm line 172.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS/RR.pm line 185.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS/Packet.pm line 16.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS/Packet.pm line 16.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS/Resolver/Base.pm line 26.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS/Resolver/Base.pm line 26.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS/Resolver/UNIX.pm line 9.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS/Resolver/UNIX.pm line 9.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS/Resolver.pm line 19.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS/Resolver.pm line 22.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS.pm line 67.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS.pm line 67.
Compilation failed in require at /usr/bin/sa-update line 80.
BEGIN failed--compilation aborted at /usr/bin/sa-update line 80.

Searching Google seems to suggest that this is caused by a security update by RedHat to the perl-Net-DNS that ships as part of RedHat EL 5.7, which CentOS 5.7 is derived from.  I did try updating the Perl Net::DNS module via cpan but this did not fix the issue.

Though I’m not a big Perl programmer I decided to have a look at the sa-update script to see if I could fix it myself.  So what I decided to do was replace line 24 in NSEC3.pm.

Old line:

use Net::DNS qw( name2labels );

New line:

use Net::DNS;

So now sa-update -v displays:

Update available for channel updates.spamassassin.org
Update was available, and was downloaded and installed successfully

I know this is probably not the best fix to apply for the given problem, but it does fix my problem for now.  Hopefully others will find this useful.