From 204c4f55e5cfc25e12e5843d77248d6c9d4101f2 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 9 Jan 2011 01:56:36 +0000 Subject: Fix incorrect generation of temporary file name for applying patches while restoring old versions of files, many thanks to Matto Marjanovic for debugging this issue and submitting a patch! --- bin/bbstored/BackupCommands.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bin/bbstored') diff --git a/bin/bbstored/BackupCommands.cpp b/bin/bbstored/BackupCommands.cpp index 38cda234..c27cb7ab 100644 --- a/bin/bbstored/BackupCommands.cpp +++ b/bin/bbstored/BackupCommands.cpp @@ -388,11 +388,12 @@ std::auto_ptr BackupProtocolServerGetFile::DoCommand(BackupProto std::auto_ptr diff2(rContext.OpenObject(patchID)); // Choose a temporary filename for the result of the combination - std::ostringstream fs(rContext.GetStoreRoot()); - fs << ".recombinetemp."; - fs << p; - std::string tempFn(fs.str()); - tempFn = RaidFileController::DiscSetPathToFileSystemPath(rContext.GetStoreDiscSet(), tempFn, p + 16); + std::ostringstream fs; + fs << rContext.GetStoreRoot() << ".recombinetemp." << p; + std::string tempFn = + RaidFileController::DiscSetPathToFileSystemPath( + rContext.GetStoreDiscSet(), fs.str(), + p + 16); // Open the temporary file std::auto_ptr combined; -- cgit v1.2.3