From 2088502e5793a79b4bc06d76d1b033b3631ecc8d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 2 Nov 2021 23:41:02 +0100 Subject: [PATCH] [libcalamares] Don't use QProcess directly outside of Runner --- src/libcalamares/utils/Permissions.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libcalamares/utils/Permissions.cpp b/src/libcalamares/utils/Permissions.cpp index 777b3c463..789746843 100644 --- a/src/libcalamares/utils/Permissions.cpp +++ b/src/libcalamares/utils/Permissions.cpp @@ -7,9 +7,9 @@ #include "Permissions.h" +#include "CalamaresUtilsSystem.h" #include "Logger.h" -#include #include #include @@ -105,7 +105,9 @@ Permissions::apply( const QString& path, const CalamaresUtils::Permissions& p ) // uid_t and gid_t values to pass to that system call. // // Do a lame cop-out and let the chown(8) utility do the heavy lifting. - if ( QProcess::execute( "chown", { p.username() + ':' + p.group(), path } ) ) + if ( CalamaresUtils::System::runCommand( { "chown", p.username() + ':' + p.group(), path }, + std::chrono::seconds( 3 ) ) + .getExitCode() ) { r = false; cDebug() << Logger::SubEntry << "Could not set owner of" << path << "to"