From: David Zeuthen Date: Wed, 9 Nov 2011 18:17:19 +0000 (-0500) Subject: Refuse to change partition type to an extended partition X-Git-Tag: upstream/2.1.2~407 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a73e8055bf8cc83b556ca76cc9ff2662814ad49;p=platform%2Fupstream%2Fudisks2.git Refuse to change partition type to an extended partition Signed-off-by: David Zeuthen --- diff --git a/src/udiskslinuxpartition.c b/src/udiskslinuxpartition.c index 0897eaf..4058c6a 100644 --- a/src/udiskslinuxpartition.c +++ b/src/udiskslinuxpartition.c @@ -527,6 +527,15 @@ handle_set_type (UDisksPartition *partition, type); goto out; } + if (type_as_int == 0x05 || type_as_int == 0x0f || type_as_int == 0x85) + { + g_dbus_method_invocation_return_error (invocation, + UDISKS_ERROR, + UDISKS_ERROR_FAILED, + "Refusing to change partition type to that of an extended partition. " + "Delete the partition and create a new extended partition instead."); + goto out; + } command_line = g_strdup_printf ("sfdisk --change-id \"%s\" %d 0x%02x", escaped_device, udisks_partition_get_number (partition),