Commit 5d5f5e2e authored by Niels Möller's avatar Niels Möller

* src/server_pty.c (pty_open_slave): Removed call to setsid(),

moved to...
* src/unix_user.c (do_spawn): Call setsid(). Was previously done by
the pty code, and only in the pty case. Fix backported from lsh-1.5.

Rev: ChangeLog:1.527.2.7
Rev: NEWS:1.100.2.3
Rev: src/server_pty.c:1.22.2.1
Rev: src/unix_user.c:1.52.2.1
parent 1b507fd2
......@@ -2,6 +2,11 @@
* Released lsh-1.4.3.
* src/server_pty.c (pty_open_slave): Removed call to setsid(),
moved to...
* src/unix_user.c (do_spawn): Call setsid(). Was previously done by
the pty code, and only in the pty case. Fix backported from lsh-1.5.
* misc/mkdiff: Copied the script from the old lsh_1_2_BRANCH.
2003-09-19 Niels Mller <niels@s3.kth.se>
......
......@@ -7,6 +7,9 @@ News for the 1.4.3 release
failure in the handling of channel_open, and in the
experimental client SRP code.
Backported lshd setsid fix from lsh-1.5. Should call setsid
both in the pty and non-pty cases.
Updated the code to compile with automake-1.7.3 and
scsh-0.6.0.
......
......@@ -257,12 +257,6 @@ pty_open_slave(struct pty_info *pty)
int fd;
trace("pty_open_slave\n");
if (setsid() < 0)
{
werror("tty_setctty: setsid failed, already process group leader?\n"
" (errno = %i): %z\n", errno, STRERROR(errno));
return -1;
}
/* Open the slave. On Sys V, that also makes it our controlling tty. */
fd = open(lsh_get_cstring(pty->tty_name), O_RDWR);
......
......@@ -813,6 +813,14 @@ do_spawn(struct lsh_user *u,
trace("do_spawn: child after chdir\n");
/* We want to be a process group leader */
if (setsid() < 0)
{
werror("unix_user: setsid failed, already process group leader?\n"
" %e\n", errno);
_exit(EXIT_FAILURE);
}
#if WITH_PTY_SUPPORT
if (info->pty)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment