ソースを参照

fix SIGHUP handling (closes: #463030)

Michael Vogt 17 年 前
コミット
73e598c3ac
共有2 個のファイルを変更した6 個の追加0 個の削除を含む
  1. 5 0
      apt-pkg/deb/dpkgpm.cc
  2. 1 0
      debian/changelog

+ 5 - 0
apt-pkg/deb/dpkgpm.cc

@@ -778,6 +778,9 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       sighandler_t old_SIGQUIT = signal(SIGQUIT,SIG_IGN);
       sighandler_t old_SIGQUIT = signal(SIGQUIT,SIG_IGN);
       sighandler_t old_SIGINT = signal(SIGINT,SIG_IGN);
       sighandler_t old_SIGINT = signal(SIGINT,SIG_IGN);
 
 
+      // ignore SIGHUP as well (debian #463030)
+      sighandler_t old_SIGHUP = signal(SIGHUP,SIG_IGN);
+
       struct	termios tt;
       struct	termios tt;
       struct	termios tt_out;
       struct	termios tt_out;
       struct	winsize win;
       struct	winsize win;
@@ -889,6 +892,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
 	    // Restore sig int/quit
 	    // Restore sig int/quit
 	    signal(SIGQUIT,old_SIGQUIT);
 	    signal(SIGQUIT,old_SIGQUIT);
 	    signal(SIGINT,old_SIGINT);
 	    signal(SIGINT,old_SIGINT);
+	    signal(SIGINT,old_SIGHUP);
 	    return _error->Errno("waitpid","Couldn't wait for subprocess");
 	    return _error->Errno("waitpid","Couldn't wait for subprocess");
 	 }
 	 }
 
 
@@ -928,6 +932,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       // Restore sig int/quit
       // Restore sig int/quit
       signal(SIGQUIT,old_SIGQUIT);
       signal(SIGQUIT,old_SIGQUIT);
       signal(SIGINT,old_SIGINT);
       signal(SIGINT,old_SIGINT);
+      signal(SIGINT,old_SIGHUP);
 
 
       if(master >= 0) 
       if(master >= 0) 
       {
       {

+ 1 - 0
debian/changelog

@@ -30,6 +30,7 @@ apt (0.7.17) UNRELEASED; urgency=low
     - add missing checks for Owner == 0 in end()
     - add missing checks for Owner == 0 in end()
   * apt-pkg/deb/dpkgpm.cc:
   * apt-pkg/deb/dpkgpm.cc:
     - fix potential hang when in a backgroud process group
     - fix potential hang when in a backgroud process group
+    - fix SIGHUP handling (closes: #463030)
   
   
   [ Dereck Wonnacott ]
   [ Dereck Wonnacott ]
   * apt-ftparchive might write corrupt Release files (LP: #46439)
   * apt-ftparchive might write corrupt Release files (LP: #46439)