Package: ddclient / 3.8.0-11.3

prevent_cache_leak.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Ingo Schwarze <ischwarze@astaro.com>
Description: bugfix: cache content leaks to global
 In the read_cache sub, a hash is passed to $config for filling in from the
 cache file. However, read_cache writes to $config{...} instead of
 $config->{...}. Unfortunately, the latter overwrites the global config.
 This includes the new IP address passed by the user...
Bug-Debian: http://bugs.debian.org/527848
Reviewed-by: Torsten Landschoff <torsten@debian.org>

Index: b/ddclient
===================================================================
--- a/ddclient
+++ b/ddclient
@@ -846,9 +846,9 @@
 	%opt   = %saved;
 
 	foreach my $h (keys %cache) {
-	    if (exists $config{$h}) {
+	    if (exists $config->{$h}) {
 		foreach (qw(atime mtime wtime ip status)) {
-	    	    $config{$h}{$_} = $cache{$h}{$_} if exists $cache{$h}{$_};
+	    	    $config->{$h}{$_} = $cache{$h}{$_} if exists $cache{$h}{$_};
 		}
 	    }
 	}
@@ -1098,7 +1098,7 @@
 	## merge options into host definitions or globals
 	if (@hosts) {
 	    foreach my $h (@hosts) {
-		$config{$h} = %{ merge(\%options, $config{$h}) };
+		$config{$h} = merge(\%options, $config{$h});
 	    }
 	    $opt{'host'} = join(',', @hosts);
 	} else {