]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: check alignment reset return codes
authorKarel Zak <kzak@redhat.com>
Mon, 2 Sep 2024 12:21:40 +0000 (14:21 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 2 Sep 2024 12:21:40 +0000 (14:21 +0200)
commitc9674e73a7fd96a19b45bb7756cc384dde846991
treeb0e29e796a8d503e1624164bf6269bd792fe4379
parent4877d7f61a72e46aba3fc52f347d1cd74124dba5
libfdisk: check alignment reset return codes

Traditionally, there was only recalculation based on disk properties.
However, since libfdisk now supports additional script headers to
modify the default alignment, we need to check return codes. This is
because users can specify nonsensical values. If we ignore the return
codes, the library will report the issue multiple times and
return an error to the application when creating a new disk label.

Old version:
  >>> Script header accepted.
  >>> Last LBA specified by script is out of range.
      Last LBA specified by script is out of range.
      Last LBA specified by script is out of range.
  Failed to apply script headers, disk label not created: Numerical result out of range

Fixed version:
  >>> Script header accepted.
  >>> Last LBA specified by script is out of range.
  Failed to apply script headers, disk label not created: Numerical result out of range.

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/alignment.c
libfdisk/src/context.c
libfdisk/src/gpt.c
libfdisk/src/label.c
libfdisk/src/script.c