Skip to content

Commit 8e54935

Browse files
author
Till Brehm
committed
Changed behaviour of UFW installation. Do not enable it by deafult as the firewall will get enabled autmatically when a firewall record gets added in ispconfig. Enabling it without that record, the Firewall would lock out the user on next reboot.
1 parent 4bdecca commit 8e54935

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

install/lib/installer_base.lib.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,12 +1842,14 @@ public function configure_squid()
18421842

18431843
public function configure_ufw_firewall()
18441844
{
1845-
$configfile = 'ufw.conf';
1846-
if(is_file('/etc/ufw/ufw.conf')) copy('/etc/ufw/ufw.conf', '/etc/ufw/ufw.conf~');
1847-
$content = rf("tpl/".$configfile.".master");
1848-
wf('/etc/ufw/ufw.conf', $content);
1849-
exec('chmod 600 /etc/ufw/ufw.conf');
1850-
exec('chown root:root /etc/ufw/ufw.conf');
1845+
if($this->is_update == false) {
1846+
$configfile = 'ufw.conf';
1847+
if(is_file('/etc/ufw/ufw.conf')) copy('/etc/ufw/ufw.conf', '/etc/ufw/ufw.conf~');
1848+
$content = rf("tpl/".$configfile.".master");
1849+
wf('/etc/ufw/ufw.conf', $content);
1850+
exec('chmod 600 /etc/ufw/ufw.conf');
1851+
exec('chown root:root /etc/ufw/ufw.conf');
1852+
}
18511853
}
18521854

18531855
public function configure_bastille_firewall() {

install/tpl/ufw.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33

44
# set to yes to start on boot
5-
ENABLED=yes
5+
ENABLED=no
66

77
# set to one of 'off', 'low', 'medium', 'high'
88
LOGLEVEL=low

0 commit comments

Comments
 (0)