Update of /cvsroot/fink/fink/perlmod/Fink
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25442

Modified Files:
        ChangeLog Validation.pm 
Log Message:
Make sure .deb files are in allowed hierarchy, not just that they are not
in commonly-seen disallowed hierarchy.


Index: Validation.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Validation.pm,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- Validation.pm       27 Jul 2004 06:18:04 -0000      1.133
+++ Validation.pm       27 Jul 2004 06:44:32 -0000      1.134
@@ -795,6 +795,7 @@
        # these are used in a regex and are automatically prepended with ^
        # make sure to protect regex metachars!
        my @bad_dirs = ("$basepath/src/", "$basepath/man/", "$basepath/info/", 
"$basepath/doc/", "$basepath/libexec/", "$basepath/lib/locale/", ".*/CVS/", ".*/RCS/");
+       my @good_dirs = ( map "$basepath/$_", qw/ bin sbin include lib share var etc / 
);
 
        my ($pid, $bad_dir);
        my $filename;
@@ -815,7 +816,7 @@
                if 
(/([^\s]*)\s*([^\s]*)\s*([^\s]*)\s*([^\s]*)\s*([^\s]*)\s*\.([^\s]*)/) {
                        $filename = $6;
                        #print "$filename\n";
-                       next if $filename eq "/";
+                       next if "$basepath/" =~ /^\Q$filename\E/;  # skip parent 
components of basepath hierarchy
                        if (not $filename =~ /^$basepath/) {
                                if (not (($dpkg_filename =~ /xfree86[_\-]/) || 
($dpkg_filename =~ /xorg[_\-]/))) {
                                        print "Warning: File \"$filename\" installed 
outside of $basepath\n";
@@ -833,6 +834,10 @@
                                print "Warning: File installed into deprecated 
directory $bad_dir\n";
                                print "                                 Offender is 
$filename\n";
                                $looks_good = 0;
+                       } elsif (not grep { $filename =~ /^$_/ } @good_dirs) {
+                               # Directory from this list are the top-level dirs that 
may exist in the .deb.
+                               print "Warning: File \"$filename\" installed outside 
of allowable subdirectories of $basepath\n";
+                               $looks_good = 0;
                        } elsif ($filename 
=~/^($basepath\/lib\/perl5\/auto\/.*\.bundle)/ ) {
                                print "Warning: Apparent perl XS module installed 
directly into $basepath/lib/perl5 instead of a versioned subdirectory.\n  Offending 
file: $1\n";
                                $looks_good = 0;

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.672
retrieving revision 1.673
diff -u -d -r1.672 -r1.673
--- ChangeLog   27 Jul 2004 06:18:03 -0000      1.672
+++ ChangeLog   27 Jul 2004 06:44:32 -0000      1.673
@@ -1,5 +1,10 @@
 2004-07-27  Daniel Macks  <[EMAIL PROTECTED]>
 
+       * Validation.pm: Check that files are in allowed dirs of .deb,
+       not just not-in disallowed dirs.
+
+2004-07-27  Daniel Macks  <[EMAIL PROTECTED]>
+
        * Validation.pm: Move @bad_dirs check early so don't miss things
        that get special handling (but not validation) by other matches.
        Replace @bad_dirs explicit loop with grep {}.



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to