Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Preserve canonical paths when pinning firmware work directories

Lakr755b2309c583
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/KernelCache/KernelCacheVolumeCopy.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/KernelCache/KernelCacheVolumeCopy.swift
index 300e51e6..3a9f685a 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/KernelCache/KernelCacheVolumeCopy.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/KernelCache/KernelCacheVolumeCopy.swift
@@ -41,7 +41,7 @@ struct KernelCacheVolumeCopy {
kernel = volume.appending(path: "Library/Developer/KDKs/\(kdk)/System/Library/Kernels/kernel")
do {
// Refuses a symbolic link anywhere on the way to the stage.
- let source = try VPhoneConfinedDirectory.pin(absolutePath: staged.standardizedFileURL.path)
+ let source = try VPhoneConfinedDirectory.pin(absolutePath: staged.path)
let owner = try source.metadata().st_uid
guard owner == 0 || owner == VPhoneInvokingUser.current?.uid else {
throw PatcherError.invalidFormat("the staged kernelcache volume belongs to user \(owner), not to the invoking user")
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePatchWorkspace.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePatchWorkspace.swift
index 61596216..5b21b070 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePatchWorkspace.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePatchWorkspace.swift
@@ -21,7 +21,7 @@ public struct FirmwarePatchWorkspace {
guard mode & 0o077 == 0 || mode & 0o1777 == 0o1777 else {
throw PatcherError.invalidFormat("The firmware work parent must be private or sticky.")
}
- source = try VPhoneConfinedDirectory.pin(absolutePath: machine.standardizedFileURL.path)
+ source = try VPhoneConfinedDirectory.pin(absolutePath: machine.path)
let user = VPhoneInvokingUser.current
owner = (user?.uid ?? getuid(), user?.gid ?? getgid())
guard try source.metadata().st_uid == owner.uid else {