diff --git a/config/etc/pf.conf b/config/etc/pf.conf index d2844b8d..ad47fdf2 100644 --- a/config/etc/pf.conf +++ b/config/etc/pf.conf @@ -10,6 +10,9 @@ int_net = "192.168.1.0/24" # MSN, ICQ/AIM, Yahoo, IRC im_ports = "{ 1863, 5190, 5050, 6667 }" +# FCM ports for Firebase push notifications +fcm_ports = "{ 5228, 5229, 5230 }" + openvpn = "{ tun0, tun1 }" table persist file "/etc/pf.restrictedips" @@ -87,6 +90,9 @@ pass out log on $int_if proto tcp from $int_if to port ssh # UTMFW Web Administration Interface pass in log on $int_if proto tcp from $int_net to $int_if port { www, https } +# Firebase push notifications for internal mobile devices +#pass in log on $int_if proto tcp from $int_net to port $fcm_ports + # DNS queries to UTMFW pass in log on $int_if proto { tcp, udp } from $int_net to $int_if port { domain, bootps } diff --git a/config/utmfw.files b/config/utmfw.files index 818d9ce9..f309bc72 100644 --- a/config/utmfw.files +++ b/config/utmfw.files @@ -87,7 +87,7 @@ etc/p3scan/p3scan-tr-utf8.mail,644,root,wheel etc/p3scan/p3scan-nl.mail,644,root,wheel etc/p3scan/p3scan.conf,644,root,wheel etc/pfre/pf.conf.afterhours,600,root,wheel -etc/php-7.0/cul.ini,644,root,bin +etc/php-7.0/curl.ini,644,root,bin etc/php-7.0/mcrypt.ini,644,root,bin etc/php-7.0/pcntl.ini,644,root,bin etc/pmacct/pmacctd-pnrg.conf,644,root,wheel diff --git a/meta/install.sub b/meta/install.sub index e0f774ef..7d7a734b 100755 --- a/meta/install.sub +++ b/meta/install.sub @@ -660,6 +660,7 @@ __EOT pkg_add php-pcntl pkg_add php-mcrypt pkg_add php-cgi + pkg_add php-curl ;; esac ;; diff --git a/src/Model/dhcpd.php b/src/Model/dhcpd.php index a3840fdc..bbd80275 100644 --- a/src/Model/dhcpd.php +++ b/src/Model/dhcpd.php @@ -104,10 +104,18 @@ function __construct() */ function Start() { + global $TmpFile; + if (($ifs= $this->_getIfs()) !== FALSE) { $ifs= explode("\n", $ifs); $ifs= implode(' ', $ifs); - return $this->RunShellCommand("/usr/sbin/dhcpd $ifs"); + $this->RunShellCommand("/usr/sbin/dhcpd $ifs > $TmpFile 2>&1"); + + /// Start command is redirected to tmp file + $output= file_get_contents($TmpFile); + Error($output); + ctlr_syslog(LOG_INFO, __FILE__, __FUNCTION__, __LINE__, "Start output: $output"); + return $this->IsRunning(); } return FALSE; } diff --git a/src/Model/system.php b/src/Model/system.php index 759e3df6..8b681e4d 100644 --- a/src/Model/system.php +++ b/src/Model/system.php @@ -1305,7 +1305,8 @@ function IsNotifierEnabled() function DisableNotifier() { $tmp= $this->cronDir.'root'; - $this->PutFile($tmp, $this->getRootCronTab()); + // Do not use PutFile(), it expects file to exist + file_put_contents($tmp, $this->getRootCronTab(), LOCK_EX); $retval= $this->ReplaceRegexp($tmp, "?^(\h*\*/1\h+\*\h+\*\h+\*\h+\*\h+/usr/local/bin/php\h+/var/www/htdocs/utmfw/Notifier/notify.php\h+.*)$?m", '#${1}'); if (file_exists($tmp.'.bak')) { @@ -1324,7 +1325,8 @@ function DisableNotifier() function EnableNotifier() { $tmp= $this->cronDir.'root'; - $this->PutFile($tmp, $this->getRootCronTab()); + // Do not use PutFile(), it expects file to exist + file_put_contents($tmp, $this->getRootCronTab(), LOCK_EX); $retval= $this->ReplaceRegexp($tmp, "?^\h*#(\h*\*/1\h+\*\h+\*\h+\*\h+\*\h+/usr/local/bin/php\h+/var/www/htdocs/utmfw/Notifier/notify.php\h+.*$)?m", '${1}'); if (file_exists($tmp.'.bak')) {