Allow reading LUKS label.

This commit is contained in:
Andrius Štikonas 2017-12-13 00:07:55 +00:00
parent e49a266922
commit 3f562ab0f0
1 changed files with 4 additions and 3 deletions

View File

@ -315,7 +315,7 @@ bool luks::cryptClose(const QString& deviceNode)
m_innerFs = nullptr;
m_passphrase.clear();
setLabel({});
setLabel(FileSystem::readLabel(deviceNode));
setUUID(readUUID(deviceNode));
setSectorsUsed(-1);
@ -468,11 +468,12 @@ QString luks::suggestedMapperName(const QString& deviceNode) const
return QStringLiteral("luks-") + readOuterUUID(deviceNode);
}
QString luks::readLabel(const QString&) const
QString luks::readLabel(const QString& deviceNode) const
{
if (m_isCryptOpen && m_innerFs)
return m_innerFs->readLabel(mapperName());
return QString();
return FileSystem::readLabel(deviceNode);
}
bool luks::writeLabel(Report& report, const QString&, const QString& newLabel)