From d1b2d9ba847c5c85cc36e9b6921ddfc00cf0ba6b Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sun, 8 Nov 2020 18:26:04 +0100 Subject: [PATCH 1/2] GIT_SILENT Upgrade release service version to 20.11.80. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5694bfc..34f53d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) # KDE Application Version, managed by release script set (RELEASE_SERVICE_VERSION_MAJOR "20") set (RELEASE_SERVICE_VERSION_MINOR "11") -set (RELEASE_SERVICE_VERSION_MICRO "70") +set (RELEASE_SERVICE_VERSION_MICRO "80") set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") project(kpmcore VERSION ${RELEASE_SERVICE_VERSION}) From 2e91730f7a428cff81443c66613570259180c173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 14 Nov 2020 00:55:29 +0000 Subject: [PATCH 2/2] Fix parsing fstab mountpoints when they contain spaces or tabs. If the name of the mount point contains spaces or tabs these can be escaped as `\040' and '\011' respectively. BUG: 428932 --- src/core/fstab.cpp | 20 ++++++++++++++++++-- src/core/fstab.h | 3 +++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/core/fstab.cpp b/src/core/fstab.cpp index 196deca..94f6534 100644 --- a/src/core/fstab.cpp +++ b/src/core/fstab.cpp @@ -83,7 +83,7 @@ FstabEntryList readFstabEntries( const QString& fstabPath ) // (5) pass number (optional, defaults to 0), no comment is allowed if omitted, // (#) comment (optional). auto fsSpec = splitLine.at(0); - auto mountPoint = splitLine.at(1); + auto mountPoint = unescapeSpaces(splitLine.at(1)); auto fsType = splitLine.at(2); auto options = splitLine.at(3); @@ -110,6 +110,22 @@ FstabEntryList readFstabEntries( const QString& fstabPath ) return fstabEntries; } +QString escapeSpaces(const QString& mountPoint) +{ + QString tmp = mountPoint; + tmp.replace(QStringLiteral(" "), QStringLiteral("\\040")); + tmp.replace(QStringLiteral("\t"), QStringLiteral("\\011")); + return tmp; +} + +QString unescapeSpaces(const QString& mountPoint) +{ + QString tmp = mountPoint; + tmp.replace(QStringLiteral("\\040"), QStringLiteral(" ")); + tmp.replace(QStringLiteral("\\011"), QStringLiteral("\t")); + return tmp; +} + void FstabEntry::setFsSpec(const QString& s) { d->m_fsSpec = s; @@ -262,7 +278,7 @@ static void writeEntry(QTextStream& s, const FstabEntry& entry, std::array FstabEntryList; +QString escapeSpaces(const QString& mountPoint); +QString unescapeSpaces(const QString& mountPoint); + LIBKPMCORE_EXPORT FstabEntryList readFstabEntries(const QString& fstabPath = QStringLiteral("/etc/fstab")); LIBKPMCORE_EXPORT QStringList possibleMountPoints(const QString& deviceNode, const QString& fstabPath = QStringLiteral("/etc/fstab")); LIBKPMCORE_EXPORT bool writeMountpoints(const FstabEntryList& fstabEntries, const QString& filename = QStringLiteral("/etc/fstab"));