- added possibility to run perl-scripts (if allowed by admin) via directory-options

- for use in lighttpd you have to add "mod_cgi" to the modules-list (and maybe patch lighttpd-cron if perl is not installed in /usr/bin)
This commit is contained in:
Michael Kaufmann (d00p)
2010-07-22 06:02:38 +00:00
parent edc7a91519
commit d1d772f790
21 changed files with 209 additions and 16 deletions

View File

@@ -531,6 +531,22 @@ class lighttpd
{
$path_options = $error_string;
}
if(customerHasPerlEnabled($domain['customerid'])
&& $row['options_cgi'] != '0')
{
$path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
// We need to remove the last slash, otherwise the regex wouldn't work
$path = substr($path, 0, -1);
$path_options.= ' $HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n";
$path_options.= "\t" . 'cgi.assign = (' . "\n";
$path_options.= "\t\t" . '".pl" => "/usr/bin/perl",' . "\n";
$path_options.= "\t\t" . '".cgi" => "/usr/bin/perl"' . "\n";
$path_options.= "\t" . ')' . "\n";
$path_options.= ' }' . "\n\n";
}
}
return $path_options;