~swt-techie/ubuntu/trusty/ddclient/bug-1068884

« back to all changes in this revision

Viewing changes to debian/patches/prevent_cache_leak.diff

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2009-12-01 08:05:19 UTC
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20091201080519-xp9cn93o3181r3sr
Tags: 3.8.0-8
* Convert to new source format "3.0 (quilt)".
* debian/control: Bump Standards-Version (no changes required). 
* ddclient: Do not leak the cache content into the global configuration.
  Thanks to Ingo Schwarze for the patch (closes: #527848).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>
 
9
 
 
10
Index: b/ddclient
 
11
===================================================================
 
12
--- a/ddclient
 
13
+++ b/ddclient
 
14
@@ -846,9 +846,9 @@
 
15
        %opt   = %saved;
 
16
 
 
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}{$_};
 
23
                }
 
24
            }
 
25
        }
 
26
@@ -1098,7 +1098,7 @@
 
27
        ## merge options into host definitions or globals
 
28
        if (@hosts) {
 
29
            foreach my $h (@hosts) {
 
30
-               $config{$h} = %{ merge(\%options, $config{$h}) };
 
31
+               $config{$h} = merge(\%options, $config{$h});
 
32
            }
 
33
            $opt{'host'} = join(',', @hosts);
 
34
        } else {