forked from TrueCloudLab/restic
restic: restore timestamps after extended attributes
restoring the xattr containing resource forks on macOS apparently modifies the file modification timestamps. Thus, restore the timestamp after xattrs.
This commit is contained in:
parent
a5f2d0cf56
commit
61aaddac28
2 changed files with 14 additions and 7 deletions
7
changelog/unreleased/issue-4969
Normal file
7
changelog/unreleased/issue-4969
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Bugfix: Correctly restore timestamp for files with resource forks on macOS
|
||||||
|
|
||||||
|
On macOS, timestamps were incorrectly restored for files with resource forks.
|
||||||
|
This has been fixed.
|
||||||
|
|
||||||
|
https://github.com/restic/restic/issues/4969
|
||||||
|
https://github.com/restic/restic/pull/5006
|
|
@ -249,13 +249,6 @@ func (node Node) restoreMetadata(path string, warn func(msg string)) error {
|
||||||
firsterr = errors.WithStack(err)
|
firsterr = errors.WithStack(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := node.RestoreTimestamps(path); err != nil {
|
|
||||||
debug.Log("error restoring timestamps for dir %v: %v", path, err)
|
|
||||||
if firsterr == nil {
|
|
||||||
firsterr = err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := node.restoreExtendedAttributes(path); err != nil {
|
if err := node.restoreExtendedAttributes(path); err != nil {
|
||||||
debug.Log("error restoring extended attributes for %v: %v", path, err)
|
debug.Log("error restoring extended attributes for %v: %v", path, err)
|
||||||
if firsterr == nil {
|
if firsterr == nil {
|
||||||
|
@ -270,6 +263,13 @@ func (node Node) restoreMetadata(path string, warn func(msg string)) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := node.RestoreTimestamps(path); err != nil {
|
||||||
|
debug.Log("error restoring timestamps for %v: %v", path, err)
|
||||||
|
if firsterr == nil {
|
||||||
|
firsterr = err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Moving RestoreTimestamps and restoreExtendedAttributes calls above as for readonly files in windows
|
// Moving RestoreTimestamps and restoreExtendedAttributes calls above as for readonly files in windows
|
||||||
// calling Chmod below will no longer allow any modifications to be made on the file and the
|
// calling Chmod below will no longer allow any modifications to be made on the file and the
|
||||||
// calls above would fail.
|
// calls above would fail.
|
||||||
|
|
Loading…
Reference in a new issue