[Box Backup-commit] COMMIT r2194 - box/trunk/lib/backupclient

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Thu Jun 19 08:43:32 BST 2008


Author: chris
Date: 2008-06-19 08:43:31 +0100 (Thu, 19 Jun 2008)
New Revision: 2194

Modified:
   box/trunk/lib/backupclient/BackupClientFileAttributes.cpp
Log:
Larger buffer size for extended attributes, and better debugging.


Modified: box/trunk/lib/backupclient/BackupClientFileAttributes.cpp
===================================================================
--- box/trunk/lib/backupclient/BackupClientFileAttributes.cpp	2008-06-15 21:00:21 UTC (rev 2193)
+++ box/trunk/lib/backupclient/BackupClientFileAttributes.cpp	2008-06-19 07:43:31 UTC (rev 2194)
@@ -465,7 +465,7 @@
 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 @@
 
 			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(...)




More information about the Boxbackup-commit mailing list