1
From: Ingo Schwarze <ischwarze@astaro.com>
2
Description: bugfix: cache content leaks to global
3
In the read_cache sub, a hash is passed to $config for filling in from the
4
cache file. However, read_cache writes to $config{...} instead of
5
$config->{...}. Unfortunately, the latter overwrites the global config.
6
This includes the new IP address passed by the user...
7
Bug-Debian: http://bugs.debian.org/527848
8
Reviewed-by: Torsten Landschoff <torsten@debian.org>
11
===================================================================
17
foreach my $h (keys %cache) {
18
- if (exists $config{$h}) {
19
+ if (exists $config->{$h}) {
20
foreach (qw(atime mtime wtime ip status)) {
21
- $config{$h}{$_} = $cache{$h}{$_} if exists $cache{$h}{$_};
22
+ $config->{$h}{$_} = $cache{$h}{$_} if exists $cache{$h}{$_};
27
## merge options into host definitions or globals
29
foreach my $h (@hosts) {
30
- $config{$h} = %{ merge(\%options, $config{$h}) };
31
+ $config{$h} = merge(\%options, $config{$h});
33
$opt{'host'} = join(',', @hosts);