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

@@ -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)