]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: (dos) ignore incomplete EBR for non-wholedisk
authorKarel Zak <kzak@redhat.com>
Tue, 24 Sep 2024 11:37:13 +0000 (13:37 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 24 Sep 2024 11:37:13 +0000 (13:37 +0200)
commit9f0e6584696de7533e5571107d03f3426a359138
treeee0b020538d7d4c52cfb090225f050d6520963ba
parentf56453448b9057d568ac908dabd79ef0ade6bed5
libfdisk: (dos) ignore incomplete EBR for non-wholedisk

The logical partitions are defined by a chain of extended partitions,
with the beginning of the chain located on the whole disk device.

If a user runs "fdisk --list /dev/sda4", libfdisk cannot calculate proper
offsets for the items in the chain, resulting in the following error
message:

 Failed to read extended partition table (offset=22528): Invalid argument

This error message may confuse users and is unnecessary when fdisk is
used in list-only mode (--list option). It would be sufficient to only
print the content of the partition without the error message and not
continue to the next item in the chain.

However, in write mode (without --list), the error message will still
be displayed as it is potentially dangerous to edit the EBR table.

Addresses: https://issues.redhat.com/browse/RHEL-59867
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/dos.c