From 5ffc5c6f238c70735637035456a9484f4f0f41dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Wed, 5 Jan 2022 23:00:17 +0000 Subject: [PATCH] Fix davfs entries being omitted from fstab file. BUG: 447961 --- src/core/fstab.cpp | 6 ++++-- src/core/fstab.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/fstab.cpp b/src/core/fstab.cpp index 486046b..ad3324f 100644 --- a/src/core/fstab.cpp +++ b/src/core/fstab.cpp @@ -240,7 +240,8 @@ static QString findBlkIdDevice(const char *token, const QString& value) static void parseFsSpec(const QString& m_fsSpec, FstabEntry::Type& m_entryType, QString& m_deviceNode) { - m_entryType = FstabEntry::Type::comment; + m_entryType = FstabEntry::Type::other; + m_deviceNode = m_fsSpec; if (m_fsSpec.startsWith(QStringLiteral("UUID="))) { m_entryType = FstabEntry::Type::uuid; m_deviceNode = findBlkIdDevice("UUID", QString(m_fsSpec).remove(QStringLiteral("UUID="))); @@ -255,7 +256,8 @@ static void parseFsSpec(const QString& m_fsSpec, FstabEntry::Type& m_entryType, m_deviceNode = findBlkIdDevice("PARTLABEL", QString(m_fsSpec).remove(QStringLiteral("PARTLABEL="))); } else if (m_fsSpec.startsWith(QStringLiteral("/"))) { m_entryType = FstabEntry::Type::deviceNode; - m_deviceNode = m_fsSpec; + } else if (m_fsSpec.isEmpty()) { + m_entryType = FstabEntry::Type::comment; } } diff --git a/src/core/fstab.h b/src/core/fstab.h index 27880a5..be3efe4 100644 --- a/src/core/fstab.h +++ b/src/core/fstab.h @@ -26,7 +26,7 @@ struct FstabEntryPrivate; class LIBKPMCORE_EXPORT FstabEntry { public: - enum class Type { deviceNode, uuid, label, partlabel, partuuid, comment }; + enum class Type { deviceNode, uuid, label, partlabel, partuuid, comment, other }; FstabEntry(const QString& fsSpec, const QString& mountPoint, const QString& type, const QString& options, int dumpFreq = 0, int passNumber = 0, const QString& comment = QString());