diff options
author | Michele Calgaro <[email protected]> | 2019-08-25 11:21:21 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2020-10-17 10:48:29 +0800 |
commit | b54fcda719b94c629c11e9b3462f2c9a2c5a9666 (patch) | |
tree | b3541609fd0e5aca04427b1c4ff759a9390c77b9 /tdeioslave/media/mediamanager/tdehardwarebackend.cpp | |
parent | d34f23f403e82f352e4c5d4e20966bcba2bec8c6 (diff) | |
download | tdebase-b54fcda719b94c629c11e9b3462f2c9a2c5a9666.tar.gz tdebase-b54fcda719b94c629c11e9b3462f2c9a2c5a9666.zip |
tdeioslave media: fixed handling of mountable state for encrypted devices.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'tdeioslave/media/mediamanager/tdehardwarebackend.cpp')
-rw-r--r-- | tdeioslave/media/mediamanager/tdehardwarebackend.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp index dc780d455..74180ca9a 100644 --- a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp +++ b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp @@ -452,7 +452,7 @@ void TDEBackend::setVolumeProperties(Medium* medium) TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); - TDEStorageDevice * sdevice = hwdevices->findDiskByUID(medium->id()); + TDEStorageDevice *sdevice = hwdevices->findDiskByUID(medium->id()); if (!sdevice) { return; } @@ -465,7 +465,15 @@ void TDEBackend::setVolumeProperties(Medium* medium) medium->setEncrypted(false); } - medium->setMountable(true); + if (sdevice->isDiskOfType(TDEDiskDeviceType::LUKS) || sdevice->isDiskOfType(TDEDiskDeviceType::OtherCrypted) || + sdevice->fileSystemUsage().upper() == "RAID") { + // Encrypted disks or device underlying other devices are not mountable + medium->setMountable(false); + } + else { + medium->setMountable(true); + } + medium->setDeviceNode(sdevice->deviceNode()); medium->setMountPoint(sdevice->mountPath()); medium->setFsType(sdevice->fileSystemName()); @@ -785,7 +793,6 @@ void TDEBackend::setVolumeProperties(Medium* medium) } if (sdevice->isDiskOfType(TDEDiskDeviceType::MediaDevice)) { medium->setIconName("ipod" + MOUNTED_ICON_SUFFIX); - medium->setMountable(false); if (sdevice->vendorModel().upper().contains("IPOD") && KProtocolInfo::isKnownProtocol(TQString("ipod"))) { medium->setBaseURL("ipod:/"); medium->setMountable(true); @@ -829,7 +836,15 @@ bool TDEBackend::setFloppyProperties(Medium* medium) medium->setEncrypted(false); } - medium->setMountable(true); + if (sdevice->isDiskOfType(TDEDiskDeviceType::LUKS) || sdevice->isDiskOfType(TDEDiskDeviceType::OtherCrypted) || + sdevice->fileSystemUsage().upper() == "RAID") { + // Encrypted disks or device underlying other devices are not mountable + medium->setMountable(false); + } + else { + medium->setMountable(true); + } + medium->setDeviceNode(sdevice->deviceNode()); medium->setMountPoint(sdevice->mountPath()); medium->setFsType(sdevice->fileSystemName()); |