From b385059346a6011fab3bc293a82636e391bb03cc Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 27 Mar 2004 16:44:21 +1100 Subject: - (dtucker) [session.c] Bug #817: Clear loginmsg after fork to prevent duplicate login messages for mutli-session logins. ok djm@ --- ChangeLog | 6 +++++- session.c | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8de7fe330..72d15e12b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20040327 + - (dtucker) [session.c] Bug #817: Clear loginmsg after fork to prevent + duplicate login messages for mutli-session logins. ok djm@ + 20040322 - (djm) [sshd.c] Drop supplemental groups if started as root - (djm) OpenBSD CVS Sync @@ -918,4 +922,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3295 2004/03/21 22:40:01 djm Exp $ +$Id: ChangeLog,v 1.3296 2004/03/27 05:44:21 dtucker Exp $ diff --git a/session.c b/session.c index af2e71992..6ab3484e2 100644 --- a/session.c +++ b/session.c @@ -491,6 +491,13 @@ do_exec_no_pty(Session *s, const char *command) close(inout[0]); close(err[0]); + /* + * Clear loginmsg, since it's the child's responsibility to display + * it to the user, otherwise multiple sessions may accumulate + * multiple copies of the login messages. + */ + buffer_clear(&loginmsg); + /* * Enter the interactive session. Note: server_loop must be able to * handle the case that fdin and fdout are the same. -- cgit v1.2.3