Reject a retention duration longer than about 292 years #328

Merged
clawbot merged 1 commits from issue-289-duration-overflow into next 2026-10-13 01:51:25 +02:00
1 Commits
Author SHA1 Message Date
sneak 99e1cd4b2c Reject a retention duration longer than about 292 years (closes #289)
check / check (push) Successful in 15m42s
parseDuration multiplied each number by the length of its unit with no
limit, so from 293y (or 15251w, 3559mo, 106752d, or a sum such as
200y200y) the result wrapped to a negative duration. The purge cutoff
then lay in the future and every snapshot of the name was selected, for
--older-than and --keep-newer-than alike. Each part is now checked
before it is added, and a total past the largest time.Duration is
rejected as an invalid duration, so nothing is deleted. Go units were
already safe: time.ParseDuration rejects an overflow.

With --prune the backup still runs before the duration is read; only
the prune step fails.

Model: opus-5-5
2026-10-12 22:58:09 +00:00