]> andersk Git - openssh.git/commitdiff
- stevesk@cvs.openbsd.org 2001/04/05 15:48:18
authormouring <mouring>
Thu, 5 Apr 2001 23:32:17 +0000 (23:32 +0000)
committermouring <mouring>
Thu, 5 Apr 2001 23:32:17 +0000 (23:32 +0000)
     [canohost.c canohost.h session.c]
     move get_remote_name_or_ip() to canohost.[ch]; for portable.  ok markus@

ChangeLog
canohost.c
canohost.h
session.c

index 797ba021fab700d8cb9fb2251948142eecd1ac68..cbf569b75e02fd157d99796f93d42e859e56e8ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,9 @@
    - markus@cvs.openbsd.org 2001/04/05 15:45:43
      [ssh.1]
      ssh defaults to protocol v2; from quisar@quisar.ambre.net
+   - 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@
 
 20010405
  - OpenBSD CVS Sync                                              
index 52921f5b01526f918ce86a04883d1cd32f76ed34..927508f585d68a33a2673a178dbed74b5d2b39cb 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: canohost.c,v 1.23 2001/02/10 01:33:32 markus Exp $");
+RCSID("$OpenBSD: canohost.c,v 1.24 2001/04/05 15:48:19 stevesk Exp $");
 
 #include "packet.h"
 #include "xmalloc.h"
@@ -251,6 +251,17 @@ get_remote_ipaddr()
        return canonical_host_ip;
 }
 
+const char *
+get_remote_name_or_ip(u_int utmp_len, int reverse_mapping_check)
+{
+       static const char *remote = "";
+       if (utmp_len > 0)
+               remote = get_canonical_hostname(reverse_mapping_check);
+       if (utmp_len == 0 || strlen(remote) > utmp_len)
+               remote = get_remote_ipaddr();
+       return remote;
+}
+
 /* Returns the local/remote port for the socket. */
 
 int
index da60b3af9f00cba61175b94fbe63ba98c9fcf88a..89bd5c3b45437932c9af874211cb8e96ad86b192 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: canohost.h,v 1.4 2001/02/03 10:08:37 markus Exp $     */
+/*     $OpenBSD: canohost.h,v 1.5 2001/04/05 15:48:19 stevesk Exp $    */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -25,6 +25,8 @@ const char *get_canonical_hostname(int reverse_mapping_check);
  */
 const char *get_remote_ipaddr(void);
 
+const char *get_remote_name_or_ip(u_int utmp_len, int reverse_mapping_check);
+
 /* Returns the ipaddr/port number of the peer of the socket. */
 char * get_peer_ipaddr(int socket);
 int     get_peer_port(int sock);
index ac026e4fdb7e83b3c695c34260b5242dd378adb0..5264ac182f50b751e17312d7809d776866d753e4 100644 (file)
--- 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
This page took 0.067513 seconds and 5 git commands to generate.