From bd727a120becca8acea5fbad53b48286d7d238aa Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 1 Mar 2009 19:21:02 +0000 Subject: [PATCH] Handle non-numeric IDs --- fsdump/backup.pl | 2 +- fsdump/fsdump-lib.pl | 2 -- fsdump/kill.cgi | 2 +- fsdump/newtape.cgi | 2 +- fsdump/newtape.pl | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fsdump/backup.pl b/fsdump/backup.pl index 2c036c82a..09f049796 100755 --- a/fsdump/backup.pl +++ b/fsdump/backup.pl @@ -127,7 +127,7 @@ if ($out && $dump->{'email'} && &foreign_check("mailboxes")) { # Check for any dumps scheduled to run after this one foreach $follow (&list_dumps()) { - if ($follow->{'follow'} == $dump->{'id'} && $follow->{'enabled'} == 2) { + if ($follow->{'follow'} eq $dump->{'id'} && $follow->{'enabled'} == 2) { system("$cron_cmd $follow->{'id'}"); } } diff --git a/fsdump/fsdump-lib.pl b/fsdump/fsdump-lib.pl index d5ec0d427..27463c0fe 100644 --- a/fsdump/fsdump-lib.pl +++ b/fsdump/fsdump-lib.pl @@ -4,8 +4,6 @@ BEGIN { push(@INC, ".."); }; use WebminCore; -#do '../web-lib.pl'; -#do '../ui-lib.pl'; &init_config(); if ($gconfig{'os_type'} =~ /^\S+\-linux$/) { do "linux-lib.pl"; diff --git a/fsdump/kill.cgi b/fsdump/kill.cgi index fb0bc8e17..5b301b23b 100755 --- a/fsdump/kill.cgi +++ b/fsdump/kill.cgi @@ -10,7 +10,7 @@ require './fsdump-lib.pl'; @procs = &proc::list_processes(); @running = &running_dumps(\@procs); -($job) = grep { $_->{'id'} == $in{'id'} && +($job) = grep { $_->{'id'} eq $in{'id'} && $_->{'pid'} == $in{'pid'} } @running; $job || &error($text{'kill_egone'}); &can_edit_dir($job) || &error($text{'kill_ecannot'}); diff --git a/fsdump/newtape.cgi b/fsdump/newtape.cgi index 468469050..6b05873ff 100755 --- a/fsdump/newtape.cgi +++ b/fsdump/newtape.cgi @@ -10,7 +10,7 @@ require './fsdump-lib.pl'; @procs = &proc::list_processes(); @running = &running_dumps(\@procs); -($job) = grep { $_->{'id'} == $in{'id'} && +($job) = grep { $_->{'id'} eq $in{'id'} && $_->{'pid'} == $in{'pid'} } @running; $job || &error($text{'newtape_egone'}); &can_edit_dir($job) || &error($text{'newtape_ecannot'}); diff --git a/fsdump/newtape.pl b/fsdump/newtape.pl index 840d18138..1e939f483 100755 --- a/fsdump/newtape.pl +++ b/fsdump/newtape.pl @@ -13,7 +13,7 @@ $dump->{'id'} || die "Dump $ARGV[0] does not exist!"; # Find the status file opendir(DIR, $module_config_directory); foreach $f (readdir(DIR)) { - if ($f =~ /^(\d+)\.(\d+)\.status$/ && $1 == $dump->{'id'}) { + if ($f =~ /^(\d+)\.(\d+)\.status$/ && $1 eq $dump->{'id'}) { # Got it! $sfile = "$module_config_directory/$f"; }