vapier      14/12/31 08:06:48

  Added:                zsh-5.0.7-pid-ns.patch
  Log:
  Add patch from upstream to fix behavior in new pid namespaces.
  
  (Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key 
D2E96200)

Revision  Changes    Path
1.1                  app-shells/zsh/files/zsh-5.0.7-pid-ns.patch

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
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

Index: zsh-5.0.7-pid-ns.patch
===================================================================
zsh and pid namespaces don't play very well together.  Specifically, when zsh is
launched inside a new pid namespace, it doesn't take ownership of the process
group, causing things like SIGINT to be sent to the parent process.  Upstream
bug report here: http://www.zsh.org/mla/workers/2014/msg01769.html.

The first chunk of this diff fixes this problem and has already been applied
upstream:
http://sourceforge.net/p/zsh/code/ci/0c4cb0cc1b527f4341f1a39a10f4120aa7c7d594/.

The second chunk is a suggested fix for the warning that zsh prints when
exiting: http://www.zsh.org/mla/workers/2014/msg01779.html.

diff --git a/Src/jobs.c b/Src/jobs.c
index a668b07..c6e1bce 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -2734,7 +2734,7 @@ acquire_pgrp(void)
     long ttpgrp;
     sigset_t blockset, oldset;
 
-    if ((mypgrp = GETPGRP()) > 0) {
+    if ((mypgrp = GETPGRP()) >= 0) {
        long lastpgrp = mypgrp;
        sigemptyset(&blockset);
        sigaddset(&blockset, SIGTTIN);
@@ -2779,8 +2779,11 @@ void
 release_pgrp(void)
 {
     if (origpgrp != mypgrp) {
-       attachtty(origpgrp);
-       setpgrp(0, origpgrp);
+       /* in linux pid namespaces, origpgrp may never have been set */
+       if (origpgrp) {
+           attachtty(origpgrp);
+           setpgrp(0, origpgrp);
+       }
        mypgrp = origpgrp;
     }
 }




Reply via email to