summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-06-22 20:57:11 +1000
committerDamien Miller <djm@mindrot.org>2000-06-22 20:57:11 +1000
commit099f505f9526311e48f828e95d90d488fe237219 (patch)
tree38d1401b60647403fb082f38b5b632d13d1e4665 /session.c
parent2f02295d31a34820d2c5a862ffeffd0d042502b2 (diff)
- (djm) Automatically generate host key during "make install". Suggested
by Gary E. Miller <gem@rellim.com> - (djm) Paranoia before kill() system call
Diffstat (limited to 'session.c')
-rw-r--r--session.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/session.c b/session.c
index 64e240b73..002652303 100644
--- a/session.c
+++ b/session.c
@@ -1608,7 +1608,9 @@ session_close_by_channel(int id, void *arg)
1608 session_close(s); 1608 session_close(s);
1609 } else { 1609 } else {
1610 /* notify child, delay session cleanup */ 1610 /* notify child, delay session cleanup */
1611 if (kill(s->pid, (s->ttyfd == -1) ? SIGTERM : SIGHUP) < 0) 1611 if (s->pid <= 1)
1612 error("session_close_by_channel: Unsafe s->pid = %d", s->pid);
1613 else if (kill(s->pid, (s->ttyfd == -1) ? SIGTERM : SIGHUP) < 0)
1612 error("session_close_by_channel: kill %d: %s", 1614 error("session_close_by_channel: kill %d: %s",
1613 s->pid, strerror(errno)); 1615 s->pid, strerror(errno));
1614 } 1616 }