complain if files are outside $base
[id3fs.git] / bin / id3fs-index
index 132d81e..93a6ebf 100755 (executable)
@@ -48,12 +48,17 @@ if($list)
 else
 {
     $db->last_update(time());
-
-    my $directories_pruned=$db->prune_directories();
+    my $base=$db->base_dir();
+    my $abs_base=Cwd::abs_path($base);
     while(my $path=shift)
     {
+       if(Cwd::abs_path($path) !~ /^$abs_base/)
+       {
+           print "$me, $path is outside $base, skipping\n";
+       }
        File::Find::find( {wanted => \&wanted, follow => 1, no_chdir => 1}, $path);
     }
+    my $directories_pruned=$db->prune_directories();
     if($files_pruned || $directories_pruned)
     {
        print "Removing data from pruned files\n" if $verbose;