[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Tue Oct 6 19:50:22 UTC 2009


 .prev-version          |    2 +-
 NEWS                   |    6 ++++++
 cfg.mk                 |    2 +-
 gnulib                 |    2 +-
 libparted/labels/gpt.c |   12 +++++++-----
 5 files changed, 16 insertions(+), 8 deletions(-)

New commits:
commit baa53f6b4e41f27812eab5d20545a40886dee0a3
Author: Jim Meyering <meyering at redhat.com>
Date:   Tue Oct 6 20:38:19 2009 +0200

    post-release administrivia
    
    * NEWS: Add header line for next release.
    * .prev-version: Record previous version.
    * cfg.mk (old_NEWS_hash): Auto-update.

diff --git a/.prev-version b/.prev-version
index f8e233b..cd5ac03 100644
--- a/.prev-version
+++ b/.prev-version
@@ -1 +1 @@
-1.9.0
+2.0
diff --git a/NEWS b/NEWS
index ff25f88..7697487 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 GNU parted NEWS                                    -*- outline -*-
 
+* Noteworthy changes in release ?.? (????-??-??) [?]
+
+
 * Noteworthy changes in release 2.0 (2009-10-06) [beta]
 
 ** Improvements
diff --git a/cfg.mk b/cfg.mk
index 06d7285..3b35dc2 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -41,7 +41,7 @@ local-checks-to-skip = \
 # Now that we have better (check.mk) tests, make this the default.
 export VERBOSE = yes
 
-old_NEWS_hash = dba244ff41365956a9f702ad050262c0
+old_NEWS_hash = 5d0c8961833d95e7fb0d467596a8613f
 
 include $(srcdir)/dist-check.mk
 

commit 6b251fdac5a8211e319a946a9eaf24ea0f37b6ca
Author: Jim Meyering <meyering at redhat.com>
Date:   Tue Oct 6 20:29:16 2009 +0200

    version 2.0
    
    * NEWS: Record release date.

diff --git a/NEWS b/NEWS
index d4147ad..ff25f88 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 GNU parted NEWS                                    -*- outline -*-
 
-* Noteworthy changes in release ?.? (????-??-??) [?]
+* Noteworthy changes in release 2.0 (2009-10-06) [beta]
 
 ** Improvements
 

commit d6e9b3bbda5eb565b6031b5620e38cba871c6748
Author: Jim Meyering <meyering at redhat.com>
Date:   Tue Oct 6 20:10:00 2009 +0200

    gpt: don't malfunction on big-endian systems
    
    Numerous GPT tests would fail when run on e.g., big-endian PPC.
    * libparted/labels/gpt.c (gpt_read): Now that we use the
    SizeOfPartitionEntry member, be sure to convert from GPT's
    little-endian on-disk format to to CPU endianness.
    This bug was introduced via commit 14cce9b2, 2009-06-10, "gpt:
    fix gpt_read to read all of the partition entries correctly".
    * libparted/labels/gpt.c (_header_is_valid): Also convert it here.
    Add a test to ensure that the partition entry size is no larger
    than the slightly arbitrary UINT32_MAX/16.
    * NEWS (Bug fixes): Mention it.

diff --git a/NEWS b/NEWS
index 04741a2..d4147ad 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,9 @@ GNU parted NEWS                                    -*- outline -*-
 
 ** Bug fixes
 
+  big-endian systems can once again read GPT partition tables
+  [bug introduced in parted-1.9.0]
+
   ped_partition_is_busy no longer calls libparted's exception handler,
   since doing so caused trouble with anaconda/pyparted when operating on
   dmraid devices.
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index cc9bcdc..b4549ef 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -608,8 +608,10 @@ _header_is_valid (const PedDevice* dev, GuidPartitionTableHeader_t* gpt)
 	 * the SizeOfPartitionEntry must be a multiple of 8 and
 	 * no smaller than the size of the PartitionEntry structure.
 	 */
-	uint32_t sope = gpt->SizeOfPartitionEntry;
-	if (sope % 8 != 0 || sope < sizeof(GuidPartitionEntry_t) )
+	uint32_t sope = PED_LE32_TO_CPU (gpt->SizeOfPartitionEntry);
+	if (sope % 8 != 0
+            || sope < sizeof (GuidPartitionEntry_t)
+            || (UINT32_MAX >> 4) < sope)
 		return 0;
 
 	origcrc = gpt->HeaderCRC32;
@@ -911,7 +913,8 @@ gpt_read (PedDisk * disk)
 	if (!_parse_header (disk, gpt, &write_back))
 		goto error_free_gpt;
 
-	ptes_sectors = ped_div_round_up (gpt->SizeOfPartitionEntry
+	uint32_t p_ent_size = PED_LE32_TO_CPU (gpt->SizeOfPartitionEntry);
+	ptes_sectors = ped_div_round_up (p_ent_size
 					 * gpt_disk_data->entry_count,
 					 disk->dev->sector_size);
 
@@ -926,8 +929,7 @@ gpt_read (PedDisk * disk)
 
 	for (i = 0; i < gpt_disk_data->entry_count; i++) {
 		GuidPartitionEntry_t* pte
-		  = (GuidPartitionEntry_t*) ((char *)ptes + i
-					     * gpt->SizeOfPartitionEntry);
+		  = (GuidPartitionEntry_t*) ((char *)ptes + i * p_ent_size);
 		PedPartition* part;
 		PedConstraint* constraint_exact;
 

commit 1baf336173f209d2d23b29269e0a12b4522f7257
Author: Jim Meyering <meyering at redhat.com>
Date:   Tue Oct 6 16:56:45 2009 +0200

    build: update gnulib submodule to latest

diff --git a/gnulib b/gnulib
index e21985a..6f6420c 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit e21985ad14508137d75b0dccf064adfc4e5888c6
+Subproject commit 6f6420cc9705dcfa545a28c674fddf5703e72c86



More information about the Parted-commits mailing list