summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-05-17 22:08:21 +0000
committerErmal <eri@pfsense.org>2011-05-17 22:08:21 +0000
commit8bf2e9e5399bb96f6fd819bbb1ad5e5dbabc70a7 (patch)
tree44dba68b6fd779b2a766770a7a8939ed39a70972 /etc
parent098820e224964ac8e2a93e8e4cb5ebe866ad258d (diff)
downloadpfsense-8bf2e9e5399bb96f6fd819bbb1ad5e5dbabc70a7.zip
pfsense-8bf2e9e5399bb96f6fd819bbb1ad5e5dbabc70a7.tar.gz
Test for null names passed to these functions as a safety precaution.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/service-utils.inc6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc
index 4c09899..57e5472 100644
--- a/etc/inc/service-utils.inc
+++ b/etc/inc/service-utils.inc
@@ -114,6 +114,9 @@ function stop_service($name) {
global $config;
global $rcfileprefix;
+ if (empty($name))
+ return;
+
if ($config['installedpackages']['service']) {
foreach($config['installedpackages']['service'] as $service) {
if(strtolower($service['name']) == strtolower($name)) {
@@ -147,6 +150,9 @@ function stop_service($name) {
function restart_service($name) {
global $config;
+ if (empty($name))
+ return;
+
stop_service($name);
start_service($name);
OpenPOWER on IntegriCloud