summaryrefslogtreecommitdiffstats
path: root/etc/inc/system.inc
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2014-12-19 09:34:36 +0100
committerErmal LUÇI <eri@pfsense.org>2014-12-19 09:34:54 +0100
commit964dcb25044f7364e131b35b31b43002d74bb880 (patch)
tree2f4a2b902bdcdc7bd40fb2a73ef8972feb8e27fc /etc/inc/system.inc
parent19ddaa31430a63552ad6b3f6e91457db143d5005 (diff)
downloadpfsense-964dcb25044f7364e131b35b31b43002d74bb880.zip
pfsense-964dcb25044f7364e131b35b31b43002d74bb880.tar.gz
Enforce some more checking to avoid https://forum.pfsense.org/index.php?topic=85580.0
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r--etc/inc/system.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 7f6af33..2463882 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -1417,7 +1417,7 @@ function system_ntp_setup_gps($serialport) {
conf_mount_rw();
// Create symlink that ntpd requires
unlink_if_exists($gps_device);
- symlink($serialport, $gps_device);
+ @symlink($serialport, $gps_device);
/* Send the following to the GPS port to initialize the GPS */
if (is_array($config['ntpd']) && is_array($config['ntpd']['gps']) && !empty($config['ntpd']['gps']['type'])) {
@@ -1511,7 +1511,7 @@ function system_ntp_configure($start_ntpd=true) {
$ntpcfg .= "\n";
/* Add PPS configuration */
- if (!empty($config['ntpd']['pps'])
+ if (is_array($config['ntpd']['pps']) && !empty($config['ntpd']['pps']['port'])
&& file_exists('/dev/'.$config['ntpd']['pps']['port'])
&& system_ntp_setup_pps($config['ntpd']['pps']['port'])) {
$ntpcfg .= "\n";
@@ -1550,7 +1550,7 @@ function system_ntp_configure($start_ntpd=true) {
/* End PPS configuration */
/* Add GPS configuration */
- if (!empty($config['ntpd']['gps'])
+ if (is_array($config['ntpd']['gps']) && !empty($config['ntpd']['gps']['port'])
&& file_exists('/dev/'.$config['ntpd']['gps']['port'])
&& system_ntp_setup_gps($config['ntpd']['gps']['port'])) {
$ntpcfg .= "\n";
@@ -1608,7 +1608,7 @@ function system_ntp_configure($start_ntpd=true) {
$ntpcfg .= $config['ntpd']['gps']['refid'];
}
$ntpcfg .= "\n";
- }elseif (!empty($config['ntpd']['gpsport'])
+ }elseif (is_array($config['ntpd']) && !empty($config['ntpd']['gpsport'])
&& file_exists('/dev/'.$config['ntpd']['gpsport'])
&& system_ntp_setup_gps($config['ntpd']['gpsport'])) {
/* This handles a 2.1 and earlier config */
OpenPOWER on IntegriCloud