Hello community,
here is the log from the commit of package parted for openSUSE:Factory checked in at 2015-10-01 09:27:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/parted (Old)
and /work/SRC/openSUSE:Factory/.parted.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "parted"
Changes:
--------
--- /work/SRC/openSUSE:Factory/parted/parted.changes 2015-06-04 08:59:58.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.parted.new/parted.changes 2015-10-01 09:27:11.000000000 +0200
@@ -1,0 +2,6 @@
+Thu Sep 10 09:18:30 UTC 2015 - fvogt(a)suse.com
+
+- Update parted-gpt-mbr-sync.patch to fix bsc#945068
+ Basically just a copy of gpt_alloc with minor modifications now
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ parted-gpt-mbr-sync.patch ++++++
--- /var/tmp/diff_new_pack.rYARt7/_old 2015-10-01 09:27:12.000000000 +0200
+++ /var/tmp/diff_new_pack.rYARt7/_new 2015-10-01 09:27:12.000000000 +0200
@@ -86,7 +86,7 @@
static PedDisk *
gpt_alloc (const PedDevice *dev)
{
-@@ -553,6 +609,36 @@ error:
+@@ -553,6 +609,50 @@ error:
}
static PedDisk *
@@ -99,18 +99,32 @@
+ disk = _ped_disk_alloc ((PedDevice *) dev, &gpt_sync_mbr_disk_type);
+ if (!disk)
+ goto error;
-+ disk->disk_specific = gpt_disk_data = ped_malloc (sizeof (GPTDiskData));
-+ if (!disk->disk_specific)
-+ goto error_free_disk;
+
+ data_start = 2 + GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / dev->sector_size;
+ data_end = dev->length - 2
+ - GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / dev->sector_size;
++
++ /* If the device is too small to accommodate GPT headers and one data
++ sector, reject it. */
++ if (data_end < data_start)
++ {
++ ped_exception_throw (PED_EXCEPTION_ERROR,
++ PED_EXCEPTION_OK,
++ _("device is too small for GPT"));
++ goto error_free_disk;
++ }
++
++ disk->disk_specific = gpt_disk_data = ped_malloc (sizeof (GPTDiskData));
++ if (!disk->disk_specific)
++ goto error_free_disk;
++
++ gpt_disk_data->AlternateLBA = dev->length - 1;
+ ped_geometry_init (&gpt_disk_data->data_area, dev, data_start,
+ data_end - data_start + 1);
+ gpt_disk_data->entry_count = GPT_DEFAULT_PARTITION_ENTRIES;
+ uuid_generate ((unsigned char *) &gpt_disk_data->uuid);
+ swap_uuid_and_efi_guid ((unsigned char *) (&gpt_disk_data->uuid));
++ gpt_disk_data->pmbr_boot = 0;
+ return disk;
+
+error_free_disk:
@@ -123,7 +137,7 @@
gpt_duplicate (const PedDisk *disk)
{
PedDisk *new_disk;
-@@ -963,7 +1049,7 @@ gpt_read (PedDisk *disk)
+@@ -963,7 +1063,7 @@ gpt_read (PedDisk *disk)
/* motivation: let the user decide about the pmbr... during
ped_disk_probe(), they probably didn't get a choice... */
@@ -132,7 +146,7 @@
goto error;
GuidPartitionTableHeader_t *gpt = NULL;
-@@ -1120,11 +1206,59 @@ error:
+@@ -1120,11 +1220,59 @@ error:
return 0;
}
@@ -193,7 +207,7 @@
/* The UEFI spec is not clear about what to do with the following
elements of the Protective MBR (pmbr): BootCode (0-440B),
UniqueMBRSignature (440B-444B) and Unknown (444B-446B).
-@@ -1138,6 +1272,8 @@ _write_pmbr (PedDevice *dev, bool pmbr_b
+@@ -1138,6 +1286,8 @@ _write_pmbr (PedDevice *dev, bool pmbr_b
memset (pmbr->PartitionRecord, 0, sizeof pmbr->PartitionRecord);
pmbr->Signature = PED_CPU_TO_LE16 (MSDOS_MBR_SIGNATURE);
@@ -202,7 +216,7 @@
pmbr->PartitionRecord[0].OSType = EFI_PMBR_OSTYPE_EFI;
pmbr->PartitionRecord[0].StartSector = 1;
pmbr->PartitionRecord[0].EndHead = 0xFE;
-@@ -1150,6 +1286,60 @@ _write_pmbr (PedDevice *dev, bool pmbr_b
+@@ -1150,6 +1300,60 @@ _write_pmbr (PedDevice *dev, bool pmbr_b
pmbr->PartitionRecord[0].SizeInLBA = PED_CPU_TO_LE32 (dev->length - 1UL);
if (pmbr_boot)
pmbr->PartitionRecord[0].BootIndicator = 0x80;
@@ -263,7 +277,7 @@
int write_ok = ped_device_write (dev, pmbr, GPT_PMBR_LBA,
GPT_PMBR_SECTORS);
-@@ -1269,7 +1459,7 @@ gpt_write (const PedDisk *disk)
+@@ -1269,7 +1473,7 @@ gpt_write (const PedDisk *disk)
ptes_crc = efi_crc32 (ptes, ptes_bytes);
/* Write protective MBR */
@@ -272,7 +286,7 @@
goto error_free_ptes;
/* Write PTH and PTEs */
-@@ -2034,6 +2224,38 @@ static PedDiskOps gpt_disk_ops =
+@@ -2034,6 +2238,38 @@ static PedDiskOps gpt_disk_ops =
PT_op_function_initializers (gpt)
};
@@ -311,7 +325,7 @@
static PedDiskType gpt_disk_type =
{
next: NULL,
-@@ -2042,16 +2264,26 @@ static PedDiskType gpt_disk_type =
+@@ -2042,16 +2278,26 @@ static PedDiskType gpt_disk_type =
features: PED_DISK_TYPE_PARTITION_NAME
};