@@ -2616,24 +2616,25 @@ public function configure_bastille_firewall() {
26162616
26172617 $ row = $ this ->db ->queryOneRecord ('SELECT * FROM ?? WHERE server_id = ? ' , $ conf ["mysql " ]["database " ] . '.firewall ' , $ conf ['server_id ' ]);
26182618
2619+ $ tcp_public_services = '21 22 25 53 80 110 143 443 3306 8080 10000 ' ;
2620+ $ udp_public_services = '53 ' ;
2621+
26192622 if (!empty ($ row )) {
26202623 if (trim ($ row ['tcp_port ' ]) != '' || trim ($ row ['udp_port ' ]) != '' ) {
26212624 $ tcp_public_services = trim (str_replace (', ' , ' ' , $ row ['tcp_port ' ]));
26222625 $ udp_public_services = trim (str_replace (', ' , ' ' , $ row ['udp_port ' ]));
2623- } else {
2624- $ tcp_public_services = '21 22 25 53 80 110 143 443 3306 8080 10000 ' ;
2625- $ udp_public_services = '53 ' ;
26262626 }
26272627
26282628 if (!stristr ($ tcp_public_services , $ conf ['apache ' ]['vhost_port ' ])) {
26292629 $ tcp_public_services .= ' ' .intval ($ conf ['apache ' ]['vhost_port ' ]);
26302630 if ($ row ['tcp_port ' ] != '' ) $ this ->db ->query ("UPDATE firewall SET tcp_port = tcp_port + ? WHERE server_id = ? " , ', ' . intval ($ conf ['apache ' ]['vhost_port ' ]), $ conf ['server_id ' ]);
26312631 }
26322632
2633- $ content = str_replace ('{TCP_PUBLIC_SERVICES} ' , $ tcp_public_services , $ content );
2634- $ content = str_replace ('{UDP_PUBLIC_SERVICES} ' , $ udp_public_services , $ content );
26352633 }
26362634
2635+ $ content = str_replace ('{TCP_PUBLIC_SERVICES} ' , $ tcp_public_services , $ content );
2636+ $ content = str_replace ('{UDP_PUBLIC_SERVICES} ' , $ udp_public_services , $ content );
2637+
26372638 wf ('/etc/Bastille/bastille-firewall.cfg ' , $ content );
26382639
26392640 if (is_file ($ dist_init_scripts .'/bastille-firewall ' )) caselog ('mv -f ' .$ dist_init_scripts .'/bastille-firewall ' .$ dist_init_scripts .'/bastille-firewall.backup ' , __FILE__ , __LINE__ );
0 commit comments