You've already forked macports-base
mirror of
https://github.com/macports/macports-base.git
synced 2026-07-12 18:18:43 -07:00
sip_copy_proc: guard use of CPU_SUBTYPE_ARM64E
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user