summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarlosg <carlosg>2006-11-27 15:39:25 +0000
committercarlosg <carlosg>2006-11-27 15:39:25 +0000
commit0da5a0dedd7319aa287c21b536eafb78d7c354d2 (patch)
tree1c3d269cd3d3cb21e78913fc5d18a0363593a7fa
parent701c995b92688e972f1b2984b6193e227a4f943f (diff)
2006-11-27 Carlos Garnacho <carlosg@gnome.org>
* Init/Services.pm: add some sanity checks.
-rw-r--r--ChangeLog4
-rw-r--r--Init/Services.pm5
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a745473..f288f5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-11-27 Carlos Garnacho <carlosg@gnome.org>
+
+ * Init/Services.pm: add some sanity checks.
+
2006-11-26 Carlos Garnacho <carlosg@gnome.org>
* Release 2.0
diff --git a/Init/Services.pm b/Init/Services.pm
index fb8ceb3..b905a4d 100644
--- a/Init/Services.pm
+++ b/Init/Services.pm
@@ -176,7 +176,6 @@ sub get_sysv_services
my (@arr);
($rcd_path, $initd_path) = &get_sysv_paths ();
-
return undef unless ($rcd_path && $initd_path);
foreach $service (<$initd_path/*>)
@@ -225,6 +224,7 @@ sub run_sysv_initd_script
&Utils::Report::enter ();
($rcd_path, $initd_path) = &get_sysv_paths ();
+ return -1 unless ($rcd_path && $initd_path);
if (-f "$initd_path/$service")
{
@@ -248,6 +248,7 @@ sub set_sysv_service
my ($runlevel, $action, %configured_runlevels);
($rcd_path, $initd_path, $relative_path) = &get_sysv_paths ();
+ return unless ($rcd_path && $initd_path && $relative_path);
$script = $$service[0];
$runlevels = $$service[1];
@@ -458,6 +459,7 @@ sub set_filerc_services
my ($services) = @_;
my ($buff, $lineno, $line, $file);
my ($rcd_path, $initd_path, $relative_path) = &get_sysv_paths ();
+ return unless ($rcd_path && $initd_path && $relative_path);
$file = "/etc/runlevel.conf";
@@ -1069,6 +1071,7 @@ sub get_suse_services
my ($service, @arr);
($rcd_path, $initd_path) = &get_sysv_paths ();
+ return undef unless ($rcd_path && $initd_path);
foreach $service (<$gst_prefix/etc/init.d/*>)
{