diff options
author | Kevin Steves <stevesk@cvs.openbsd.org> | 2001-04-05 15:48:20 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@cvs.openbsd.org> | 2001-04-05 15:48:20 +0000 |
commit | 8ed9c4e33e34e93bf3bbc709770f8fea219a527c (patch) | |
tree | 489eee700cd6c7ad7f82f5eb05ff4bb2f5e0df85 /usr.bin/ssh/session.c | |
parent | 37c8814707d75fdb8f7759cd2e19691f33af2076 (diff) |
move get_remote_name_or_ip() to canohost.[ch]; for portable. ok markus@
Diffstat (limited to 'usr.bin/ssh/session.c')
-rw-r--r-- | usr.bin/ssh/session.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c index 4d7e24c9c3b..66671dd0fd0 100644 --- a/usr.bin/ssh/session.c +++ b/usr.bin/ssh/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" @@ -620,17 +620,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) @@ -669,7 +658,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); /* Done if .hushlogin exists or a command given. */ if (command != NULL) @@ -971,7 +961,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 |