[Pkg-shadow-commits] r375 - in trunk/debian: . patches
Alexander Gattin
pkg-shadow-devel@lists.alioth.debian.org
Mon, 11 Jul 2005 14:28:07 +0000
Author: xrgtn-guest
Date: 2005-07-11 14:28:06 +0000 (Mon, 11 Jul 2005)
New Revision: 375
Modified:
trunk/debian/changelog
trunk/debian/patches/356_su-stop_cont-proxy
Log:
Modified 356_su-stop_cont-proxy to block TSTP, TTIN, TTOU, QUIT and HUP signals. Now they are handled the same as in newgrp.c; Closes: #317747
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2005-07-11 13:08:59 UTC (rev 374)
+++ trunk/debian/changelog 2005-07-11 14:28:06 UTC (rev 375)
@@ -7,6 +7,10 @@
See: #249372 (I don't claim the bug to be dealt with though --
it's still not clear whether the newly built "login" package for
Hurd is functional).
+ * Upstream bugs already fixed in upstream releases or CVS:
+ - Modified 356_su-stop_cont-proxy to block TSTP, TTIN, TTOU, QUIT
+ and HUP -- to do the same as in newgrp.c
+ Closes: #317747
-- Christian Perrier <bubulle@debian.org> Mon, 11 Jul 2005 01:05:36 +0300
Modified: trunk/debian/patches/356_su-stop_cont-proxy
===================================================================
--- trunk/debian/patches/356_su-stop_cont-proxy 2005-07-11 13:08:59 UTC (rev 374)
+++ trunk/debian/patches/356_su-stop_cont-proxy 2005-07-11 14:28:06 UTC (rev 375)
@@ -3,7 +3,7 @@
otherwise e.g. bash's "suspend" command won't work.
Status wrt upstream: Fixed in upstream the same way, with slightly different
- code inside run_shell(), since 4.0.5
+ code inside run_shell() and signal handlig, since 4.0.5
Notes: Affects only operation with CLOSE_SESSIONS=yes. When it's set to "no",
newgrp doesn't fork and create child process, it just calls exec(),
@@ -34,21 +34,48 @@
Closes: 314727
(suspend command from su shell fails to return to parent shell)
+ Upstream blocks all signals except INTR and ALRM, our code doesn't.
+ This led to problem with zsh as child shell. Zsh does not create
+ separate pgrp for itself and when suspends, it sends TSTP to parent
+ "su" process too. su had TSTP unblocked and default handler set
+ for it. I changed su.c to block TSTP (also TTIN, TTOU, QUIT and HUP,
+ -- the same as in newgrp.c)
+
+ Closes: 317747
+ (su -m / suspend / fg broken with zsh)
+
Index: shadow-4.0.3/src/su.c
===================================================================
---- shadow-4.0.3.orig/src/su.c 2005-06-20 11:15:03.000000000 +0300
-+++ shadow-4.0.3/src/su.c 2005-06-20 11:35:27.000000000 +0300
-@@ -737,7 +737,7 @@
+--- shadow-4.0.3.orig/src/su.c 2005-07-11 16:12:38.000000000 +0300
++++ shadow-4.0.3/src/su.c 2005-07-11 16:18:01.000000000 +0300
+@@ -739,9 +739,14 @@
around to close sessions */
if (getdef_bool("CLOSE_SESSIONS")) {
pid_t pid;
- int status;
+ int status, wpid;
- signal(SIGINT, SIG_IGN);
+- signal(SIGINT, SIG_IGN);
++ signal (SIGINT, SIG_IGN);
++ signal (SIGQUIT, SIG_IGN);
++ signal (SIGHUP, SIG_IGN);
++ signal (SIGTSTP, SIG_IGN);
++ signal (SIGTTIN, SIG_IGN);
++ signal (SIGTTOU, SIG_IGN);
pid = fork();
-@@ -754,7 +754,17 @@
- signal(SIGINT, SIG_DFL);
+
+ switch(pid) {
+@@ -753,10 +758,25 @@
+ pam_end(pamh, PAM_ABORT);
+ exit(1);
+ case 0: /* child */
+- signal(SIGINT, SIG_DFL);
++ signal (SIGINT, SIG_DFL);
++ signal (SIGQUIT, SIG_DFL);
++ signal (SIGHUP, SIG_DFL);
++ signal (SIGTSTP, SIG_DFL);
++ signal (SIGTTIN, SIG_DFL);
++ signal (SIGTTOU, SIG_DFL);
break;
default: /* parent */
- waitpid(pid, &status, 0);