From c522004575dce503acdf74abd97c8073376bd1a8 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 12 Nov 2018 15:26:15 +0100 Subject: [PATCH] [partition] Mount fs read-only when searching for fstab Submitted by aliveafter1000 FIXES: #1044 CLOSES: #1050 --- src/modules/partition/core/PartUtils.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index e696a0569..b1b9ec9de 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -165,7 +165,7 @@ lookForFstabEntries( const QString& partitionPath ) QTemporaryDir mountsDir; mountsDir.setAutoRemove( false ); - int exit = QProcess::execute( "mount", { partitionPath, mountsDir.path() } ); + int exit = QProcess::execute( "mount", { "-o", "ro,noload", partitionPath, mountsDir.path() } ); if ( !exit ) // if all is well { QFile fstabFile( mountsDir.path() + "/etc/fstab" ); @@ -181,11 +181,7 @@ lookForFstabEntries( const QString& partitionPath ) } if ( QProcess::execute( "umount", { "-R", mountsDir.path() } ) ) - { cWarning() << "Could not unmount" << mountsDir.path(); - // There is stuff left in there, really don't remove - mountsDir.setAutoRemove( false ); - } } return fstabEntries;