1 |
vapier 14/12/31 08:06:48 |
2 |
|
3 |
Added: zsh-5.0.7-pid-ns.patch |
4 |
Log: |
5 |
Add patch from upstream to fix behavior in new pid namespaces. |
6 |
|
7 |
(Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key D2E96200) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-shells/zsh/files/zsh-5.0.7-pid-ns.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/zsh/files/zsh-5.0.7-pid-ns.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/zsh/files/zsh-5.0.7-pid-ns.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: zsh-5.0.7-pid-ns.patch |
16 |
=================================================================== |
17 |
zsh and pid namespaces don't play very well together. Specifically, when zsh is |
18 |
launched inside a new pid namespace, it doesn't take ownership of the process |
19 |
group, causing things like SIGINT to be sent to the parent process. Upstream |
20 |
bug report here: http://www.zsh.org/mla/workers/2014/msg01769.html. |
21 |
|
22 |
The first chunk of this diff fixes this problem and has already been applied |
23 |
upstream: |
24 |
http://sourceforge.net/p/zsh/code/ci/0c4cb0cc1b527f4341f1a39a10f4120aa7c7d594/. |
25 |
|
26 |
The second chunk is a suggested fix for the warning that zsh prints when |
27 |
exiting: http://www.zsh.org/mla/workers/2014/msg01779.html. |
28 |
|
29 |
diff --git a/Src/jobs.c b/Src/jobs.c |
30 |
index a668b07..c6e1bce 100644 |
31 |
--- a/Src/jobs.c |
32 |
+++ b/Src/jobs.c |
33 |
@@ -2734,7 +2734,7 @@ acquire_pgrp(void) |
34 |
long ttpgrp; |
35 |
sigset_t blockset, oldset; |
36 |
|
37 |
- if ((mypgrp = GETPGRP()) > 0) { |
38 |
+ if ((mypgrp = GETPGRP()) >= 0) { |
39 |
long lastpgrp = mypgrp; |
40 |
sigemptyset(&blockset); |
41 |
sigaddset(&blockset, SIGTTIN); |
42 |
@@ -2779,8 +2779,11 @@ void |
43 |
release_pgrp(void) |
44 |
{ |
45 |
if (origpgrp != mypgrp) { |
46 |
- attachtty(origpgrp); |
47 |
- setpgrp(0, origpgrp); |
48 |
+ /* in linux pid namespaces, origpgrp may never have been set */ |
49 |
+ if (origpgrp) { |
50 |
+ attachtty(origpgrp); |
51 |
+ setpgrp(0, origpgrp); |
52 |
+ } |
53 |
mypgrp = origpgrp; |
54 |
} |
55 |
} |