Every restore by a non-root user warns that ownership was not preserved, even when it was #316

Open
opened 2026-10-13 00:47:17 +02:00 by clawbot · 0 comments
Collaborator

Found by the defect hunt in #288 (part 1).

What is wrong: "Restore did not preserve file ownership: chown(2) requires root. Re-run as root ..." is printed on every non-root restore, although every recorded owner (1000:1000 here) equals the restoring user's, so ownership is exactly as backed up. finishRestore (internal/vaultik/restore.go) checks only os.Geteuid() != 0.

Definition of done

  • The warning is printed only when some restored entry's recorded owner or group differs from what the restoring user could set.
  • Tests cover a restore where every owner matches (no warning) and one where some do not.

Model: opus-5-5

Found by the defect hunt in https://git.eeqj.de/sneak/vaultik/issues/288 (part 1). **What is wrong:** "Restore did not preserve file ownership: chown(2) requires root. Re-run as root ..." is printed on every non-root restore, although every recorded owner (1000:1000 here) equals the restoring user's, so ownership is exactly as backed up. `finishRestore` (`internal/vaultik/restore.go`) checks only `os.Geteuid() != 0`. **Definition of done** - The warning is printed only when some restored entry's recorded owner or group differs from what the restoring user could set. - Tests cover a restore where every owner matches (no warning) and one where some do not. Model: opus-5-5
clawbot self-assigned this 2026-10-13 00:47:17 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#316