diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 19 |
1 files changed, 5 insertions, 14 deletions
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.69 2001/03/25 13:16:11 stevesk Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.70 2001/04/05 15:48:18 stevesk Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -677,17 +677,6 @@ do_exec_pty(Session *s, const char *command) | |||
677 | } | 677 | } |
678 | } | 678 | } |
679 | 679 | ||
680 | const char * | ||
681 | get_remote_name_or_ip(void) | ||
682 | { | ||
683 | static const char *remote = ""; | ||
684 | if (utmp_len > 0) | ||
685 | remote = get_canonical_hostname(options.reverse_mapping_check); | ||
686 | if (utmp_len == 0 || strlen(remote) > utmp_len) | ||
687 | remote = get_remote_ipaddr(); | ||
688 | return remote; | ||
689 | } | ||
690 | |||
691 | /* administrative, login(1)-like work */ | 680 | /* administrative, login(1)-like work */ |
692 | void | 681 | void |
693 | do_login(Session *s, const char *command) | 682 | do_login(Session *s, const char *command) |
@@ -726,7 +715,8 @@ do_login(Session *s, const char *command) | |||
726 | 715 | ||
727 | /* Record that there was a login on that tty from the remote host. */ | 716 | /* Record that there was a login on that tty from the remote host. */ |
728 | record_login(pid, s->tty, pw->pw_name, pw->pw_uid, | 717 | record_login(pid, s->tty, pw->pw_name, pw->pw_uid, |
729 | get_remote_name_or_ip(), (struct sockaddr *)&from); | 718 | get_remote_name_or_ip(utmp_len, options.reverse_mapping_check), |
719 | (struct sockaddr *)&from); | ||
730 | 720 | ||
731 | #ifdef USE_PAM | 721 | #ifdef USE_PAM |
732 | /* | 722 | /* |
@@ -1308,7 +1298,8 @@ do_child(Session *s, const char *command) | |||
1308 | } | 1298 | } |
1309 | /* we have to stash the hostname before we close our socket. */ | 1299 | /* we have to stash the hostname before we close our socket. */ |
1310 | if (options.use_login) | 1300 | if (options.use_login) |
1311 | hostname = get_remote_name_or_ip(); | 1301 | hostname = get_remote_name_or_ip(utmp_len, |
1302 | options.reverse_mapping_check); | ||
1312 | /* | 1303 | /* |
1313 | * Close the connection descriptors; note that this is the child, and | 1304 | * Close the connection descriptors; note that this is the child, and |
1314 | * the server will still have the socket open, and it is important | 1305 | * the server will still have the socket open, and it is important |