Browse Source

* excluded ram block devices from the "valid" list of devices (Closes: #196)

master
lars 13 years ago
parent
commit
b5c4eabc26
  1. 5
      src/cryptobox/core/blockdevice.py

5
src/cryptobox/core/blockdevice.py

@ -46,8 +46,10 @@ LOGGER = logging.getLogger("CryptoNAS")
DEFAULT_SYSBLOCK_DIR = '/sys/block'
DEFAULT_DEVNODE_DIR = '/dev'
MINIMUM_STORAGE_SIZE = 10
# defined device numbers: http://www.lanana.org/docs/device-list/devices.txt
MAJOR_DEVNUM_LOOP = 7
MAJOR_DEVNUM_FLOPPY = 2
MAJOR_DEVNUM_RAMDISK = 1
MAJOR_DEVNUM_MD_RAID = 9
## cache settings
@ -233,6 +235,9 @@ class Blockdevice:
## otherwise we would have a long timeout, while reading the devices
if (self.major == MAJOR_DEVNUM_FLOPPY):
return False
# we don't want to store data in ramdisks (e.g. /dev/ram0)
if (self.major == MAJOR_DEVNUM_RAMDISK):
return False
except TypeError:
return False
return True

Loading…
Cancel
Save