- Timestamp:
- 10/02/2010 19:01:12 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/backupclient/BackupClientFileAttributes.cpp
r2493 r2604 235 235 if(mpClearAttributes->GetSize() != rAttr.mpClearAttributes->GetSize()) 236 236 { 237 BOX_TRACE("Attribute Compare: Attributes objects are " 238 "different sizes, cannot compare them: local " << 239 mpClearAttributes->GetSize() << " bytes, remote " << 240 rAttr.mpClearAttributes->GetSize() << " bytes"); 237 241 return false; 238 242 } … … 242 246 attr_StreamFormat *a1 = (attr_StreamFormat*)mpClearAttributes->GetBuffer(); 243 247 attr_StreamFormat *a2 = (attr_StreamFormat*)rAttr.mpClearAttributes->GetBuffer(); 244 245 if(a1->AttributeType != a2->AttributeType 246 || a1->UID != a2->UID 247 || a1->GID != a2->GID 248 || a1->UserDefinedFlags != a2->UserDefinedFlags 249 || a1->Mode != a2->Mode) 250 { 251 return false; 252 } 248 249 #define COMPARE(attribute, message) \ 250 if (a1->attribute != a2->attribute) \ 251 { \ 252 BOX_TRACE("Attribute Compare: " << message << " differ: " \ 253 "local " << a1->attribute << ", " \ 254 "remote " << a2->attribute); \ 255 return false; \ 256 } 257 COMPARE(AttributeType, "Attribute types"); 258 COMPARE(UID, "UIDs"); 259 COMPARE(GID, "GIDs"); 260 COMPARE(UserDefinedFlags, "User-defined flags"); 261 COMPARE(Mode, "Modes"); 253 262 254 263 if(!IgnoreModTime) … … 258 267 if(t1 != t2) 259 268 { 269 BOX_TRACE("Attribute Compare: File modification " 270 "times differ: local " << t1 << ", " 271 "remote " << t2); 260 272 return false; 261 273 } … … 268 280 if(t1 != t2) 269 281 { 282 BOX_TRACE("Attribute Compare: Attribute modification " 283 "times differ: local " << t1 << ", " 284 "remote " << t2); 270 285 return false; 271 286 } … … 277 292 { 278 293 // Symlink strings don't match. This also compares xattrs 279 if(::memcmp(a1 + 1, a2 + 1, size - sizeof(attr_StreamFormat)) != 0) 280 { 294 int datalen = size - sizeof(attr_StreamFormat); 295 296 if(::memcmp(a1 + 1, a2 + 1, datalen) != 0) 297 { 298 std::string s1((char *)(a1 + 1), datalen); 299 std::string s2((char *)(a2 + 1), datalen); 300 BOX_TRACE("Attribute Compare: Symbolic link target " 301 "or extended attributes differ: " 302 "local " << PrintEscapedBinaryData(s1) << ", " 303 "remote " << PrintEscapedBinaryData(s2)); 281 304 return false; 282 305 }
Note: See TracChangeset
for help on using the changeset viewer.
