fix(admin): stop dry runs before resolving the target volume
This commit is contained in:
@@ -77,7 +77,7 @@ Creates a hidden local administrator account on the system without performing an
|
||||
1. Finds and mounts the macOS Data volume
|
||||
2. Unlocks FileVault if needed
|
||||
3. Creates an admin user with a custom username and password
|
||||
4. Adds the newly created user to FileVault
|
||||
4. Attempts FileVault integration when available; verify it after reboot
|
||||
5. Hides the account from the macOS login window via dscl
|
||||
6. Conceals the user's home directory in `/Users` using filesystem flags
|
||||
|
||||
|
||||
@@ -25,11 +25,14 @@
|
||||
run bash -u -c '
|
||||
source <(sed '\''/^main "\$@"$/d'\'' "$1")
|
||||
DRY_RUN=true
|
||||
is_recovery() { return 0; }
|
||||
resolve_data_volume() { echo TARGET_WAS_ACCESSED; }
|
||||
dscl_node() { echo ACCOUNT_STATE_WAS_ACCESSED; return 1; }
|
||||
admin_only_mode "/mock/Data volume"
|
||||
cmd_admin
|
||||
' "$script" "$script"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"[DRY RUN] Would create a local admin user"* ]]
|
||||
[[ "$output" != *"ACCOUNT_STATE_WAS_ACCESSED"* ]]
|
||||
[[ "$output" != *"TARGET_WAS_ACCESSED"* ]]
|
||||
done
|
||||
}
|
||||
|
||||
@@ -205,6 +205,10 @@ cmd_admin() {
|
||||
if ! is_recovery; then
|
||||
error_exit "Admin creation must run from Recovery mode."
|
||||
fi
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
admin_only_mode "the selected Data volume"
|
||||
return
|
||||
fi
|
||||
header "Create Local Admin User"
|
||||
local data_mount
|
||||
data_mount=$(resolve_data_volume)
|
||||
|
||||
@@ -2988,6 +2988,10 @@ cmd_admin() {
|
||||
if ! is_recovery; then
|
||||
error_exit "Admin creation must run from Recovery mode."
|
||||
fi
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
admin_only_mode "the selected Data volume"
|
||||
return
|
||||
fi
|
||||
header "Create Local Admin User"
|
||||
local data_mount
|
||||
data_mount=$(resolve_data_volume)
|
||||
|
||||
Reference in New Issue
Block a user