- Fix off-by-one bug in parted(8) when displaying disk label (#235901)
This commit is contained in:
parent
e13022c01a
commit
cb95a1496c
25
parted-1.8.6-off-by-one.patch
Normal file
25
parted-1.8.6-off-by-one.patch
Normal file
@ -0,0 +1,25 @@
|
||||
--- parted-1.8.6/parted/parted.c.offbyone 2007-04-11 12:13:06.000000000 -0400
|
||||
+++ parted-1.8.6/parted/parted.c 2007-04-11 12:13:21.000000000 -0400
|
||||
@@ -1217,6 +1217,7 @@
|
||||
static int
|
||||
do_print (PedDevice** dev)
|
||||
{
|
||||
+ PedUnit default_unit;
|
||||
PedDisk* disk;
|
||||
Table* table;
|
||||
StrList* row;
|
||||
@@ -1303,11 +1304,12 @@
|
||||
}
|
||||
|
||||
start = ped_unit_format (*dev, 0);
|
||||
+ default_unit = ped_unit_get_default ();
|
||||
end = ped_unit_format_byte (*dev, (*dev)->length * (*dev)->sector_size
|
||||
- - 1 );
|
||||
+ - (default_unit == PED_UNIT_CHS || default_unit == PED_UNIT_CYLINDER));
|
||||
|
||||
if (opt_machine_mode) {
|
||||
- switch (ped_unit_get_default ()) {
|
||||
+ switch (default_unit) {
|
||||
case PED_UNIT_CHS: puts ("CHS;");
|
||||
break;
|
||||
case PED_UNIT_CYLINDER: puts ("CYL;");
|
29
parted.spec
29
parted.spec
@ -4,20 +4,24 @@
|
||||
Summary: The GNU disk partition manipulation program
|
||||
Name: parted
|
||||
Version: 1.8.6
|
||||
Release: 2%{?dist}
|
||||
Source: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.bz2
|
||||
|
||||
Patch0: %{name}-%{version}-warnings.patch
|
||||
Patch1: %{name}-%{version}-notransname.patch
|
||||
|
||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Release: 3%{?dist}
|
||||
License: GPL
|
||||
Group: Applications/System
|
||||
Source: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.bz2
|
||||
|
||||
Patch0: %{name}-1.8.6-warnings.patch
|
||||
Patch1: %{name}-1.8.6-notransname.patch
|
||||
Patch2: %{name}-1.8.6-off-by-one.patch
|
||||
|
||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: e2fsprogs-devel readline-devel ncurses-devel
|
||||
BuildRequires: automake libtool gettext-devel texinfo
|
||||
BuildRequires: device-mapper-devel, libselinux-devel libsepol-devel
|
||||
|
||||
Prereq: /sbin/install-info
|
||||
Requires(post): /sbin/ldconfig
|
||||
Requires(post): /sbin/install-info
|
||||
Requires(preun): /sbin/install-info
|
||||
Requires(postun): /sbin/ldconfig
|
||||
|
||||
%description
|
||||
The GNU Parted program allows you to create, destroy, resize, move,
|
||||
@ -39,6 +43,7 @@ Parted library, you need to install this package.
|
||||
%setup -q
|
||||
%patch0 -p1 -b .warnings
|
||||
%patch1 -p1 -b .notransname
|
||||
%patch2 -p1 -b .offbyone
|
||||
|
||||
%build
|
||||
%configure --enable-device-mapper --enable-selinux
|
||||
@ -60,10 +65,9 @@ Parted library, you need to install this package.
|
||||
/sbin/install-info %{_infodir}/parted.info.gz %{_infodir}/dir || :
|
||||
|
||||
%preun
|
||||
if [ "$1" = 0 ]; then
|
||||
/sbin/install-info --delete %{_infodir}/parted.info.gz %{_infodir}/dir
|
||||
if [ $1 = 0 ]; then
|
||||
/sbin/install-info --delete %{_infodir}/parted.info.gz %{_infodir}/dir >/dev/null 2>&1 || :
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
@ -86,6 +90,9 @@ exit 0
|
||||
%{_libdir}/pkgconfig/libparted.pc
|
||||
|
||||
%changelog
|
||||
* Wed Apr 11 2007 David Cantrell <dcantrell@redhat.com> - 1.8.6-3
|
||||
- Fix off-by-one bug in parted(8) when displaying disk label (#235901)
|
||||
|
||||
* Wed Mar 21 2007 David Cantrell <dcantrell@redhat.com> - 1.8.6-2
|
||||
- Do not translate partition name from disk label (#224182)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user