summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch')
-rw-r--r--meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch b/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch
new file mode 100644
index 0000000000..3045a3b736
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch
@@ -0,0 +1,48 @@
1From b6b68db896f9963558334aff7fca61adde4ec10f Mon Sep 17 00:00:00 2001
2From: Seebs <seebs@seebs.net>
3Date: Thu, 13 Apr 2017 18:12:01 -0500
4Subject: Prevent bash from segfaulting when unloading pseudo
5
6bash's extremely fancy internal awareness of how the environment looks
7means that, if you directly call the underlying libc "unsetenv" on
8a variable, bash can end up trying to access a null pointer. Fixing
9this generically is actually rather hard; you can't really avoid
10writing to environ on fork() or popen(), even if you change all
11execv*() functions to use the execv*e() variants. So for now, instead
12of unsetting the variable, set it to an empty string.
13
14Thanks to Saur in IRC for spotting this and helping debug it.
15
16Signed-off-by: Seebs <seebs@seebs.net>
17
18Upstream-Status: Backport
19
20diff --git a/ChangeLog.txt b/ChangeLog.txt
21index a2d30e9..8ba1ffa 100644
22--- a/ChangeLog.txt
23+++ b/ChangeLog.txt
24@@ -1,3 +1,8 @@
25+2017-04-13:
26+ * (seebs) don't unset LD_PRELOAD or the like, because if you
27+ do that, bash can segfault because it "knows" how many
28+ fields are in environ.
29+
30 2017-02-24:
31 * (seebs) import posix_acl_default fix from Anton Gerasimov
32 <anton@advancedtelematic.com>
33diff --git a/pseudo_util.c b/pseudo_util.c
34index 172990b..6a1fac2 100644
35--- a/pseudo_util.c
36+++ b/pseudo_util.c
37@@ -844,7 +844,7 @@ void pseudo_dropenv() {
38 if (ld_preload && strlen(ld_preload)) {
39 SETENV(PRELINK_LIBRARIES, ld_preload, 1);
40 } else {
41- UNSETENV(PRELINK_LIBRARIES);
42+ SETENV(PRELINK_LIBRARIES, "", 1);
43 }
44 }
45 }
46--
47cgit v0.10.2
48