From 226bd85e9f57c9fd098a9ca02dc2b9221a1586a6 Mon Sep 17 00:00:00 2001 From: markus Date: Wed, 27 Oct 1999 23:34:53 +0000 Subject: ignore sigpipe, do not die if the client (ssh-add, ssh) dies, ok: niklas@ --- usr.bin/ssh/ssh-agent.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'usr.bin/ssh/ssh-agent.c') diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c index 2d33bc1c804..fbf02e3e875 100644 --- a/usr.bin/ssh/ssh-agent.c +++ b/usr.bin/ssh/ssh-agent.c @@ -14,7 +14,7 @@ The authentication agent program. */ #include "includes.h" -RCSID("$Id: ssh-agent.c,v 1.13 1999/10/27 16:37:45 deraadt Exp $"); +RCSID("$Id: ssh-agent.c,v 1.14 1999/10/27 23:34:53 markus Exp $"); #include "ssh.h" #include "rsa.h" @@ -530,6 +530,15 @@ main(int ac, char **av) exit(1); } + /* Create a new session and process group */ + if (setsid() < 0) { + perror("setsid failed"); + exit(1); + } + + /* Ignore if a client dies while we are sending a reply */ + signal(SIGPIPE, SIG_IGN); + sock = socket(AF_UNIX, SOCK_STREAM, 0); if (sock < 0) { -- cgit v1.2.3-59-g8ed1b