]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: support unknown partition types in sfdisk scripts
authorKarel Zak <kzak@redhat.com>
Wed, 28 Jan 2015 08:57:03 +0000 (09:57 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 28 Jan 2015 08:57:03 +0000 (09:57 +0100)
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1183234
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.c
libfdisk/src/script.c

index f9f733b48ffa8623a4bd0a90ebd8bd8f0aeea03e..997623125ea364c76961216d4633cd82d46b4372 100644 (file)
@@ -715,9 +715,9 @@ static int command_parttype(struct sfdisk *sf, int argc, char **argv)
        if (sf->backup)
                backup_partition_table(sf, devname);
 
-       /* parse <type> and apply yo PT */
+       /* parse <type> and apply to PT */
        type = fdisk_label_parse_parttype(lb, typestr);
-       if (!type || fdisk_parttype_is_unknown(type))
+       if (!type)
                errx(EXIT_FAILURE, _("failed to parse %s partition type '%s'"),
                                fdisk_label_get_name(lb), typestr);
 
index 684c0140125138f434f5ec4c7232965868abbe37..5a89790d702ae5a871bd18533d0bebdcb90a3d9b 100644 (file)
@@ -697,7 +697,7 @@ static int parse_script_line(struct fdisk_script *dp, char *s)
                                        script_get_label(dp), type);
                        free(type);
 
-                       if (!pa->type || fdisk_parttype_is_unknown(pa->type)) {
+                       if (!pa->type) {
                                rc = -EINVAL;
                                fdisk_unref_parttype(pa->type);
                                pa->type = NULL;
@@ -843,7 +843,7 @@ static int parse_commas_line(struct fdisk_script *dp, char *s)
                                                script_get_label(dp), str);
                        free(str);
 
-                       if (!pa->type || fdisk_parttype_is_unknown(pa->type)) {
+                       if (!pa->type) {
                                rc = -EINVAL;
                                fdisk_unref_parttype(pa->type);
                                pa->type = NULL;