summaryrefslogtreecommitdiff
path: root/bin/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2011-08-28 15:37:31 +0000
committerChris Wilson <chris+github@qwirx.com>2011-08-28 15:37:31 +0000
commit65e163967902de4a607f315f0981f88d87fa0484 (patch)
treea5d131e75b53a0ad877170daaab7443eea8586cb /bin/bbackupd
parentbbd1f6d9539a4a399c20324c1fb6e01b6633c335 (diff)
Fix incorrect "conversion failed" message when logging NULL VSS parameter.
Fix log level of VSS component type to TRACE instead of INFO. Fix VSS path generation for absolute paths including drive letters.
Diffstat (limited to 'bin/bbackupd')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index 215c65a2..507ac377 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -118,11 +118,16 @@
std::string WideStringToString(WCHAR *buf)
{
+ if (buf == NULL)
+ {
+ return "(null)";
+ }
+
char* pStr = ConvertFromWideString(buf, CP_UTF8);
if(pStr == NULL)
{
- return "conversion failed";
+ return "(conversion failed)";
}
std::string result(pStr);
@@ -1250,9 +1255,9 @@ void BackupDaemon::CreateVssBackupComponents()
iComponent << " info:");
switch(pComponentInfo->type)
{
- case VSS_CT_UNDEFINED: BOX_INFO("VSS: type: undefined"); break;
- case VSS_CT_DATABASE: BOX_INFO("VSS: type: database"); break;
- case VSS_CT_FILEGROUP: BOX_INFO("VSS: type: filegroup"); break;
+ case VSS_CT_UNDEFINED: BOX_TRACE("VSS: type: undefined"); break;
+ case VSS_CT_DATABASE: BOX_TRACE("VSS: type: database"); break;
+ case VSS_CT_FILEGROUP: BOX_TRACE("VSS: type: filegroup"); break;
default:
BOX_WARNING("VSS: type: unknown (" << pComponentInfo->type << ")");
}
@@ -1334,6 +1339,19 @@ void BackupDaemon::CreateVssBackupComponents()
volumesIncluded[path[0]] = newVolumeId;
rLocation.mSnapshotVolumeId = newVolumeId;
rLocation.mIsSnapshotCreated = true;
+
+ // If the snapshot path starts with the volume root
+ // (drive letter), because the path is absolute (as
+ // it should be), then remove it so that the
+ // resulting snapshot path can be appended to the
+ // snapshot device object to make a real path,
+ // without a spurious drive letter in it.
+
+ if (path.substr(0, volumeRoot.length()) == volumeRoot)
+ {
+ path = path.substr(volumeRoot.length());
+ }
+
rLocation.mSnapshotPath = path;
}
else