Skip to content

stub: avoid copying admin users onto itself - #437

Open
princeramanii wants to merge 1 commit into
AsahiLinux:mainfrom
princeramanii:codex/fix-recovery-admin-users
Open

stub: avoid copying admin users onto itself#437
princeramanii wants to merge 1 commit into
AsahiLinux:mainfrom
princeramanii:codex/fix-recovery-admin-users

Conversation

@princeramanii

Copy link
Copy Markdown

When the installer runs from the stub recoveryOS, the current OS and repair target can refer to the same Preboot volume. Copying AdminUserRecoveryInfo.plist then raises SameFileError and aborts the repair.

Skip the copy when both paths refer to the same file, while continuing to collect the admin metadata and restore the immutable flag. The normal repair path still copies updated owner credentials from a different source.

The two regression tests cover both cases and run in the existing build workflow.

Tested with: python3 -m unittest discover -s tests -v

Closes #353
Closes #420

When the installer runs from the stub recoveryOS, cur_os may refer to
the same Preboot volume as the repair target. shutil.copy then raises
SameFileError and aborts the repair.

Skip the copy when both paths refer to the same file. Keep metadata
collection and immutable flag handling unchanged.

Closes: AsahiLinux#353
Closes: AsahiLinux#420
Signed-off-by: Prince Ramani <139647088+princeramanii@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant