From 52fd553bb91a389c616bb36db1d1e290c7d10657 Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Mon, 29 Jan 2018 14:38:48 -0500 Subject: [PATCH] Fixed 2 bugs in restoring extended attributes --- src/duplicacy_backupmanager.go | 3 +-- src/duplicacy_utils_others.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/duplicacy_backupmanager.go b/src/duplicacy_backupmanager.go index 06edad76..d112859e 100644 --- a/src/duplicacy_backupmanager.go +++ b/src/duplicacy_backupmanager.go @@ -918,9 +918,8 @@ func (manager *BackupManager) Restore(top string, revision int, inPlace bool, qu totalFileSize, downloadedFileSize, startDownloadingTime) { downloadedFileSize += file.Size downloadedFiles = append(downloadedFiles, file) - file.RestoreMetadata(fullPath, nil, setOwner) } - + file.RestoreMetadata(fullPath, nil, setOwner) } if deleteMode && len(patterns) == 0 { diff --git a/src/duplicacy_utils_others.go b/src/duplicacy_utils_others.go index 37ff4712..b3d9f2b0 100644 --- a/src/duplicacy_utils_others.go +++ b/src/duplicacy_utils_others.go @@ -69,7 +69,7 @@ func (entry *Entry) SetAttributesToFile(fullPath string) { newAttribute, found := entry.Attributes[name] if found { oldAttribute, _ := xattr.Getxattr(fullPath, name) - if bytes.Equal(oldAttribute, newAttribute) { + if !bytes.Equal(oldAttribute, newAttribute) { xattr.Setxattr(fullPath, name, newAttribute) } delete(entry.Attributes, name)