FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Development

 
 
LinkBack Thread Tools
 
Old 10-31-2008, 01:07 PM
David Lehman
 
Default fix a regression involving encrypted PVs

Hi,

I recently put in a patch that prevented us from marking as available
any encrypted PVs the user chose not to provide a passphrase for. The
unforeseen consequence, a result of the way we track information about
encrypted devices, was that if you give a passphrase for a preexisting
encrypted PV, delete it, then create a non-encrypted PV with the same
name (eg: sda2) the LVM button will reject you, saying you don't have
any available PVs. This is because the filtering I added for the first
case described is also erroneously catching this one. Following is a
patch that I have tested fairly thoroughly for the aforementioned
scenarios.

diff --git a/partitions.py b/partitions.py
index cfe770d..25af908 100644
--- a/partitions.py
+++ b/partitions.py
@@ -904,9 +904,14 @@ class Partitions:
for part in partedUtils.get_lvm_partitions(disk):
partname = partedUtils.get_partition_name(part)
partrequest = self.getRequestByDeviceName(partname)
- if partrequest.encryption is None and
cryptodev.isLuks("/dev/%s" % partname):
- # we don't want to treat encrypted an PV like a PV
if the
- # user chose not to provide a passphrase for this
device
+ if partrequest.encryption is None and
+ cryptodev.isLuks("/dev/%s" % partname) and
+ not self.encryptedDevices.get(partname):
+ log.debug("ignoring PV %s since we cannot access
it's contents" % partname)
+ # We don't want to treat encrypted an PV like a PV
if the
+ # user chose not to provide a passphrase for this
device.
+ # However, if the LUKS device belongs to a
just-deleted
+ # request then we know it is available.
continue
used = 0
for volgroup in volgroups:


Dave

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 10-31-2008, 08:14 PM
David Cantrell
 
Default fix a regression involving encrypted PVs

On Fri, Oct 31, 2008 at 09:07:16AM -0500, David Lehman wrote:
> Hi,
>
> I recently put in a patch that prevented us from marking as available
> any encrypted PVs the user chose not to provide a passphrase for. The
> unforeseen consequence, a result of the way we track information about
> encrypted devices, was that if you give a passphrase for a preexisting
> encrypted PV, delete it, then create a non-encrypted PV with the same
> name (eg: sda2) the LVM button will reject you, saying you don't have
> any available PVs. This is because the filtering I added for the first
> case described is also erroneously catching this one. Following is a
> patch that I have tested fairly thoroughly for the aforementioned
> scenarios.
>
> diff --git a/partitions.py b/partitions.py
> index cfe770d..25af908 100644
> --- a/partitions.py
> +++ b/partitions.py
> @@ -904,9 +904,14 @@ class Partitions:
> for part in partedUtils.get_lvm_partitions(disk):
> partname = partedUtils.get_partition_name(part)
> partrequest = self.getRequestByDeviceName(partname)
> - if partrequest.encryption is None and
> cryptodev.isLuks("/dev/%s" % partname):
> - # we don't want to treat encrypted an PV like a PV
> if the
> - # user chose not to provide a passphrase for this
> device
> + if partrequest.encryption is None and
> + cryptodev.isLuks("/dev/%s" % partname) and
> + not self.encryptedDevices.get(partname):
> + log.debug("ignoring PV %s since we cannot access
> it's contents" % partname)
> + # We don't want to treat encrypted an PV like a PV
> if the
> + # user chose not to provide a passphrase for this
> device.
> + # However, if the LUKS device belongs to a
> just-deleted
> + # request then we know it is available.
> continue
> used = 0
> for volgroup in volgroups:
>

Looks fine to me. Except, I'd say '...treat an encrypted...' in the comment
instead of '...treat encrypted an...'.

--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 03:53 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org