[blivet v2] Relax the blivet device name requirements (#1183061)

Brian C. Lane bcl at redhat.com
Sat Jan 17 00:52:31 UTC 2015


On Fri, Jan 16, 2015 at 01:51:52PM -0500, David Shea wrote:
> Allow ., .., and /'s in all kinds of btrfs device.
> ---
>  blivet/devices/btrfs.py | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py
> index 13adbb4..b650854 100644
> --- a/blivet/devices/btrfs.py
> +++ b/blivet/devices/btrfs.py
> @@ -138,6 +138,11 @@ class BTRFSDevice(StorageDevice):
>              spec = super(BTRFSDevice, self).fstabSpec
>          return spec
>  
> +    @classmethod
> +    def isNameValid(cls, name):
> +        # Override StorageDevice.isNameValid to allow pretty much anything
> +        return not('\x00' in name)
> +
>  class BTRFSVolumeDevice(BTRFSDevice, ContainerDevice, RaidDevice):
>      _type = "btrfs volume"
>      vol_id = btrfs.MAIN_VOLUME_ID
> @@ -567,11 +572,6 @@ class BTRFSSubVolumeDevice(BTRFSDevice, RaidDevice):
>          data.name = self.name
>          data.preexist = self.exists
>  
> -    @classmethod
> -    def isNameValid(cls, name):
> -        # Override StorageDevice.isNameValid to allow /
> -        return not('\x00' in name or name == '.' or name == '..')
> -
>  class BTRFSSnapShotDevice(BTRFSSubVolumeDevice):
>      """ A btrfs snapshot pseudo-device.
>  
> -- 
> 2.1.0

Ack

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list