[Fai-commit] r6145 - trunk/lib/setup-storage

Michael Tautschnig mt at alioth.debian.org
Thu Oct 14 23:24:36 UTC 2010


Author: mt
Date: 2010-10-14 23:24:35 +0000 (Thu, 14 Oct 2010)
New Revision: 6145

Modified:
   trunk/lib/setup-storage/Commands.pm
Log:
setup-storage/Commands.pm: Quote fs argument in parted mkpart calls 

Special characters may be in use that confuse the shell as in, e.g.,
linux-swap(v1) (thanks Peter Kruse for the patch).


Modified: trunk/lib/setup-storage/Commands.pm
===================================================================
--- trunk/lib/setup-storage/Commands.pm	2010-10-14 23:22:21 UTC (rev 6144)
+++ trunk/lib/setup-storage/Commands.pm	2010-10-14 23:24:35 UTC (rev 6145)
@@ -850,7 +850,7 @@
     $post .= ",rebuilt_" . &FAI::make_device_name($disk, $part_nr) if
       $FAI::configs{$config}{partitions}{$part_id}{size}{resize};
     # build a parted command to create the partition
-    &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B ${end}B",
+    &FAI::push_command( "parted -s $disk mkpart $part_type \"$fs\" ${start}B ${end}B",
       "cleared1_$disk", $post );
   }
 }
@@ -1043,7 +1043,7 @@
     my $pre = "";
     $pre = ",exist_" . &FAI::make_device_name($disk, $prev_id) if ($prev_id > -1);
     # build a parted command to create the partition
-    &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B ${end}B",
+    &FAI::push_command( "parted -s $disk mkpart $part_type \"$fs\" ${start}B ${end}B",
       "cleared2_$disk$pre", "exist_" . &FAI::make_device_name($disk, $part_id) );
     $prev_id = $part_id;
   }
@@ -1156,7 +1156,7 @@
       my $fs = $curr_part->{filesystem};
 
       # build a parted command to create the partition
-      &FAI::execute_command("parted -s $disk mkpart $part_type $fs ${start}B ${end}B");
+      &FAI::execute_command("parted -s $disk mkpart $part_type \"$fs\" ${start}B ${end}B");
     }
     warn "Partition table of disk $disk has been restored\n";
   }




More information about the Fai-commit mailing list