mirror of
https://github.com/restic/restic.git
synced 2025-08-12 18:47:42 +00:00
node: Make sure year of all timestamps is valid
Sometimes restic gets bogus timestamps which cannot be converted to JSON, because the stdlib JSON encoder returns an error if the year is not within [0, 9999]. We now make sure that we at least record _some_ timestamp and cap the year either to 0000 or 9999. Before, restic would refuse to save the file at all, so this improves the status quo. This fixes #2174 and #1173
This commit is contained in:
10
changelog/unreleased/issue-2174
Normal file
10
changelog/unreleased/issue-2174
Normal file
@@ -0,0 +1,10 @@
|
||||
Bugfix: Save files with invalid timestamps
|
||||
|
||||
When restic reads invalid timestamps (year is before 0000 or after 9999) it
|
||||
refused to read and archive the file. We've changed the behavior and will now
|
||||
save modified timestamps with the year set to either 0000 or 9999, the rest of
|
||||
the timestamp stays the same, so the file will be saved (albeit with a bogus
|
||||
timestamp).
|
||||
|
||||
https://github.com/restic/restic/issues/2174
|
||||
https://github.com/restic/restic/issues/1173
|
Reference in New Issue
Block a user