summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2016-02-16 03:37:48 +0000
committerDamien Miller <djm@mindrot.org>2016-02-17 16:37:55 +1100
commit5a0fcb77287342e2fc2ba1cee79b6af108973dc2 (patch)
tree64fca867a7acd47e6a0e6da78212e790981119eb /session.c
parent624fd395b559820705171f460dd33d67743d13d6 (diff)
upstream commit
add a "Close session" log entry (at loglevel=verbose) to correspond to the existing "Starting session" one. Also include the session id number to make multiplexed sessions more apparent. feedback and ok dtucker@ Upstream-ID: e72d2ac080e02774376325136e532cb24c2e617c
Diffstat (limited to 'session.c')
-rw-r--r--session.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/session.c b/session.c
index 26f474259..7a02500ab 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.278 2015/04/24 01:36:00 deraadt Exp $ */ 1/* $OpenBSD: session.c,v 1.280 2016/02/16 03:37:48 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -779,8 +779,8 @@ int
779do_exec(Session *s, const char *command) 779do_exec(Session *s, const char *command)
780{ 780{
781 int ret; 781 int ret;
782 const char *forced = NULL; 782 const char *forced = NULL, *tty = NULL;
783 char session_type[1024], *tty = NULL; 783 char session_type[1024];
784 784
785 if (options.adm_forced_command) { 785 if (options.adm_forced_command) {
786 original_command = command; 786 original_command = command;
@@ -815,13 +815,14 @@ do_exec(Session *s, const char *command)
815 tty += 5; 815 tty += 5;
816 } 816 }
817 817
818 verbose("Starting session: %s%s%s for %s from %.200s port %d", 818 verbose("Starting session: %s%s%s for %s from %.200s port %d id %d",
819 session_type, 819 session_type,
820 tty == NULL ? "" : " on ", 820 tty == NULL ? "" : " on ",
821 tty == NULL ? "" : tty, 821 tty == NULL ? "" : tty,
822 s->pw->pw_name, 822 s->pw->pw_name,
823 get_remote_ipaddr(), 823 get_remote_ipaddr(),
824 get_remote_port()); 824 get_remote_port(),
825 s->self);
825 826
826#ifdef SSH_AUDIT_EVENTS 827#ifdef SSH_AUDIT_EVENTS
827 if (command != NULL) 828 if (command != NULL)
@@ -2499,7 +2500,12 @@ session_close(Session *s)
2499{ 2500{
2500 u_int i; 2501 u_int i;
2501 2502
2502 debug("session_close: session %d pid %ld", s->self, (long)s->pid); 2503 verbose("Close session: user %s from %.200s port %d id %d",
2504 s->pw->pw_name,
2505 get_remote_ipaddr(),
2506 get_remote_port(),
2507 s->self);
2508
2503 if (s->ttyfd != -1) 2509 if (s->ttyfd != -1)
2504 session_pty_cleanup(s); 2510 session_pty_cleanup(s);
2505 free(s->term); 2511 free(s->term);