summaryrefslogtreecommitdiff
path: root/bin/bbackupd/BackupClientDirectoryRecord.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2011-10-11 23:08:01 +0000
committerChris Wilson <chris+github@qwirx.com>2011-10-11 23:08:01 +0000
commit70d8498d7b835d761898029e241d1b1a65f13f2e (patch)
tree76ec92dd8c4d5dc8fac6c4029f6e41e2ec8ffc45 /bin/bbackupd/BackupClientDirectoryRecord.cpp
parent1ff4e4c92d69c3ed83d93f96399f6a9bc34af3c6 (diff)
Fix excludions on VSS paths by converting back to original namespace before
checking for them. Also simplifies code.
Diffstat (limited to 'bin/bbackupd/BackupClientDirectoryRecord.cpp')
-rw-r--r--bin/bbackupd/BackupClientDirectoryRecord.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/bin/bbackupd/BackupClientDirectoryRecord.cpp b/bin/bbackupd/BackupClientDirectoryRecord.cpp
index ef17a23b..3d9dc4bb 100644
--- a/bin/bbackupd/BackupClientDirectoryRecord.cpp
+++ b/bin/bbackupd/BackupClientDirectoryRecord.cpp
@@ -309,6 +309,8 @@ void BackupClientDirectoryRecord::SyncDirectory(
// Stat file to get info
filename = MakeFullPath(rLocalPath, en->d_name);
+ std::string realFileName = ConvertVssPathToRealPath(filename,
+ rBackupLocation);
#ifdef WIN32
// Don't stat the file just yet, to ensure
@@ -331,7 +333,6 @@ void BackupClientDirectoryRecord::SyncDirectory(
}
#else // !WIN32
-
if(EMU_LSTAT(filename.c_str(), &file_st) != 0)
{
if(!(rParams.mrContext.ExcludeDir(
@@ -408,11 +409,9 @@ void BackupClientDirectoryRecord::SyncDirectory(
// File or symbolic link
// Exclude it?
- if(rParams.mrContext.ExcludeFile(filename))
+ if(rParams.mrContext.ExcludeFile(realFileName))
{
- rNotifier.NotifyFileExcluded(this,
- ConvertVssPathToRealPath(filename, rBackupLocation));
-
+ rNotifier.NotifyFileExcluded(this, realFileName);
// Next item!
continue;
}
@@ -425,10 +424,9 @@ void BackupClientDirectoryRecord::SyncDirectory(
// Directory
// Exclude it?
- if(rParams.mrContext.ExcludeDir(filename))
+ if(rParams.mrContext.ExcludeDir(realFileName))
{
- rNotifier.NotifyDirExcluded(this,
- ConvertVssPathToRealPath(filename, rBackupLocation));
+ rNotifier.NotifyDirExcluded(this, realFileName);
// Next item!
continue;
@@ -441,8 +439,7 @@ void BackupClientDirectoryRecord::SyncDirectory(
// http://social.msdn.microsoft.com/forums/en-US/windowscompatibility/thread/05d14368-25dd-41c8-bdba-5590bf762a68/
if (en->d_type & FILE_ATTRIBUTE_REPARSE_POINT)
{
- rNotifier.NotifyMountPointSkipped(this,
- ConvertVssPathToRealPath(filename, rBackupLocation));
+ rNotifier.NotifyMountPointSkipped(this, realFileName);
continue;
}
#endif
@@ -450,7 +447,7 @@ void BackupClientDirectoryRecord::SyncDirectory(
// Store on list
dirs.push_back(std::string(en->d_name));
}
- else
+ else // not a file or directory, what is it?
{
if (type == S_IFSOCK
# ifndef WIN32
@@ -461,17 +458,16 @@ void BackupClientDirectoryRecord::SyncDirectory(
// removed notification for these types
// see Debian bug 479145, no objections
}
- else if(rParams.mrContext.ExcludeFile(filename))
+ else if(rParams.mrContext.ExcludeFile(realFileName))
{
- rNotifier.NotifyFileExcluded(this,
- ConvertVssPathToRealPath(filename, rBackupLocation));
+ rNotifier.NotifyFileExcluded(this, realFileName);
}
else
{
- rNotifier.NotifyUnsupportedFileType(this,
- ConvertVssPathToRealPath(filename, rBackupLocation));
+ rNotifier.NotifyUnsupportedFileType(this,
+ realFileName);
SetErrorWhenReadingFilesystemObject(rParams,
- ConvertVssPathToRealPath(filename, rBackupLocation));
+ realFileName);
}
continue;