Fixed 2 bugs in restoring extended attributes

This commit is contained in:
Gilbert Chen
2018-01-29 14:38:48 -05:00
parent 7230ddbef5
commit 52fd553bb9
2 changed files with 2 additions and 3 deletions

View File

@@ -918,9 +918,8 @@ func (manager *BackupManager) Restore(top string, revision int, inPlace bool, qu
totalFileSize, downloadedFileSize, startDownloadingTime) { totalFileSize, downloadedFileSize, startDownloadingTime) {
downloadedFileSize += file.Size downloadedFileSize += file.Size
downloadedFiles = append(downloadedFiles, file) downloadedFiles = append(downloadedFiles, file)
file.RestoreMetadata(fullPath, nil, setOwner)
} }
file.RestoreMetadata(fullPath, nil, setOwner)
} }
if deleteMode && len(patterns) == 0 { if deleteMode && len(patterns) == 0 {

View File

@@ -69,7 +69,7 @@ func (entry *Entry) SetAttributesToFile(fullPath string) {
newAttribute, found := entry.Attributes[name] newAttribute, found := entry.Attributes[name]
if found { if found {
oldAttribute, _ := xattr.Getxattr(fullPath, name) oldAttribute, _ := xattr.Getxattr(fullPath, name)
if bytes.Equal(oldAttribute, newAttribute) { if !bytes.Equal(oldAttribute, newAttribute) {
xattr.Setxattr(fullPath, name, newAttribute) xattr.Setxattr(fullPath, name, newAttribute)
} }
delete(entry.Attributes, name) delete(entry.Attributes, name)