Skip to content

Commit fa029ba

Browse files
author
Till Brehm
committed
Added security directory.
1 parent 1bcc716 commit fa029ba

File tree

7 files changed

+95
-5
lines changed

7 files changed

+95
-5
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,13 +958,13 @@ public function install_ispconfig()
958958
$this->db->query($sql);
959959
}
960960

961-
/// chown install dir to root and chmod 755
961+
// chown install dir to root and chmod 755
962962
$command = 'chown root:root '.$install_dir;
963963
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
964964
$command = 'chmod 755 '.$install_dir;
965965
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
966966

967-
//* Chmod the files and directoreies in the install dir
967+
//* Chmod the files and directories in the install dir
968968
$command = 'chmod -R 750 '.$install_dir.'/*';
969969
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
970970

@@ -975,6 +975,16 @@ public function install_ispconfig()
975975
//* chown the server files to the root user and group
976976
$command = 'chown -R root:root '.$install_dir.'/server';
977977
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
978+
979+
//* chown the security files to the root user and group
980+
$command = 'chown -R root:root '.$install_dir.'/security';
981+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
982+
983+
//* chown the security directory and security_settings.ini to root:ispconfig
984+
$command = 'chown root:ispconfig '.$install_dir.'/security/security_settings.ini';
985+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
986+
$command = 'chown root:ispconfig '.$install_dir.'/security';
987+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
978988

979989
//* Make the global language file directory group writable
980990
exec("chmod -R 770 $install_dir/interface/lib/lang");

install/dist/lib/gentoo.lib.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ public function install_ispconfig()
856856
$command = 'chmod 755 '.$install_dir;
857857
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
858858

859-
//* Chmod the files and directoreies in the install dir
859+
//* Chmod the files and directories in the install dir
860860
$command = 'chmod -R 750 '.$install_dir.'/*';
861861
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
862862

@@ -867,6 +867,16 @@ public function install_ispconfig()
867867
//* chown the server files to the root user and group
868868
$command = 'chown -R root:root '.$install_dir.'/server';
869869
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
870+
871+
//* chown the security files to the root user and group
872+
$command = 'chown -R root:root '.$install_dir.'/security';
873+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
874+
875+
//* chown the security directory and security_settings.ini to root:ispconfig
876+
$command = 'chown root:ispconfig '.$install_dir.'/security/security_settings.ini';
877+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
878+
$command = 'chown root:ispconfig '.$install_dir.'/security';
879+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
870880

871881
//* Make the global language file directory group writable
872882
exec("chmod -R 770 $install_dir/interface/lib/lang");

install/dist/lib/opensuse.lib.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ public function install_ispconfig()
10341034
$command = 'chmod 755 '.$install_dir;
10351035
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
10361036

1037-
//* Chmod the files and directoreies in the install dir
1037+
//* Chmod the files and directories in the install dir
10381038
$command = 'chmod -R 750 '.$install_dir.'/*';
10391039
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
10401040

@@ -1045,6 +1045,16 @@ public function install_ispconfig()
10451045
//* chown the server files to the root user and group
10461046
$command = 'chown -R root:root '.$install_dir.'/server';
10471047
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1048+
1049+
//* chown the security files to the root user and group
1050+
$command = 'chown -R root:root '.$install_dir.'/security';
1051+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1052+
1053+
//* chown the security directory and security_settings.ini to root:ispconfig
1054+
$command = 'chown root:ispconfig '.$install_dir.'/security/security_settings.ini';
1055+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1056+
$command = 'chown root:ispconfig '.$install_dir.'/security';
1057+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
10481058

10491059
//* Make the global language file directory group writable
10501060
exec("chmod -R 770 $install_dir/interface/lib/lang");

install/lib/installer_base.lib.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ public function install_ispconfig() {
18911891
$command = 'chmod 755 '.$install_dir;
18921892
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
18931893

1894-
//* Chmod the files and directoreies in the install dir
1894+
//* Chmod the files and directories in the install dir
18951895
$command = 'chmod -R 750 '.$install_dir.'/*';
18961896
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
18971897

@@ -1902,6 +1902,16 @@ public function install_ispconfig() {
19021902
//* chown the server files to the root user and group
19031903
$command = 'chown -R root:root '.$install_dir.'/server';
19041904
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1905+
1906+
//* chown the security files to the root user and group
1907+
$command = 'chown -R root:root '.$install_dir.'/security';
1908+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1909+
1910+
//* chown the security directory and security_settings.ini to root:ispconfig
1911+
$command = 'chown root:ispconfig '.$install_dir.'/security/security_settings.ini';
1912+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1913+
$command = 'chown root:ispconfig '.$install_dir.'/security';
1914+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
19051915

19061916
//* Make the global language file directory group writable
19071917
exec("chmod -R 770 $install_dir/interface/lib/lang");

security/check.php

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2014, Till Brehm, ISPConfig UG
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
define('SCRIPT_PATH', dirname($_SERVER["SCRIPT_FILENAME"]));
32+
require SCRIPT_PATH."/lib/config.inc.php";
33+
require SCRIPT_PATH."/lib/app.inc.php";
34+
35+
set_time_limit(0);
36+
ini_set('error_reporting', E_ALL & ~E_NOTICE);
37+
38+
// make sure server_id is always an int
39+
$conf['server_id'] = intval($conf['server_id']);
40+
41+
42+
// Load required base-classes
43+
$app->uses('ini_parser,file,services,getconf,system');
44+
45+
46+
47+
?>

security/data/empty.dir

Whitespace-only changes.

server/server.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ if [ -f /usr/local/ispconfig/server/lib/php.ini ]; then
1313
fi
1414
fi
1515

16+
cd /usr/local/ispconfig/security
17+
/usr/bin/php -q /usr/local/ispconfig/security/check.php
18+
1619
cd /usr/local/ispconfig/server
1720
/usr/bin/php -q /usr/local/ispconfig/server/server.php

0 commit comments

Comments
 (0)