diff options
Diffstat (limited to 'meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch')
-rw-r--r-- | meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch | 48 |
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 @@ | |||
1 | From b6b68db896f9963558334aff7fca61adde4ec10f Mon Sep 17 00:00:00 2001 | ||
2 | From: Seebs <seebs@seebs.net> | ||
3 | Date: Thu, 13 Apr 2017 18:12:01 -0500 | ||
4 | Subject: Prevent bash from segfaulting when unloading pseudo | ||
5 | |||
6 | bash's extremely fancy internal awareness of how the environment looks | ||
7 | means that, if you directly call the underlying libc "unsetenv" on | ||
8 | a variable, bash can end up trying to access a null pointer. Fixing | ||
9 | this generically is actually rather hard; you can't really avoid | ||
10 | writing to environ on fork() or popen(), even if you change all | ||
11 | execv*() functions to use the execv*e() variants. So for now, instead | ||
12 | of unsetting the variable, set it to an empty string. | ||
13 | |||
14 | Thanks to Saur in IRC for spotting this and helping debug it. | ||
15 | |||
16 | Signed-off-by: Seebs <seebs@seebs.net> | ||
17 | |||
18 | Upstream-Status: Backport | ||
19 | |||
20 | diff --git a/ChangeLog.txt b/ChangeLog.txt | ||
21 | index 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> | ||
33 | diff --git a/pseudo_util.c b/pseudo_util.c | ||
34 | index 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 | -- | ||
47 | cgit v0.10.2 | ||
48 | |||