[luksbootkeyfile] Merge pull request #1888 from dalto8/trailingslash

Ensure that a trailing slash doesn't cause issues with an unencrypted /boot
This commit is contained in:
Adriaan de Groot 2022-02-21 11:43:11 +01:00 committed by GitHub
commit 240c89c585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,8 @@
#include "GlobalStorage.h"
#include "JobQueue.h"
#include <QDir>
LuksBootKeyFileJob::LuksBootKeyFileJob( QObject* parent )
: Calamares::CppJob( parent )
{
@ -162,7 +164,7 @@ hasUnencryptedSeparateBoot()
{
QVariantMap partitionMap = partition.toMap();
QString mountPoint = partitionMap.value( QStringLiteral( "mountPoint" ) ).toString();
if ( mountPoint == QStringLiteral( "/boot" ) )
if ( QDir::cleanPath( mountPoint ) == QStringLiteral( "/boot" ) )
{
return !partitionMap.contains( QStringLiteral( "luksMapperName" ) );
}