Skip to content

Commit

Permalink
[Fstab] Ignore docker overlay mounts
Browse files Browse the repository at this point in the history
Overlay fs are ignored as long as they are not mounted at '/' i.e a
livesystem, or by the user.

BUG: 422385
FIXED-IN: 5.78
  • Loading branch information
meven committed Jan 15, 2021
1 parent 0855b81 commit 4231d16
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/solid/devices/backends/fstab/fstabstorageaccess.cpp
Expand Up @@ -12,6 +12,7 @@
#include <QStringList>

#include <QProcess>
#include <QDir>
#include <QTimer>

#include <errno.h>
Expand All @@ -33,7 +34,19 @@ FstabStorageAccess::FstabStorageAccess(Solid::Backends::Fstab::FstabDevice *devi
m_filePath = currentMountPoints.first();
m_isAccessible = true;
}
m_isIgnored = FstabHandling::options(device->device()).contains(QLatin1String("x-gvfs-hide"));

const bool inUserPath = m_filePath.startsWith(QLatin1String("/media/")) ||
m_filePath.startsWith(QLatin1String("/run/media/")) ||
m_filePath.startsWith(QDir::homePath());

const bool gvfsHidden = FstabHandling::options(device->device()).contains(QLatin1String("x-gvfs-hide"));
const bool fsIsOverlay = FstabHandling::fstype(device->device()) == QLatin1String("overlay");

m_isIgnored = gvfsHidden ||
// ignore overlay fs not pointing to / or seemingly mounted by user
(fsIsOverlay &&
m_filePath != QLatin1String("/") &&
!inUserPath);

connect(device, SIGNAL(mtabChanged(QString)), this, SLOT(onMtabChanged(QString)));
QTimer::singleShot(0, this, SLOT(connectDBusSignals()));
Expand Down

0 comments on commit 4231d16

Please sign in to comment.