summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-12-13 19:21:51 +1100
committerDamien Miller <djm@mindrot.org>2000-12-13 19:21:51 +1100
commit152cea206a2c0aba018be8a299e9b028fae2d3bc (patch)
treee82d40d14b13e1f9a58ffa7fb518b0c3d701fe5a /session.c
parente918d7966fcc34bb9e56a29096dcae202f71ba73 (diff)
- (djm) Make sure we reset the SIGPIPE disposition after we fork. Report
from Andreas M. Kirchwitz <amk@krell.zikzak.de>
Diffstat (limited to 'session.c')
-rw-r--r--session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/session.c b/session.c
index a0020d42..1e996f95 100644
--- a/session.c
+++ b/session.c
@@ -480,8 +480,6 @@ do_exec_no_pty(Session *s, const char *command, struct passwd * pw)
if (s == NULL)
fatal("do_exec_no_pty: no session");
- signal(SIGPIPE, SIG_DFL);
-
session_proctitle(s);
#ifdef USE_PAM
@@ -493,6 +491,8 @@ do_exec_no_pty(Session *s, const char *command, struct passwd * pw)
/* Child. Reinitialize the log since the pid has changed. */
log_init(__progname, options.log_level, options.log_facility, log_stderr);
+ signal(SIGPIPE, SIG_DFL);
+
/*
* Create a new session and process group since the 4.4BSD
* setlogin() affects the entire process group.
@@ -606,6 +606,8 @@ do_exec_pty(Session *s, const char *command, struct passwd * pw)
/* Child. Reinitialize the log because the pid has changed. */
log_init(__progname, options.log_level, options.log_facility, log_stderr);
+ signal(SIGPIPE, SIG_DFL);
+
/* Close the master side of the pseudo tty. */
close(ptyfd);