summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2011-01-09 01:56:36 +0000
committerChris Wilson <chris+github@qwirx.com>2011-01-09 01:56:36 +0000
commit204c4f55e5cfc25e12e5843d77248d6c9d4101f2 (patch)
tree1f51b9183fe88b2a9f447432ad4a6ffd2ea04bb5 /bin
parent7fdcbbe00e7df9bb1e4e9818d0fa6aff6c9a1d41 (diff)
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!
Diffstat (limited to 'bin')
-rw-r--r--bin/bbstored/BackupCommands.cpp11
1 files changed, 6 insertions, 5 deletions
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<ProtocolObject> BackupProtocolServerGetFile::DoCommand(BackupProto
std::auto_ptr<IOStream> 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<IOStream> combined;