From 92b336c80c563e04b215c532e512772abd6e17e7 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Thu, 2 Apr 2026 03:21:25 -0700 Subject: [PATCH] tooling: ensure intercepts do not overwrite symlinks to cfg files Intercept-file writes could end up opening an existing vfs symlink back to the user's actual config instead of creating a new file in the vfs. --- src/core/toolsupport.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/toolsupport.cpp b/src/core/toolsupport.cpp index 8aa5ac9..585656e 100644 --- a/src/core/toolsupport.cpp +++ b/src/core/toolsupport.cpp @@ -177,6 +177,8 @@ void QmlToolingSupport::updateToolingFs( auto fileInfo = QFileInfo(path); if (!fileInfo.isFile()) continue; + if (scanner.fileIntercepts.contains(path)) continue; + auto spath = linkDir.filePath(name); auto sFileInfo = QFileInfo(spath); @@ -205,8 +207,10 @@ void QmlToolingSupport::updateToolingFs( } auto spath = linkDir.filePath(name); + QFile::remove(spath); + auto file = QFile(spath); - if (!file.open(QFile::ReadWrite | QFile::Text)) { + if (!file.open(QFile::ReadWrite | QFile::Text | QFile::NewOnly)) { qCCritical(logTooling) << "Failed to open injected file" << spath; continue; }