mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 01:01:27 +00:00
scstadmin: Eliminate use of uninitialized value in numeric error
Using scstadmin to reload a configuration with fewer targets can result in a "Use of uninitialized value in numeric ne" error. Rectify by adding a check for the undefined value and handling the situation (by disabling the target in question, unless the driver is copy_manager).
This commit is contained in:
committed by
Gleb Chesnokov
parent
2f9a82bb87
commit
f4f8da8b4d
@@ -2831,10 +2831,17 @@ sub applyConfigEnableTargets {
|
||||
my $t_attributes;
|
||||
($t_attributes, $errorString) = $SCST->targetAttributes($driver, $target);
|
||||
|
||||
if (defined($$t_attributes{'enabled'}) &&
|
||||
($$t_attributes{'enabled'}->{'value'} != $$attributes{'enabled'})) {
|
||||
setTargetAttribute($driver, $target, 'enabled', $$attributes{'enabled'});
|
||||
$changes++;
|
||||
if (defined($$attributes{'enabled'})) {
|
||||
if (defined($$t_attributes{'enabled'}) &&
|
||||
($$t_attributes{'enabled'}->{'value'} != $$attributes{'enabled'})) {
|
||||
setTargetAttribute($driver, $target, 'enabled', $$attributes{'enabled'});
|
||||
$changes++;
|
||||
}
|
||||
} else {
|
||||
if ($driver ne 'copy_manager') {
|
||||
setTargetAttribute($driver, $target, 'enabled', 0);
|
||||
$changes++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user