- Timestamp:
- 24/02/2010 19:23:14 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/backupclient/BackupClientFileAttributes.cpp
r2618 r2633 79 79 { 80 80 int32_t uid, gid, mode; 81 #ifdef WIN32 82 int64_t fileCreationTime; 83 #endif 81 84 } attributeHashData; 82 85 … … 222 225 // Function 223 226 // Name: BackupClientFileAttributes::Compare(const BackupClientFileAttributes &, bool) 224 // Purpose: Compare, optionally ignoring the attribute modification time and/or modification time, and some data which is 225 // irrelevant in practise (eg file generation number) 227 // Purpose: Compare, optionally ignoring the attribute 228 // modification time and/or modification time, and some 229 // data which is irrelevant in practise (eg file 230 // generation number) 226 231 // Created: 10/12/03 227 232 // 228 233 // -------------------------------------------------------------------------- 229 bool BackupClientFileAttributes::Compare(const BackupClientFileAttributes &rAttr, bool IgnoreAttrModTime, bool IgnoreModTime) const 234 bool BackupClientFileAttributes::Compare(const BackupClientFileAttributes &rAttr, 235 bool IgnoreAttrModTime, bool IgnoreModTime) const 230 236 { 231 237 EnsureClearAvailable(); … … 1071 1077 // 1072 1078 // Function 1073 // Name: BackupClientFileAttributes::GenerateAttributeHash(struct stat &, const std::string &, const std::string &) 1074 // Purpose: Generate a 64 bit hash from the attributes, used to detect changes. 1075 // Include filename in the hash, so that it changes from one file to another, 1076 // so don't reveal identical attributes. 1079 // Name: BackupClientFileAttributes::GenerateAttributeHash( 1080 // struct stat &, const std::string &, 1081 // const std::string &) 1082 // Purpose: Generate a 64 bit hash from the attributes, used to 1083 // detect changes. Include filename in the hash, so 1084 // that it changes from one file to another, so don't 1085 // reveal identical attributes. 1077 1086 // Created: 25/4/04 1078 1087 // 1079 1088 // -------------------------------------------------------------------------- 1080 uint64_t BackupClientFileAttributes::GenerateAttributeHash(EMU_STRUCT_STAT &st, const std::string &filename, const std::string &leafname) 1089 uint64_t BackupClientFileAttributes::GenerateAttributeHash(EMU_STRUCT_STAT &st, 1090 const std::string &filename, const std::string &leafname) 1081 1091 { 1082 1092 if(sAttributeHashSecretLength == 0) … … 1093 1103 hashData.mode = htonl(st.st_mode); 1094 1104 1105 #ifdef WIN32 1106 // On Windows, the "file attribute modification time" is the 1107 // file creation time, and we want to back this up, restore 1108 // it and compare it. 1109 // 1110 // On other platforms, it's not very important and can't 1111 // reliably be set to anything other than the current time. 1112 hashData.fileCreationTime = box_hton64(st.st_ctime); 1113 #endif 1114 1095 1115 StreamableMemBlock xattr; 1096 1116 FillExtendedAttr(xattr, filename.c_str()); … … 1101 1121 digest.Add(xattr.GetBuffer(), xattr.GetSize()); 1102 1122 digest.Add(leafname.c_str(), leafname.size()); 1103 digest.Add(sAttributeHashSecret, sAttributeHashSecretLength); 1123 digest.Add(sAttributeHashSecret, sAttributeHashSecretLength); 1104 1124 digest.Finish(); 1105 1125
Note: See TracChangeset
for help on using the changeset viewer.
