Paul Whittaker writes:
authorEric Andersen <andersen@codepoet.org>
Sat, 24 Jul 2004 12:44:13 +0000 (12:44 -0000)
committerEric Andersen <andersen@codepoet.org>
Sat, 24 Jul 2004 12:44:13 +0000 (12:44 -0000)
With job control enabled, ash fails to tcsetpgrp back to initialpgrp
upon exit.  exitshell() should call setjobctl(0) to do this.

Context: I am using a lightweight menu system (replimenu[.sf.net]) on my
console, which invokes "/bin/sh -i -c /bin/login", where /bin/sh and
/bin/login are busybox applets.   /bin/sh is ash, with
CONFIG_ASH_JOB_CONTROL=y as the sole suboption.  The shell of the user
concerned (nobody) is also /bin/sh (ash).  When the user /bin/sh exits
(and thereby login and its parent sh), replimenu receives EIO when it
tries to read from the terminal.

shell/ash.c

index fd616ef4ab671edc4c70696ed06a0b54c2dcc7bb..ee3bfb42f98ee1c205d50c008854ffde1b3a6407 100644 (file)
@@ -11914,6 +11914,7 @@ exitshell(void)
                evalstring(p);
        }
        flushall();
+       setjobctl(0);
 #ifdef CONFIG_FEATURE_COMMAND_SAVEHISTORY
        if (iflag && rootshell) {
                const char *hp = lookupvar("HISTFILE");