bug#34218: Partition name is not set by mkpart if compiled with --disable-debug

Oliver Mangold <[email protected]>
Newsgroups gmane.comp.gnu.parted.bugs
Message-ID <[email protected]>
Hi,

I noticed a long-standing bug, that the 'name' argument of mkpart seems to be ignored. It happens only with debug disabled on compilation '--disable-debug' (as e.g. Arch Linux does for its package). The reason is, that from parted.c the function ped_partition_set_name is called within an assert. I believe the code should be rather something like this (which works for me):

--- parted/parted.c.orig	2019-01-27 11:27:54.742081238 +0100
+++ parted/parted.c	2019-01-27 11:28:18.049039748 +0100
@@ -806,7 +806,8 @@
 
         /* set minor attributes */
         if (part_name)
-                PED_ASSERT (ped_partition_set_name (part, part_name));
+            if (!ped_partition_set_name (part, part_name))
+                goto error;
         free (part_name);  /* avoid double-free upon failure */
         part_name = NULL;
         if (!ped_partition_set_system (part, fs_type))
---

Best regards,

Oliver
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.