<pre style='margin:0'>
Clemens Lang (neverpanic) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/070855f6b609f71e28b890567398b93338582aec">https://github.com/macports/macports-base/commit/070855f6b609f71e28b890567398b93338582aec</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 070855f6b609f71e28b890567398b93338582aec
</span>Author: Clemens Lang <cal@macports.org>
AuthorDate: Sat Dec 19 05:22:45 2020 +0100
<span style='display:block; white-space:pre;color:#404040;'> darwintrace: Drop DYLD_FORCE_FLAT_NAMESPACE=1
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This is no longer required since we switched to the interposing setup
</span><span style='display:block; white-space:pre;color:#404040;'> and was removed from other locations in macports base a while ago.
</span>---
src/darwintracelib1.0/proc.c | 20 ++------------------
1 file changed, 2 insertions(+), 18 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/darwintracelib1.0/proc.c b/src/darwintracelib1.0/proc.c
</span><span style='display:block; white-space:pre;color:#808080;'>index ed10a8d06..c4885fb91 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/darwintracelib1.0/proc.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/darwintracelib1.0/proc.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -60,14 +60,6 @@
</span> static char *__env_dyld_insert_libraries;
static char *__env_full_dyld_insert_libraries;
<span style='display:block; white-space:pre;background:#ffe0e0;'>-/**
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copy of the DYLD_FORCE_FLAT_NAMESPACE environment variable to restore it in
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * execve(2). DYLD_FORCE_FLAT_NAMESPACE=1 is needed for the preload-based
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * sandbox to work.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-static char *__env_dyld_force_flat_namespace;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-static char *__env_full_dyld_force_flat_namespace;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> /**
* Copy of the DARWINTRACE_LOG environment variable to restore it in execve(2).
* Contains the path to the unix socket used for communication with the
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -102,7 +94,6 @@ void __darwintrace_store_env() {
</span> } while (0)
COPYENV(DYLD_INSERT_LIBRARIES, __env_full_dyld_insert_libraries, __env_dyld_insert_libraries);
<span style='display:block; white-space:pre;background:#ffe0e0;'>- COPYENV(DYLD_FORCE_FLAT_NAMESPACE, __env_full_dyld_force_flat_namespace, __env_dyld_force_flat_namespace);
</span> COPYENV(DARWINTRACE_LOG, __env_full_darwintrace_log, __env_darwintrace_log);
#undef COPYENV
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -136,7 +127,6 @@ static inline bool __darwintrace_strbeginswith(const char *str, const char *pref
</span> static inline char **restore_env(char *const envp[]) {
// we can re-use pre-allocated strings from store_env
char *dyld_insert_libraries_ptr = __env_full_dyld_insert_libraries;
<span style='display:block; white-space:pre;background:#ffe0e0;'>- char *dyld_force_flat_namespace_ptr = __env_full_dyld_force_flat_namespace;
</span> char *darwintrace_log_ptr = __env_full_darwintrace_log;
char *const *enviter = envp;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -149,8 +139,8 @@ static inline char **restore_env(char *const envp[]) {
</span> enviter++;
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- // 4 is sufficient for the three variables we copy and the terminator
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- copy = malloc(sizeof(char *) * (envlen + 4));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // 3 is sufficient for the two variables we copy and the terminator
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ copy = malloc(sizeof(char *) * (envlen + 3));
</span>
enviter = envp;
copyiter = copy;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -160,9 +150,6 @@ static inline char **restore_env(char *const envp[]) {
</span> if (__darwintrace_strbeginswith(val, "DYLD_INSERT_LIBRARIES=")) {
val = dyld_insert_libraries_ptr;
dyld_insert_libraries_ptr = NULL;
<span style='display:block; white-space:pre;background:#ffe0e0;'>- } else if (__darwintrace_strbeginswith(val, "DYLD_FORCE_FLAT_NAMESPACE=")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- val = dyld_force_flat_namespace_ptr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- dyld_force_flat_namespace_ptr = NULL;
</span> } else if (__darwintrace_strbeginswith(val, "DARWINTRACE_LOG=")) {
val = darwintrace_log_ptr;
darwintrace_log_ptr = NULL;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -178,9 +165,6 @@ static inline char **restore_env(char *const envp[]) {
</span> if (dyld_insert_libraries_ptr) {
*copyiter++ = dyld_insert_libraries_ptr;
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if (dyld_force_flat_namespace_ptr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *copyiter++ = dyld_force_flat_namespace_ptr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> if (darwintrace_log_ptr) {
*copyiter++ = darwintrace_log_ptr;
}
</pre><pre style='margin:0'>
</pre>