diff options
author | Chris Wilson <chris+github@qwirx.com> | 2010-02-21 22:09:37 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2010-02-21 22:09:37 +0000 |
commit | 0be7309c0ab3d25d9a1d49c16ff9361880566ab9 (patch) | |
tree | 1a58c3eb3ba7744e380398630b35a9aaf377bf64 /bin/bbackupquery/BackupQueries.cpp | |
parent | 366dbbb9e8a18d2b562472970ee034e92fcb005d (diff) |
Move the test for excluded dirs inside the emu_lstat failure, as
otherwise we don't know whether the file that we couldn't stat was
really a file or a directory, so we can't know whether it should have
been excluded, and the old code allowed dir excludes to make files
appear not to exist locally, and therefore tests to fail.
Diffstat (limited to 'bin/bbackupquery/BackupQueries.cpp')
-rw-r--r-- | bin/bbackupquery/BackupQueries.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp index d6b6bf91..15257fc3 100644 --- a/bin/bbackupquery/BackupQueries.cpp +++ b/bin/bbackupquery/BackupQueries.cpp @@ -1549,24 +1549,26 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, std::string storeDirPath(rStoreDir + "/" + localDirEn->d_name); - // Check whether dir is excluded before trying to - // stat it, to fix problems with .gvfs directories - // that are not readable by root causing compare - // to crash: - // http://lists.boxbackup.org/pipermail/boxbackup/2010-January/000013.html - if(rParams.IsExcludedDir(localDirPath)) - { - rParams.NotifyExcludedDir(localDirPath, - storeDirPath); - continue; - } - #ifndef HAVE_VALID_DIRENT_D_TYPE EMU_STRUCT_STAT st; if(EMU_LSTAT(localDirPath.c_str(), &st) != 0) { - THROW_EXCEPTION_MESSAGE(CommonException, - OSFileError, localDirPath); + // Check whether dir is excluded before trying + // to stat it, to fix problems with .gvfs + // directories that are not readable by root + // causing compare to crash: + // http://lists.boxbackup.org/pipermail/boxbackup/2010-January/000013.html + if(rParams.IsExcludedDir(localDirPath)) + { + rParams.NotifyExcludedDir(localDirPath, + storeDirPath); + continue; + } + else + { + THROW_EXCEPTION_MESSAGE(CommonException, + OSFileError, localDirPath); + } } // Entry -- file or dir? |