this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update mldr to use mldr specifc DYLD_ROOT_PATH

+13 -5
+13 -5
src/startup/mldr/mldr.c
··· 215 215 216 216 size_t len = strlen(mldr_load_results.envp[i]) + 1; 217 217 218 - // Don't pass these special env vars down to userland 219 - #define SKIP_VAR(_name) \ 218 + #define ENV_VAR_MATCHES(_name) \ 220 219 (len > sizeof(_name) - 1 && strncmp(mldr_load_results.envp[i], _name, sizeof(_name) - 1) == 0) 221 220 221 + // Don't pass these special env vars down to userland 222 222 if ( 223 - SKIP_VAR("__mldr_bprefs=") || 224 - SKIP_VAR("__mldr_sockpath=") 223 + ENV_VAR_MATCHES("__mldr_bprefs=") || 224 + ENV_VAR_MATCHES("__mldr_sockpath=") 225 225 ) { 226 226 size_t len_after = 0; 227 227 const char* orig_envp_i_plus_one = mldr_load_results.envp[i + 1]; ··· 240 240 // we have to check this index again because it now points to a different string 241 241 --i; 242 242 continue; 243 + } 244 + // If we were passed __mldr_DYLD_ROOT_PATH, it is a special case of DYLD_ROOT_PATH needing to be set, 245 + // so we remove the prefix, so dyld reads it as DYLD_ROOT_PATH 246 + else if (ENV_VAR_MATCHES("__mldr_DYLD_ROOT_PATH=")) { 247 + const char* env_p = mldr_load_results.envp[i]; 248 + env_p += (sizeof("__mldr_") - 1); 249 + size_t len_remaining = strlen(env_p) + 1; 250 + memmove(mldr_load_results.envp[i], env_p, len_remaining); 243 251 } 244 252 } 245 253 ··· 519 527 sscanf(str, "%i", &lr->lifetime_pipe); 520 528 } 521 529 522 - str = getenv("DYLD_ROOT_PATH"); 530 + str = getenv("__mldr_DYLD_ROOT_PATH"); 523 531 524 532 if (str != NULL && lr->root_path == NULL) { 525 533 strncpy(root_path, str, sizeof(root_path) - 1);