Rev 5067: (mbp, for gz) mask out sigquit in ssh child process so that breakin doesn't kill it in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Mar 2 06:41:41 GMT 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5067 [merge]
revision-id: pqm at pqm.ubuntu.com-20100302064136-g8xdfe3r16ck5p6q
parent: pqm at pqm.ubuntu.com-20100301172327-vlh6l9u4modihkau
parent: gzlist at googlemail.com-20100222235240-628sq1uti5whim27
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2010-03-02 06:41:36 +0000
message:
  (mbp, for gz) mask out sigquit in ssh child process so that breakin doesn't kill it
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/transport/ssh.py        ssh.py-20060824042150-0s9787kng6zv1nwq-1
=== modified file 'NEWS'
--- a/NEWS	2010-03-01 03:43:20 +0000
+++ b/NEWS	2010-03-02 06:41:36 +0000
@@ -99,6 +99,10 @@
 * Tolerate patches with leading noise in ``bzr-handle-patch``.
   (Toshio Kuratomi, Martin Pool, #502076)
 
+* SSH child processes will now ignore SIGQUIT on nix systems so breaking into
+  the debugger won't kill the session.
+  (Martin <gzlist at googlemail.com>, #162502)
+
 API Changes
 ***********
 

=== modified file 'bzrlib/transport/ssh.py'
--- a/bzrlib/transport/ssh.py	2010-02-17 17:11:16 +0000
+++ b/bzrlib/transport/ssh.py	2010-03-02 06:41:36 +0000
@@ -173,12 +173,15 @@
 register_ssh_vendor = _ssh_vendor_manager.register_vendor
 
 
-def _ignore_sigint():
+def _ignore_signals():
     # TODO: This should possibly ignore SIGHUP as well, but bzr currently
     # doesn't handle it itself.
     # <https://launchpad.net/products/bzr/+bug/41433/+index>
     import signal
     signal.signal(signal.SIGINT, signal.SIG_IGN)
+    # GZ 2010-02-19: Perhaps make this check if breakin is installed instead
+    if signal.getsignal(signal.SIGQUIT) != signal.SIG_DFL:
+        signal.signal(signal.SIGQUIT, signal.SIG_IGN)
 
 
 class SocketAsChannelAdapter(object):
@@ -634,7 +637,7 @@
         # Running it in a separate process group is not good because then it
         # can't get non-echoed input of a password or passphrase.
         # <https://launchpad.net/products/bzr/+bug/40508>
-        return {'preexec_fn': _ignore_sigint,
+        return {'preexec_fn': _ignore_signals,
                 'close_fds': True,
                 }
 




More information about the bazaar-commits mailing list