From ee969a9445a5439cf94a516c7d882e12b1bdf945 Mon Sep 17 00:00:00 2001 From: cbarratt Date: Mon, 27 Nov 2006 07:24:10 +0000 Subject: [PATCH] * Fix for config.pl writing code to handle multi-line expressions. Reported by David Relson and others. * Fix for CGI editor when deleting hash entries whose keys are non alphanumeric. Report by David Relson. --- ChangeLog | 10 ++++++++++ conf/config.pl | 2 +- lib/BackupPC/CGI/EditConfig.pm | 4 ++-- lib/BackupPC/Storage/Text.pm | 8 +++++--- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6068ce..7dccc15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,16 @@ # Version __VERSION__, __RELEASEDATE__ #------------------------------------------------------------------------ +* Fix for config.pl writing code to handle multi-line expressions. + Reported by David Relson and others. + +* Fix for CGI editor when deleting hash entries whose keys are + non alphanumeric. Report by David Relson. + +#------------------------------------------------------------------------ +# Version 3.0.0beta2, 18 Nov 2006 +#------------------------------------------------------------------------ + * Fix for final md4 digest check on rsync transfers >= 512MB when protocol version >= 27 and checksums are not cached. Reported by Garith Dugmore and Dale Renton. diff --git a/conf/config.pl b/conf/config.pl index 069dd66..6caece2 100644 --- a/conf/config.pl +++ b/conf/config.pl @@ -98,7 +98,7 @@ $Conf{UmaskMode} = 027; # you might have only one or two wakeups each night. This will keep # the backup activity after hours. On the other hand, if you are backing # up laptops that are only intermittently connected to the network you -# will want to have frequent wakeups (eg: hourly) to maximized the chance +# will want to have frequent wakeups (eg: hourly) to maximize the chance # that each laptop is backed up. # # Examples: diff --git a/lib/BackupPC/CGI/EditConfig.pm b/lib/BackupPC/CGI/EditConfig.pm index df38ebd..f8f0add 100644 --- a/lib/BackupPC/CGI/EditConfig.pm +++ b/lib/BackupPC/CGI/EditConfig.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 3.0.0beta2, released 11 Nov 2006. +# Version 3.0.0beta2, released 18 Nov 2006. # # See http://backuppc.sourceforge.net. # @@ -1100,7 +1100,7 @@ EOF if ( !$isError && !$type->{noKeyEdit} && $In{deleteVar} !~ /^\Q${varName}_z_\E.*_z_/ - && $In{deleteVar} =~ /^\Q${varName}_z_\E(\w+)$/ ) { + && $In{deleteVar} =~ /^\Q${varName}_z_\E(.*)$/ ) { # # User deleted entry in this hash # diff --git a/lib/BackupPC/Storage/Text.pm b/lib/BackupPC/Storage/Text.pm index fa46af2..e1d31cc 100644 --- a/lib/BackupPC/Storage/Text.pm +++ b/lib/BackupPC/Storage/Text.pm @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 3.0.0beta2, released 11 Nov 2006. +# Version 3.0.0beta2, released 18 Nov 2006. # # See http://backuppc.sourceforge.net. # @@ -344,8 +344,8 @@ sub ConfigFileMerge while ( ) { if ( /^\s*\$Conf\{([^}]*)\}\s*=(.*)/ ) { my $var = $1; + $skipExpr = "\$fakeVar = $2\n"; if ( exists($newConf->{$var}) ) { - $skipExpr = "\$fakeVar = $2\n"; my $d = Data::Dumper->new([$newConf->{$var}], [*value]); $d->Indent(1); $d->Terse(1); @@ -359,7 +359,9 @@ sub ConfigFileMerge } else { $contents .= $_; } - if ( defined($skipExpr) ) { + if ( defined($skipExpr) + && ($skipExpr =~ /^\$fakeVar = *<