Skip to content

Commit 6fb6029

Browse files
committed
Added security level option to fcgi starter script.
1 parent abd9b23 commit 6fb6029

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

server/conf/php-fcgi-starter.master

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export PHP_FCGI_CHILDREN
88
PHP_FCGI_MAX_REQUESTS=<tmpl_var name='php_fcgi_max_requests'>
99
export PHP_FCGI_MAX_REQUESTS
1010
exec <tmpl_var name='php_fcgi_bin'> \
11-
-d open_basedir=<tmpl_var name='document_root'> \
11+
<tmpl_if name="security_level" op="==" value="20"> -d open_basedir=<tmpl_var name='document_root'> \
1212
-d upload_tmp_dir=<tmpl_var name='document_root'>/tmp \
1313
-d session.save_path=<tmpl_var name='document_root'>/tmp \
14-
$1
14+
</tmpl_if> $1

server/plugins-available/apache2_plugin.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ function update($event_name,$data) {
650650
$fcgi_tpl->setVar('php_fcgi_children',$fastcgi_config["fastcgi_children"]);
651651
$fcgi_tpl->setVar('php_fcgi_max_requests',$fastcgi_config["fastcgi_max_requests"]);
652652
$fcgi_tpl->setVar('php_fcgi_bin',$fastcgi_config["fastcgi_bin"]);
653+
$fcgi_tpl->setVar('security_level',$web_config["security_level"]);
653654

654655
$fcgi_starter_script = escapeshellcmd($fastcgi_starter_path.$fastcgi_config["fastcgi_starter_script"]);
655656
file_put_contents($fcgi_starter_script,$fcgi_tpl->grab());
@@ -701,6 +702,7 @@ function update($event_name,$data) {
701702
// This will NOT work!
702703
//$cgi_tpl->setVar('open_basedir', "/var/www/" . $data["new"]["domain"]);
703704
$cgi_tpl->setVar('php_cgi_bin',$cgi_config["cgi_bin"]);
705+
$cgi_tpl->setVar('security_level',$web_config["security_level"]);
704706

705707
$cgi_starter_script = escapeshellcmd($cgi_starter_path.$cgi_config["cgi_starter_script"]);
706708
file_put_contents($cgi_starter_script,$cgi_tpl->grab());

0 commit comments

Comments
 (0)