diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php index d6d975a1508d2bea2af378787109a66423fea0b8..e01a739d636813c2d9dc4aa3783fa9b2e7194d91 100644 --- a/install/dist/lib/fedora.lib.php +++ b/install/dist/lib/fedora.lib.php @@ -958,13 +958,13 @@ class installer_dist extends installer_base { $this->db->query($sql); } - /// chown install dir to root and chmod 755 + // chown install dir to root and chmod 755 $command = 'chown root:root '.$install_dir; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); $command = 'chmod 755 '.$install_dir; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - //* Chmod the files and directoreies in the install dir + //* Chmod the files and directories in the install dir $command = 'chmod -R 750 '.$install_dir.'/*'; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); @@ -975,6 +975,16 @@ class installer_dist extends installer_base { //* chown the server files to the root user and group $command = 'chown -R root:root '.$install_dir.'/server'; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* chown the security files to the root user and group + $command = 'chown -R root:root '.$install_dir.'/security'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* chown the security directory and security_settings.ini to root:ispconfig + $command = 'chown root:ispconfig '.$install_dir.'/security/security_settings.ini'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + $command = 'chown root:ispconfig '.$install_dir.'/security'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); //* Make the global language file directory group writable exec("chmod -R 770 $install_dir/interface/lib/lang"); diff --git a/install/dist/lib/gentoo.lib.php b/install/dist/lib/gentoo.lib.php index 26474c51fc1c1a45fc9ff3e8aeb57c67cceb155e..fb6b13853a2f015eee96e45461b79a178effb602 100644 --- a/install/dist/lib/gentoo.lib.php +++ b/install/dist/lib/gentoo.lib.php @@ -856,7 +856,7 @@ class installer extends installer_base $command = 'chmod 755 '.$install_dir; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - //* Chmod the files and directoreies in the install dir + //* Chmod the files and directories in the install dir $command = 'chmod -R 750 '.$install_dir.'/*'; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); @@ -867,6 +867,16 @@ class installer extends installer_base //* chown the server files to the root user and group $command = 'chown -R root:root '.$install_dir.'/server'; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* chown the security files to the root user and group + $command = 'chown -R root:root '.$install_dir.'/security'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* chown the security directory and security_settings.ini to root:ispconfig + $command = 'chown root:ispconfig '.$install_dir.'/security/security_settings.ini'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + $command = 'chown root:ispconfig '.$install_dir.'/security'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); //* Make the global language file directory group writable exec("chmod -R 770 $install_dir/interface/lib/lang"); diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php index dad3a6a3cbc8007a488be720fc9c7482f84b246a..c76833169a4f8f60c37e3282264134663c71e784 100644 --- a/install/dist/lib/opensuse.lib.php +++ b/install/dist/lib/opensuse.lib.php @@ -1034,7 +1034,7 @@ class installer_dist extends installer_base { $command = 'chmod 755 '.$install_dir; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - //* Chmod the files and directoreies in the install dir + //* Chmod the files and directories in the install dir $command = 'chmod -R 750 '.$install_dir.'/*'; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); @@ -1045,6 +1045,16 @@ class installer_dist extends installer_base { //* chown the server files to the root user and group $command = 'chown -R root:root '.$install_dir.'/server'; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* chown the security files to the root user and group + $command = 'chown -R root:root '.$install_dir.'/security'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* chown the security directory and security_settings.ini to root:ispconfig + $command = 'chown root:ispconfig '.$install_dir.'/security/security_settings.ini'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + $command = 'chown root:ispconfig '.$install_dir.'/security'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); //* Make the global language file directory group writable exec("chmod -R 770 $install_dir/interface/lib/lang"); diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 9bf84b6e1ff20869161f27107e69e0deb7cd4445..19e1f032fd82a1f4efb95faa88dc05187d2f6ace 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -1891,7 +1891,7 @@ class installer_base { $command = 'chmod 755 '.$install_dir; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - //* Chmod the files and directoreies in the install dir + //* Chmod the files and directories in the install dir $command = 'chmod -R 750 '.$install_dir.'/*'; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); @@ -1902,6 +1902,16 @@ class installer_base { //* chown the server files to the root user and group $command = 'chown -R root:root '.$install_dir.'/server'; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* chown the security files to the root user and group + $command = 'chown -R root:root '.$install_dir.'/security'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* chown the security directory and security_settings.ini to root:ispconfig + $command = 'chown root:ispconfig '.$install_dir.'/security/security_settings.ini'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + $command = 'chown root:ispconfig '.$install_dir.'/security'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); //* Make the global language file directory group writable exec("chmod -R 770 $install_dir/interface/lib/lang"); diff --git a/security/check.php b/security/check.php new file mode 100644 index 0000000000000000000000000000000000000000..d6518a1c52525a6c93beb7ad7e4f84682b06dd5d --- /dev/null +++ b/security/check.php @@ -0,0 +1,47 @@ +uses('ini_parser,file,services,getconf,system'); + + + +?> \ No newline at end of file diff --git a/security/data/empty.dir b/security/data/empty.dir new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/server/server.sh b/server/server.sh index 75253e7890b5896f4e27a8471e2a0bdf2f5bc5fc..88c30e7445daee584ebf2ec3ece1026b678be96f 100755 --- a/server/server.sh +++ b/server/server.sh @@ -13,5 +13,8 @@ if [ -f /usr/local/ispconfig/server/lib/php.ini ]; then fi fi +cd /usr/local/ispconfig/security +/usr/bin/php -q /usr/local/ispconfig/security/check.php + cd /usr/local/ispconfig/server /usr/bin/php -q /usr/local/ispconfig/server/server.php