From d837599530449e03240e0e7d8c5aa2b8ef74b6ce Mon Sep 17 00:00:00 2001 From: sukibaby <163092272+sukibaby@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:47:35 -0800 Subject: [PATCH] Prevent leaking compilation path to log file The current code leaks the build path of the machine the game is compiled on --- src/RageFileDriverDirect.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/RageFileDriverDirect.cpp b/src/RageFileDriverDirect.cpp index 555eb4df88..99de7439da 100644 --- a/src/RageFileDriverDirect.cpp +++ b/src/RageFileDriverDirect.cpp @@ -165,24 +165,23 @@ bool RageFileDriverDirect::Remove( const RString &sPath_ ) RString sPath = sPath_; FDB->ResolvePath( sPath ); + RageFileManager::FileType type = this->GetFileType(sPath); switch( type ) { case RageFileManager::TYPE_FILE: - TRACE( ssprintf("remove '%s'", (m_sRoot + sPath).c_str()) ); if( DoRemove(m_sRoot + sPath) == -1 ) { - WARN( ssprintf("remove(%s) failed: %s", (m_sRoot + sPath).c_str(), strerror(errno)) ); + WARN("remove failed: " + sPath); return false; } FDB->DelFile( sPath ); return true; case RageFileManager::TYPE_DIR: - TRACE( ssprintf("rmdir '%s'", (m_sRoot + sPath).c_str()) ); if( DoRmdir(m_sRoot + sPath) == -1 ) { - WARN( ssprintf("rmdir(%s) failed: %s", (m_sRoot + sPath).c_str(), strerror(errno)) ); + WARN("rmdir failed: " + sPath); return false; } FDB->DelFile( sPath ); @@ -193,6 +192,7 @@ bool RageFileDriverDirect::Remove( const RString &sPath_ ) default: FAIL_M(ssprintf("Invalid FileType: %i", type)); + return false; } }