Remove the subuid and subgid backups during the factory scrub

userdel rewrites /etc/subuid and /etc/subgid, and like every shadow-utils database write it leaves the previous contents behind in a dash-suffixed backup. The scrub removed four of the six backups those tools produce, so the retained @factory baseline still named the previous owner in /etc/subuid- and /etc/subgid- along with their subordinate ID range.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
omarchybotandClaude Opus 5 committed 2026-09-06 05:37:10 -07:00
1 parent a75924aca4
commit a00be8fa16
2 files changed
+5 -3

No files matched your search

+1 -1
View File
@@ -310,7 +310,7 @@ scrub_factory_accounts() {
# passwd --lock preserves the hash. Replace it, then remove the backups
# that userdel and usermod leave behind.
usermod --root "$root" --password '!' root >>"$LOG_FILE" 2>&1 || return 1
rm -f "$root/etc/"{shadow-,gshadow-,passwd-,group-}
rm -f "$root/etc/"{shadow-,gshadow-,passwd-,group-,subuid-,subgid-}
}
# Remove the seller's account material and machine identity from the retained