summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-04-05 23:32:17 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-04-05 23:32:17 +0000
commitf15a386511f669b2bb81c57032f458ff3e9e93a6 (patch)
treee001d9c444890c2b13a56d829c5bc9b38934202b /session.c
parentf327235f65b91e80f2d5db28678274f6a5d4def8 (diff)
downloadopenssh-git-f15a386511f669b2bb81c57032f458ff3e9e93a6.tar.gz
- stevesk@cvs.openbsd.org 2001/04/05 15:48:18
[canohost.c canohost.h session.c] move get_remote_name_or_ip() to canohost.[ch]; for portable. ok markus@
Diffstat (limited to 'session.c')
-rw-r--r--session.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/session.c b/session.c
index ac026e4f..5264ac18 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.69 2001/03/25 13:16:11 stevesk Exp $");
+RCSID("$OpenBSD: session.c,v 1.70 2001/04/05 15:48:18 stevesk Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -677,17 +677,6 @@ do_exec_pty(Session *s, const char *command)
}
}
-const char *
-get_remote_name_or_ip(void)
-{
- static const char *remote = "";
- if (utmp_len > 0)
- remote = get_canonical_hostname(options.reverse_mapping_check);
- if (utmp_len == 0 || strlen(remote) > utmp_len)
- remote = get_remote_ipaddr();
- return remote;
-}
-
/* administrative, login(1)-like work */
void
do_login(Session *s, const char *command)
@@ -726,7 +715,8 @@ do_login(Session *s, const char *command)
/* Record that there was a login on that tty from the remote host. */
record_login(pid, s->tty, pw->pw_name, pw->pw_uid,
- get_remote_name_or_ip(), (struct sockaddr *)&from);
+ get_remote_name_or_ip(utmp_len, options.reverse_mapping_check),
+ (struct sockaddr *)&from);
#ifdef USE_PAM
/*
@@ -1308,7 +1298,8 @@ do_child(Session *s, const char *command)
}
/* we have to stash the hostname before we close our socket. */
if (options.use_login)
- hostname = get_remote_name_or_ip();
+ hostname = get_remote_name_or_ip(utmp_len,
+ options.reverse_mapping_check);
/*
* Close the connection descriptors; note that this is the child, and
* the server will still have the socket open, and it is important