- Copy needs_clobber value in ped_disk_duplicate() (#561976)

This commit is contained in:
Hans de Goede 2010-02-18 14:43:51 +00:00
parent eb899f72ea
commit febb3b2fab
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From 38fe6955c11a8bbcdda050401f46abe25dced000 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 18 Feb 2010 14:24:32 +0100
Subject: [PATCH parted] libparted: copy needs_clobber value in ped_disk_duplicate()
Most duplicate disk_ops use ped_disk_new_fresh, which sets needs_clobber
to 1. This would lead to clobbering the disk when committing a duplicate
disk even when the original disk was not made with ped_disk_new_fresh.
* libparted/disk.c (ped_disk_duplicate): copy needs_clobber value.
---
libparted/disk.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/libparted/disk.c b/libparted/disk.c
index b819d59..fc5ef17 100644
--- a/libparted/disk.c
+++ b/libparted/disk.c
@@ -276,6 +276,9 @@ ped_disk_duplicate (const PedDisk* old_disk)
}
if (!_disk_pop_update_mode (new_disk))
goto error_destroy_new_disk;
+
+ new_disk->needs_clobber = old_disk->needs_clobber;
+
return new_disk;
error_destroy_new_disk:
--
1.7.0

View File

@ -4,7 +4,7 @@
Summary: The GNU disk partition manipulation program
Name: parted
Version: 2.1
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv3+
Group: Applications/System
URL: http://www.gnu.org/software/parted
@ -15,6 +15,7 @@ Patch2: parted-2.1-mem-leak-fixes-rh556012.patch
Patch3: parted-2.1-default-alignment.patch
Patch4: parted-2.1-gpt-clobber-pmbr-rh563211.patch
Patch5: parted-2.1-dasd-NULL-dereference-rh563419.patch
Patch6: parted-2.1-needs_clobber-rh566181.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: e2fsprogs-devel
@ -59,6 +60,7 @@ Parted library, you need to install this package.
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
iconv -f ISO-8859-1 -t UTF8 AUTHORS > tmp; touch -r AUTHORS tmp; mv tmp AUTHORS
@ -134,6 +136,9 @@ fi
%changelog
* Thu Feb 18 2010 Hans de Goede <hdegoede@redhat.com> 2.1-5
- Copy needs_clobber value in ped_disk_duplicate() (#561976)
* Wed Feb 10 2010 Hans de Goede <hdegoede@redhat.com> 2.1-4
- Don't crash when reading a DASD disk with PV's on there (#563419)
- Don't overwrite the pmbr when merely printing a gpt table (#563211)