mirror of git://anongit.mindrot.org/openssh.git
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
This commit is contained in:
parent
624fd395b5
commit
5a0fcb7728
18
session.c
18
session.c
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: session.c,v 1.278 2015/04/24 01:36:00 deraadt Exp $ */
|
/* $OpenBSD: session.c,v 1.280 2016/02/16 03:37:48 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
* All rights reserved
|
* All rights reserved
|
||||||
|
@ -779,8 +779,8 @@ int
|
||||||
do_exec(Session *s, const char *command)
|
do_exec(Session *s, const char *command)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
const char *forced = NULL;
|
const char *forced = NULL, *tty = NULL;
|
||||||
char session_type[1024], *tty = NULL;
|
char session_type[1024];
|
||||||
|
|
||||||
if (options.adm_forced_command) {
|
if (options.adm_forced_command) {
|
||||||
original_command = command;
|
original_command = command;
|
||||||
|
@ -815,13 +815,14 @@ do_exec(Session *s, const char *command)
|
||||||
tty += 5;
|
tty += 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
verbose("Starting session: %s%s%s for %s from %.200s port %d",
|
verbose("Starting session: %s%s%s for %s from %.200s port %d id %d",
|
||||||
session_type,
|
session_type,
|
||||||
tty == NULL ? "" : " on ",
|
tty == NULL ? "" : " on ",
|
||||||
tty == NULL ? "" : tty,
|
tty == NULL ? "" : tty,
|
||||||
s->pw->pw_name,
|
s->pw->pw_name,
|
||||||
get_remote_ipaddr(),
|
get_remote_ipaddr(),
|
||||||
get_remote_port());
|
get_remote_port(),
|
||||||
|
s->self);
|
||||||
|
|
||||||
#ifdef SSH_AUDIT_EVENTS
|
#ifdef SSH_AUDIT_EVENTS
|
||||||
if (command != NULL)
|
if (command != NULL)
|
||||||
|
@ -2499,7 +2500,12 @@ session_close(Session *s)
|
||||||
{
|
{
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
debug("session_close: session %d pid %ld", s->self, (long)s->pid);
|
verbose("Close session: user %s from %.200s port %d id %d",
|
||||||
|
s->pw->pw_name,
|
||||||
|
get_remote_ipaddr(),
|
||||||
|
get_remote_port(),
|
||||||
|
s->self);
|
||||||
|
|
||||||
if (s->ttyfd != -1)
|
if (s->ttyfd != -1)
|
||||||
session_pty_cleanup(s);
|
session_pty_cleanup(s);
|
||||||
free(s->term);
|
free(s->term);
|
||||||
|
|
Loading…
Reference in New Issue