diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-06-19 07:43:31 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-06-19 07:43:31 +0000 |
commit | a0ec6550f6cac1bd50fd3978160b468a53fb6cca (patch) | |
tree | 13979d0d52ba3364a2e0d22da394f9d3bd8e5151 /lib | |
parent | f340dd4e4e2d398e040aa877ae61708690d1addd (diff) |
Larger buffer size for extended attributes, and better debugging.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/backupclient/BackupClientFileAttributes.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/backupclient/BackupClientFileAttributes.cpp b/lib/backupclient/BackupClientFileAttributes.cpp index 4bd359ac..ee8f94b0 100644 --- a/lib/backupclient/BackupClientFileAttributes.cpp +++ b/lib/backupclient/BackupClientFileAttributes.cpp @@ -465,7 +465,7 @@ void BackupClientFileAttributes::FillAttributesLink(StreamableMemBlock &outputBl void BackupClientFileAttributes::FillExtendedAttr(StreamableMemBlock &outputBlock, const char *Filename) { #ifdef HAVE_SYS_XATTR_H - int listBufferSize = 1000; + int listBufferSize = 10000; char* list = new char[listBufferSize]; try @@ -561,9 +561,25 @@ void BackupClientFileAttributes::FillExtendedAttr(StreamableMemBlock &outputBloc outputBlock.ResizeBlock(xattrSize); } - else if(listSize<0 && errno!=EOPNOTSUPP && errno!=EACCES) + else if(listSize<0) { - THROW_EXCEPTION(CommonException, OSFileError); + if(errno == EOPNOTSUPP || errno == EACCES) + { + // fail silently + } + else if(errno == ERANGE) + { + BOX_ERROR("Failed to read extended " + "attributes of " << Filename << + ": buffer too small, not backed up"); + } + else + { + BOX_LOG_SYS_ERROR("Failed to read extended " + "attributes of " << Filename << + ", not backed up"); + THROW_EXCEPTION(CommonException, OSFileError); + } } } catch(...) |