Repository navigation
diff: fix --numeric-ids having no effect (1.4-maint) - #10598
Merged
ThomasWaldmann merged 1 commit intoNov 5, 2026
Merged
Conversation
The option was parsed but never used: compare_archives_iter() built each ItemDiff without passing numeric_ids, so ItemDiff always compared and reported the user/group names, never uid/gid. Thread numeric_ids from the CLI through compare_archives_iter() into ItemDiff, and add a test asserting that with --numeric-ids the owner changes compare and report numeric uid/gid instead of names. Backport of borgbackup#10243 (master commit ace8174). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #10243 to
1.4-maint.Problem
borg diff --numeric-idshad no effect: the option was parsed (dest='numeric_ids'), butdo_diffnever usedargs.numeric_ids.Archive.compare_archives_iter()built eachItemDiffwithout passingnumeric_ids, soItemDiffalways used its default (False) and always compared and reported user/group names, never uid/gid.Fix
Thread
numeric_idsfrom the CLI throughcompare_archives_iter()intoItemDiff.ItemDiffalready implemented both behaviors; the flag just never reached it. Hand-ported because 1.4 has the monolithicarchiver.py, kept textually close to master. No.pyxchanges.Tests
New
DiffArchiverTestCase.test_numeric_idsintestsuite/archiver.py. A non-root test can't produce owner differences viaborg create, so it injects rawItems with crafted owner metadata directly into two archives (same technique as_create_malicious_archive). It covers both directions:--numeric-ids--numeric-idstheownerJSON entry carries the integer idsThe test fails on
1.4-maintwithout the fix and passes with it.🤖 Generated with Claude Code