Non-canonical fstab lines need newline character after them.
authorRichard W.M. Jones <rjones@redhat.com>
Sat, 9 Feb 2008 13:32:19 +0000 (13:32 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Sat, 9 Feb 2008 13:32:19 +0000 (13:32 +0000)
 - /etc/fstab lines which don't match canonical form (eg. comments) were
   being written without a trailing \n, resulting in the following line
   being corrupted.  (Reported by Terry Johnson.)

virt-p2v

index ad9e159..755e4a8 100755 (executable)
--- a/virt-p2v
+++ b/virt-p2v
@@ -537,7 +537,8 @@ let rewrite_fstab state devices_to_send =
          fprintf chan "%-23s %-23s %-7s %-15s %s %s\n"
            dev mountpoint fstype options freq passno
       | line ->
-         output_string chan (String.concat " " line)
+         output_string chan (String.concat " " line);
+         output_char chan '\n'
     ) lines;
     close_out chan
   )