commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-309-g9d72b


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-309-g9d72b99
Date: Wed, 26 Jun 2013 17:44:41 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  9d72b998f18b02381cbf6c1b2fd8b797e35ea50a (commit)
       via  e62df3d4e0d8048abb31f98c393ddf91e9c5f67c (commit)
      from  7795fb389e94ddea75e97e4b0a35fe561cd4cdac (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=9d72b998f18b02381cbf6c1b2fd8b797e35ea50a


commit 9d72b998f18b02381cbf6c1b2fd8b797e35ea50a
Author: Mats Erik Andersson <address@hidden>
Date:   Tue Jun 25 00:02:49 2013 +0200

    telnetd: Reverse resolution of client.
    
    The use of `-U/--reverse-lookup' always caused
    a denied access, when built with the macro IPV6 set.

diff --git a/ChangeLog b/ChangeLog
index d44632e..8d6af4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2013-06-24  Mats Erik Andersson  <address@hidden>
 
+       telnetd: Reverse resolution of client.
+
+       * telnetd/telnetd.c (telnetd_setup) [IPV6]
+       <reverse_lookup>: The comparison of a full
+       `struct sockaddr' always fails.  Thus compare
+       only `struct in_addr', or `struct in6_addr'.
+       Short-circuit test for differing families.
+       In case of failure, call fatal(), not exit().
+       [!IPV6] <reverse_lookup>: Call fatal(), not exit().
+
+2013-06-24  Mats Erik Andersson  <address@hidden>
+
        telnetd: Portability of banner.
 
        * telnetd/telnetd.c (print_hostinfo): Use NVT
diff --git a/telnetd/telnetd.c b/telnetd/telnetd.c
index 7e75a23..30e2f3b 100644
--- a/telnetd/telnetd.c
+++ b/telnetd/telnetd.c
@@ -397,14 +397,30 @@ telnetd_setup (int fd)
        }
 
       for (aip = result; aip; aip = aip->ai_next)
-       if (!memcmp (aip->ai_addr, &saddr, aip->ai_addrlen))
-         break;
+       {
+         if (aip->ai_family != saddr.ss_family)
+           continue;
+
+         /* Must compare the address part only.
+          * The ports are almost surely different!
+          */
+         if (aip->ai_family == AF_INET
+             && !memcmp (&((struct sockaddr_in *) aip->ai_addr)->sin_addr,
+                         &((struct sockaddr_in *) &saddr)->sin_addr,
+                         sizeof (struct in_addr)))
+           break;
+         if (aip->ai_family == AF_INET6
+             && !memcmp (&((struct sockaddr_in6 *) aip->ai_addr)->sin6_addr,
+                         &((struct sockaddr_in6 *) &saddr)->sin6_addr,
+                         sizeof (struct in6_addr)))
+           break;
+       }
 
       if (aip == NULL)
        {
          syslog (LOG_AUTH | LOG_NOTICE,
-                 "None of addresses of %s matched %s", remote_hostname, buf);
-         exit (EXIT_SUCCESS);
+                 "No address of %s matched %s", remote_hostname, buf);
+         fatal (fd, "Cannot resolve address.");
        }
 
       freeaddrinfo (result);
@@ -449,9 +465,9 @@ telnetd_setup (int fd)
       if (ap == NULL)
        {
          syslog (LOG_AUTH | LOG_NOTICE,
-                 "None of addresses of %s matched %s",
+                 "No address of %s matched %s",
                  remote_hostname, inet_ntoa (saddr.sin_addr));
-         exit (EXIT_SUCCESS);
+         fatal (fd, "Cannot resolve address.");
        }
     }
   else

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=e62df3d4e0d8048abb31f98c393ddf91e9c5f67c


commit e62df3d4e0d8048abb31f98c393ddf91e9c5f67c
Author: Mats Erik Andersson <address@hidden>
Date:   Mon Jun 24 00:47:39 2013 +0200

    telnetd: Portability of banner.

diff --git a/ChangeLog b/ChangeLog
index 0befc80..d44632e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-06-24  Mats Erik Andersson  <address@hidden>
+
+       telnetd: Portability of banner.
+
+       * telnetd/telnetd.c (print_hostinfo): Use NVT
+       conformant substring for second newline "\r\n".
+       * telnetd/telnet.h (UNAME_IM_SUFFIX) [HAVE_UNAME]:
+       Likewise.  Use place holder `%l' for name of server.
+
 2013-06-23  Mats Erik Andersson  <address@hidden>
 
        Portable use of uname().  POSIX states non-negative
diff --git a/telnetd/telnetd.c b/telnetd/telnetd.c
index 549df95..7e75a23 100644
--- a/telnetd/telnetd.c
+++ b/telnetd/telnetd.c
@@ -727,7 +727,7 @@ print_hostinfo (void)
     }
 #endif /* HAVE_UNAME */
   if (!im)
-    im = xstrdup ("\r\n\nUNIX (%l) (%t)\r\n\n");
+    im = xstrdup ("\r\n\r\nUNIX (%l) (%t)\r\n\r\n");
 
   str = expand_line (im);
   free (im);
diff --git a/telnetd/telnetd.h b/telnetd/telnetd.h
index 45b17c0..ce90fbc 100644
--- a/telnetd/telnetd.h
+++ b/telnetd/telnetd.h
@@ -120,7 +120,7 @@ typedef struct
 #ifdef HAVE_UNAME
    /* Prefix and suffix if the IM string can be generated from uname.  */
 # define UNAME_IM_PREFIX "\r\n"
-# define UNAME_IM_SUFFIX " (%h) (%t)\r\n\n"
+# define UNAME_IM_SUFFIX " (%l) (%t)\r\n\r\n"
 #else /* ! HAVE_UNAME */
 # define UNAME_IM_PREFIX "\r\n"
 # define UNAME_IM_SUFFIX "\r\n"

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |   21 +++++++++++++++++++++
 telnetd/telnetd.c |   30 +++++++++++++++++++++++-------
 telnetd/telnetd.h |    2 +-
 3 files changed, 45 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]