sip_copy_proc: guard use of CPU_SUBTYPE_ARM64E

This commit is contained in:
Joshua Root
2026-04-14 05:30:51 +10:00
parent 3ee66457f6
commit 50d9457147
+4
View File
@@ -299,6 +299,7 @@ static copy_needed_return_t copy_needed(const char *path, char *const argv[],
*
* See https://trac.macports.org/ticket/66358#comment:58.
*/
#ifdef CPU_SUBTYPE_ARM64E
static int strip_pointer_auth(const char *filepath) {
int fd = -1;
struct stat st;
@@ -433,6 +434,7 @@ out:
return result;
}
#endif /* CPU_SUBTYPE_ARM64E */
static int resign(const char *filepath) {
int result = -1;
@@ -704,10 +706,12 @@ static char *lazy_copy(const char *path, struct stat *in_st) {
}
#endif /* HAVE_COPYFILE */
#ifdef CPU_SUBTYPE_ARM64E
if (-1 == strip_pointer_auth(target_path_temp)) {
fprintf(stderr, "sip_copy_proc: strip_pointer_auth(%s) for source file %s failed\n", target_path_temp, path);
goto lazy_copy_out;
}
#endif
if (-1 == resign(target_path_temp)) {
fprintf(stderr, "sip_copy_proc: resign(%s) failed\n", target_path_temp);