From be4a8a9d03c12d001b662d46ebf22017e3debec6 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 20 Nov 2012 10:01:59 -0500
Subject: [PATCH] Set default umask to 022 in server.sh file.
---
install/lib/installer_base.lib.php | 42 ++++++++++++++++++++++++++++++++++++------
1 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index b887a94..65cafa9 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -423,7 +423,7 @@
$this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
}
- $query = "GRANT SELECT, UPDATE (`ssl_request`, `ssl_cert`, `ssl_action`) ON ".$value['db'].".`web_domain` TO '".$value['user']."'@'".$host."' ";
+ $query = "GRANT SELECT, UPDATE (`ssl_request`, `ssl_cert`, `ssl_action`, `ssl_key`) ON ".$value['db'].".`web_domain` TO '".$value['user']."'@'".$host."' ";
if ($verbose){
echo $query ."\n";
}
@@ -472,6 +472,14 @@
}
$query = "GRANT SELECT, UPDATE ON ".$value['db'].".`aps_instances` TO '".$value['user']."'@'".$host."' ";
+ if ($verbose){
+ echo $query ."\n";
+ }
+ if(!$this->dbmaster->query($query)) {
+ $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
+ }
+
+ $query = "GRANT SELECT, INSERT, DELETE ON ".$value['db'].".`web_backup` TO '".$value['user']."'@'".$host."' ";
if ($verbose){
echo $query ."\n";
}
@@ -1555,6 +1563,16 @@
//$content = str_replace('{fpm_port}', ($conf['nginx']['php_fpm_start_port']+1), $content);
$content = str_replace('{fpm_socket}', $fpm_socket, $content);
$content = str_replace('{cgi_socket}', $cgi_socket, $content);
+
+ if(file_exists('/var/run/php5-fpm.sock')){
+ $use_tcp = '#';
+ $use_socket = '';
+ } else {
+ $use_tcp = '';
+ $use_socket = '#';
+ }
+ $content = str_replace('{use_tcp}', $use_tcp, $content);
+ $content = str_replace('{use_socket}', $use_socket, $content);
wf($vhost_conf_dir.'/apps.vhost', $content);
@@ -1650,6 +1668,7 @@
$content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content);
$content = str_replace('{language}', $conf['language'], $content);
$content = str_replace('{timezone}', $conf['timezone'], $content);
+ $content = str_replace('{theme}', $conf['theme'], $content);
wf($install_dir.'/interface/lib/'.$configfile, $content);
@@ -1673,6 +1692,7 @@
$content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content);
$content = str_replace('{language}', $conf['language'], $content);
$content = str_replace('{timezone}', $conf['timezone'], $content);
+ $content = str_replace('{theme}', $conf['theme'], $content);
wf($install_dir.'/server/lib/'.$configfile, $content);
@@ -1796,9 +1816,14 @@
exec("chmod -R 770 $install_dir/server/aps_packages");
//* make sure that the server config file (not the interface one) is only readable by the root user
- chmod($install_dir.'/server/lib/'.$configfile, 0600);
- chown($install_dir.'/server/lib/'.$configfile, 'root');
- chgrp($install_dir.'/server/lib/'.$configfile, 'root');
+ chmod($install_dir.'/server/lib/config.inc.php', 0600);
+ chown($install_dir.'/server/lib/config.inc.php', 'root');
+ chgrp($install_dir.'/server/lib/config.inc.php', 'root');
+
+ //* Make sure thet the interface config file is readable by user ispconfig only
+ chmod($install_dir.'/interface/lib/config.inc.php', 0600);
+ chown($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
+ chgrp($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
chmod($install_dir.'/server/lib/remote_action.inc.php', 0600);
chown($install_dir.'/server/lib/remote_action.inc.php', 'root');
@@ -1960,9 +1985,9 @@
//* Create the ispconfig auth log file and set uid/gid
if(!is_file($conf['ispconfig_log_dir'].'/auth.log')) {
touch($conf['ispconfig_log_dir'].'/auth.log');
- exec('chown ispconfig:ispconfig '. $conf['ispconfig_log_dir'].'/auth.log');
- exec('chmod 660 '. $conf['ispconfig_log_dir'].'/auth.log');
}
+ exec('chown ispconfig:ispconfig '. $conf['ispconfig_log_dir'].'/auth.log');
+ exec('chmod 660 '. $conf['ispconfig_log_dir'].'/auth.log');
if(is_user('getmail')) {
rename($install_dir.'/server/scripts/run-getmail.sh','/usr/local/bin/run-getmail.sh');
@@ -1993,6 +2018,11 @@
fclose($fh);
*/
}
+
+ //* Remove Domain module as its functions are available in the client module now
+ if(@is_dir('/usr/local/ispconfig/interface/web/domain')) exec('rm -rf /usr/local/ispconfig/interface/web/domain');
+
+
}
public function configure_dbserver() {
--
Gitblit v1.9.1