Handle non-numeric IDs
authorJamie Cameron <jcameron@webmin.com>
Sun, 1 Mar 2009 19:21:02 +0000 (19:21 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sun, 1 Mar 2009 19:21:02 +0000 (19:21 +0000)
fsdump/backup.pl
fsdump/fsdump-lib.pl
fsdump/kill.cgi
fsdump/newtape.cgi
fsdump/newtape.pl

index 2c036c8..09f0497 100755 (executable)
@@ -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'}");
                }
        }
index d5ec0d4..27463c0 100644 (file)
@@ -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";
index fb0bc8e..5b301b2 100755 (executable)
@@ -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'});
index 4684690..6b05873 100755 (executable)
@@ -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'});
index 840d181..1e939f4 100755 (executable)
@@ -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";
                }