Record the real uid and gid of backed-up files #241

Merged
clawbot merged 1 commits from issue-216-record-file-ownership into next 2026-10-06 09:46:18 +02:00
1 Commits
Author SHA1 Message Date
sneak a77116675d Record the real uid and gid of backed-up files (closes #216)
check / check (pull_request) Successful in 5m51s
The scanner read uid and gid by asserting the stat result to an
interface with Uid() and Gid() methods. *syscall.Stat_t has Uid and Gid
fields, not methods, so the assertion never matched and every file,
directory and symlink was stored as 0:0; a restore as root then gave
everything to root. The scanner now reads the fields of
*syscall.Stat_t.

The first backup after this change re-reads every file not owned by
root, because its stored uid and gid no longer match the disk.

When the tests run as root, as in the Docker build, the new test
compares 0 with 0 and cannot catch the defect; a non-root run does.

Model: opus-5-5
2026-10-06 07:06:36 +00:00