From 33b714c64ab91b37aec4a9e9f7293843e72cc56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Thu, 5 Oct 2023 14:46:23 +0300 Subject: [PATCH] Fix CTF with Integrity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not use filesystem functions with Integrity. Change-Id: I992f560bead00df7d2783359fcb9f38326a0072b Reviewed-by: Antti Määttä --- src/plugins/tracing/qctflib.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/tracing/qctflib.cpp b/src/plugins/tracing/qctflib.cpp index 6899ef88e3..dc8bd77bd4 100644 --- a/src/plugins/tracing/qctflib.cpp +++ b/src/plugins/tracing/qctflib.cpp @@ -14,7 +14,10 @@ #include #include #include "qctflib_p.h" + +#ifndef Q_OS_INTEGRITY #include +#endif QT_BEGIN_NAMESPACE @@ -118,6 +121,10 @@ QCtfLibImpl::QCtfLibImpl() m_session.tracepoints.append(allLiteral()); m_session.name = defaultLiteral(); } else { +#ifdef Q_OS_INTEGRITY + qCWarning(lcDebugTrace) << "Unable to use filesystem"; + return; +#endif // Check if the location is writable if (QT_ACCESS(qPrintable(location), W_OK) != 0) { qCWarning(lcDebugTrace) << "Unable to write to location"; @@ -161,7 +168,9 @@ QCtfLibImpl::QCtfLibImpl() m_session.name = defaultLiteral(); } m_location = location + u"/ust"; +#ifndef Q_OS_INTEGRITY std::filesystem::create_directory(qPrintable(m_location), qPrintable(location)); +#endif } clearLocation(); } @@ -176,6 +185,7 @@ QCtfLibImpl::QCtfLibImpl() void QCtfLibImpl::clearLocation() { +#ifndef Q_OS_INTEGRITY const std::filesystem::path location{qUtf16Printable(m_location)}; for (auto const& dirEntry : std::filesystem::directory_iterator{location}) { @@ -196,6 +206,7 @@ void QCtfLibImpl::clearLocation() } } } +#endif } void QCtfLibImpl::writeMetadata(const QString &metadata, bool overwrite)