]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: disable --activate for Hybrid GPT/MBR
authorKarel Zak <kzak@redhat.com>
Thu, 4 Oct 2018 12:06:45 +0000 (14:06 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 4 Oct 2018 12:06:45 +0000 (14:06 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/699
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.c

index 21fcfa68649ee808cfbc4cbff8f0c1fc2fb5ff68..3911dda850fce941fbf0a3c50b81ca50e8b742bc 100644 (file)
@@ -824,6 +824,9 @@ static int command_activate(struct sfdisk *sf, int argc, char **argv)
                err(EXIT_FAILURE, _("cannot open %s"), devname);
 
        if (fdisk_is_label(sf->cxt, GPT)) {
+               if (fdisk_gpt_is_hybrid(sf->cxt))
+                       errx(EXIT_FAILURE, _("toggle boot flags is unsupported for Hybrid GPT/MBR"));
+
                /* Switch from GPT to PMBR */
                sf->cxt = fdisk_new_nested_context(sf->cxt, "dos");
                if (!sf->cxt)