';
+ $question.= 'If \'yes\', please specify a path within the suexec path where Froxlor will create symlinks to customer perl-enabled paths:
';
+ $question.= 'Path for symlinks (must be within suexec path): ';
+ $question.= ' ';
+ eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
+ }
}
diff --git a/lib/tables.inc.php b/lib/tables.inc.php
index d68c10a4..420cd697 100644
--- a/lib/tables.inc.php
+++ b/lib/tables.inc.php
@@ -72,7 +72,7 @@ define('PACKAGE_ENABLED', 2);
// VERSION INFO
-$version = '0.9.12-svn1';
+$version = '0.9.12-svn2';
$dbversion = '2';
$branding = '';
diff --git a/lng/english.lng.php b/lng/english.lng.php
index fd6595f1..74dda352 100644
--- a/lng/english.lng.php
+++ b/lng/english.lng.php
@@ -1458,4 +1458,11 @@ $lng['serversettings']['mod_fcgid_ownvhost']['description'] = 'If enabled, Froxl
$lng['admin']['mod_fcgid_user'] = 'Local user to use for FCGID (Froxlor vhost)';
$lng['admin']['mod_fcgid_group'] = 'Local group to use for FCGID (Froxlor vhost)';
+// ADDED IN FROXLOR 0.9.12-svn2
+$lng['admin']['perl_settings'] = 'Perl/CGI';
+$lng['serversettings']['perl']['suexecworkaround']['title'] = 'Enable SuExec workaround (Apache only)';
+$lng['serversettings']['perl']['suexecworkaround']['description'] = 'Enable only if customer docroots are not within the apache suexec path. If enabled, Froxlor will generate a symlink from the customers perl-enabled directory + /cgi-bin/ to the given path. Note that perl will then only work in the folders subdirectory /cgi-bin/ and not in the folder itself (as it does without this fix!)';
+$lng['serversettings']['perl']['suexeccgipath']['title'] = 'Path for customer perl-enabled directory symlinks';
+$lng['serversettings']['perl']['suexeccgipath']['description'] = 'You only need to set this if the SuExec-workaround is enabled. ATTENTION: Be sure this path is within the suexec path or else this workaround is uselsess';
+
?>
diff --git a/lng/german.lng.php b/lng/german.lng.php
index 0d8e9c65..b63adc7f 100644
--- a/lng/german.lng.php
+++ b/lng/german.lng.php
@@ -1441,4 +1441,11 @@ $lng['serversettings']['mod_fcgid_ownvhost']['description'] = 'Wenn verwendet, w
$lng['admin']['mod_fcgid_user'] = 'Lokaler Benutzer für FCGID (Froxlor Vhost)';
$lng['admin']['mod_fcgid_group'] = 'Lokale Gruppe für FCGID (Froxlor Vhost)';
+// ADDED IN FROXLOR 0.9.12-svn2
+$lng['admin']['perl_settings'] = 'Perl/CGI';
+$lng['serversettings']['perl']['suexecworkaround']['title'] = 'Aktiviere SuExec Workaround (nur f&uumL,r Apache)';
+$lng['serversettings']['perl']['suexecworkaround']['description'] = 'Aktivieren Sie den Workaround nur, wenn die Kunden-Heimatverzeichnise sich nicht unterhalb des suexec-Pfades liegen. Wenn aktiviert erstellt Froxlor eine Verknüpfung des vom Kunden für Perl aktiviertem Pfad + /cgi-bin/ im angegebenen suexec-Pfad. Bitte beachten Sie, dass Perl dann nur im Unterordner /cgi-bin/ des Kunden-Ordners funktioniert und nicht direkt in diesem Ordner (wie es ohne den Workaround wäre!)';
+$lng['serversettings']['perl']['suexeccgipath']['title'] = 'Pfad für Verknüpfungen zu Kunden-Perl-Verzeichnis';
+$lng['serversettings']['perl']['suexeccgipath']['description'] = 'Diese Einstellung wird nur benötigt, wenn der SuExec-Workaround aktiviert ist. ACHTUNG: Stellen Sie sicher, dass sich der angegebene Pfad innerhalb des Suexec-Pfades befindet ansonsten ist der Workaround nutzlos';
+
?>
diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php
index 68b52b49..bfe23278 100644
--- a/scripts/jobs/cron_tasks.inc.http.10.apache.php
+++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php
@@ -896,6 +896,51 @@ class apache
$this->diroptions_data[$diroptions_filename].= ' Order allow,deny' . "\n";
$this->diroptions_data[$diroptions_filename].= ' Allow from all' . "\n";
fwrite($this->debugHandler, ' cron_tasks: Task3 - Enabling perl execution' . "\n");
+
+ // check for suexec-workaround, #319
+ if((int)$this->settings['perl']['suexecworkaround'] == 1)
+ {
+ // symlink this directory to suexec-safe-path
+ $loginname = getCustomerDetail($row_diroptions['customerid'], 'loginname');
+ $suexecpath = makeCorrectDir($this->settings['perl']['suexecpath'].'/'.$loginname.'/'.md5($row_diroptions['path']).'/');
+
+ if(!file_exists($suexecpath))
+ {
+ safe_exec('mkdir -p '.escapeshellarg($suexecpath));
+ safe_exec('chown -R '.escapeshellarg($row_diroptions['guid']).':'.escapeshellarg($row_diroptions['guid']).' '.escapeshellarg($suexecpath));
+ }
+
+ // symlink to {$givenpath}/cgi-bin
+ // NOTE: symlinks are FILES, so do not append a / here
+ $perlsymlink = makeCorrectFile($row_diroptions['path'].'/cgi-bin');
+ if(!file_exists($perlsymlink))
+ {
+ safe_exec('ln -s '.escapeshellarg($suexecpath).' '.escapeshellarg($perlsymlink));
+ }
+ safe_exec('chown '.escapeshellarg($row_diroptions['guid']).':'.escapeshellarg($row_diroptions['guid']).' '.escapeshellarg($perlsymlink));
+ }
+ }
+ else
+ {
+ // if no perl-execution is enabled but the workaround is,
+ // we have to remove the symlink and folder in suexecpath
+ if((int)$this->settings['perl']['suexecworkaround'] == 1)
+ {
+ $loginname = getCustomerDetail($row_diroptions['customerid'], 'loginname');
+ $suexecpath = makeCorrectDir($this->settings['perl']['suexecpath'].'/'.$loginname.'/'.md5($row_diroptions['path']).'/');
+ $perlsymlink = makeCorrectFile($row_diroptions['path'].'/cgi-bin');
+
+ // remove symlink
+ if(file_exists($perlsymlink))
+ {
+ safe_exec('rm -f '.escapeshellarg($perlsymlink));
+ }
+ // remove folder in suexec-path
+ if(file_exists($suexecpath))
+ {
+ safe_exec('rm -rf '.escapeshellarg($suexecpath));
+ }
+ }
}
if(count($row_diroptions['htpasswds']) > 0)