From 099f505f9526311e48f828e95d90d488fe237219 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 22 Jun 2000 20:57:11 +1000 Subject: - (djm) Automatically generate host key during "make install". Suggested by Gary E. Miller - (djm) Paranoia before kill() system call --- session.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'session.c') 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) session_close(s); } else { /* notify child, delay session cleanup */ - if (kill(s->pid, (s->ttyfd == -1) ? SIGTERM : SIGHUP) < 0) + if (s->pid <= 1) + error("session_close_by_channel: Unsafe s->pid = %d", s->pid); + else if (kill(s->pid, (s->ttyfd == -1) ? SIGTERM : SIGHUP) < 0) error("session_close_by_channel: kill %d: %s", s->pid, strerror(errno)); } -- cgit v1.2.3