[interchange-bugs] [rt.icdevgroup.org #318] TemplateDir in catalog.cfg

Gert van der Spoel via RT interchange at rt.icdevgroup.org
Tue Nov 2 10:15:28 UTC 2010


<URL: http://rt.icdevgroup.org/Ticket/Display.html?id=318 >

Untested patch for lib/Vend/Config.pm   unless of course someone can explain why it should not be possible to have a whitespace separated list of paths in catalog.cfg for the TemplateDir directive, while it would be allowed in the interchange.cfg  ... 

diff --git a/lib/Vend/Config.pm b/lib/Vend/Config.pm
index 15fb857..a64564f 100644
--- a/lib/Vend/Config.pm
+++ b/lib/Vend/Config.pm
@@ -3918,19 +3918,25 @@ sub parse_root_dir_array {

 sub parse_dir_array {
        my($var, $value) = @_;
+        my $val;
        return [] unless $value;

-       unless (allowed_file($value)) {
-               config_error('Path %s not allowed in %s directive',
-                                         $value, $var);
-       }
-       $value = "$C->{VendRoot}/$value"
-               unless file_name_is_absolute($value);
-       $value =~ s./+$..;
-
+       no strict 'refs';
        $C->{$var} = [] unless $C->{$var};
        my $c = $C->{$var} || [];
-       push @$c, $value;
+
+       my @dirs = grep /\S/, Text::ParseWords::shellwords($value);
+
+       foreach my $dir (@dirs) {
+               unless (allowed_file($dir)) {
+                       config_error('Path %s not allowed in %s directive',
+                                         $dir, $var);
+               }
+               $val = "$C->{VendRoot}/$dir"
+                       unless file_name_is_absolute($val);
+               $val =~ s./+$..;
+               push @$c, $val;
+       }
        return $c;
 }




More information about the interchange-bugs mailing list