From: Raphael Hertzog Date: Fri, 3 Aug 2007 14:26:46 +0000 (+0200) Subject: Avoid failing on invalid symlinks looking like a library. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a44fac4b6c1678949d967edb4dfbecf9775159f;p=dpkg Avoid failing on invalid symlinks looking like a library. Do this by adding a check to restrict the scan to plain files only. --- diff --git a/scripts/dpkg-gensymbols.pl b/scripts/dpkg-gensymbols.pl index 321def83..6173ce26 100755 --- a/scripts/dpkg-gensymbols.pl +++ b/scripts/dpkg-gensymbols.pl @@ -148,7 +148,7 @@ if (not scalar @files) { opendir(DIR, "$libdir") || syserr(sprintf(_g("Can't read directory %s: %s"), $libdir, $!)); push @files, grep { - /(\.so\.|\.so$)/ && + /(\.so\.|\.so$)/ && -f $_ && Dpkg::Shlibs::Objdump::is_elf($_); } map { "$libdir/$_" } readdir(DIR); close(DIR); @@ -160,7 +160,7 @@ my $od = Dpkg::Shlibs::Objdump->new(); foreach my $file (@files) { print "Scanning $file for symbol information\n" if $debug; my $objid = $od->parse($file); - unless (defined($objid)) { + unless (defined($objid) && $objid) { warning(sprintf(_g("Objdump couldn't parse %s\n"), $file)); next; }