* Fix for config.pl writing code to handle multi-line expressions.
authorcbarratt <cbarratt>
Mon, 27 Nov 2006 07:24:10 +0000 (07:24 +0000)
committercbarratt <cbarratt>
Mon, 27 Nov 2006 07:24:10 +0000 (07:24 +0000)
  Reported by David Relson and others.

* Fix for CGI editor when deleting hash entries whose keys are
  non alphanumeric.  Report by David Relson.

ChangeLog
conf/config.pl
lib/BackupPC/CGI/EditConfig.pm
lib/BackupPC/Storage/Text.pm

index b6068ce..7dccc15 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 # 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.
index 069dd66..6caece2 100644 (file)
@@ -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:
index df38ebd..f8f0add 100644 (file)
@@ -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
             #
index fa46af2..e1d31cc 100644 (file)
@@ -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 ( <C> ) {
             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 = *<</
+                        || $skipExpr =~ /;[\n\r]*$/) ) {
                 #
                 # if we have a complete expression, then we are done
                 # skipping text from the original config file.