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-307-g7795f


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-307-g7795fb3
Date: Wed, 26 Jun 2013 17:07:12 +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  7795fb389e94ddea75e97e4b0a35fe561cd4cdac (commit)
      from  0a482ca1c26a994929e368aa810983a786ee86f7 (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=7795fb389e94ddea75e97e4b0a35fe561cd4cdac


commit 7795fb389e94ddea75e97e4b0a35fe561cd4cdac
Author: Mats Erik Andersson <address@hidden>
Date:   Sun Jun 23 18:09:04 2013 +0200

    ftpd: Prevent disclosure of system version.

diff --git a/ChangeLog b/ChangeLog
index 06cf1da..0befc80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2013-06-23  Mats Erik Andersson  <address@hidden>
+
+       Portable use of uname().  POSIX states non-negative
+       status on success.  Solaris returns positive value.
+
+       * ftpd/ftpcmd.y <cmd> [HAVE_UNAME]: Set string
+       value if uname() returns a non-negative value.
+       * telnetd/telnetd.c (print_hostinfo) [HAVE_UNAME]:
+       Likewise.
+
+
+       ftpd: Prevent disclosure of system version.
+
+       * ftpd/extern.h (no_version): New declaration.
+       * ftpd/ftpcmd <cmd>: Display system name and
+       release identifier only if `!no_version' is true.
+       * ftpd.c (no_version): Declare as global,
+       not static.
+
 2013-06-17  Mats Erik Andersson  <address@hidden>
 
        * CHECKLIST: New documentation file.
diff --git a/ftpd/extern.h b/ftpd/extern.h
index 5005484..f613d9a 100644
--- a/ftpd/extern.h
+++ b/ftpd/extern.h
@@ -99,6 +99,7 @@ extern int logged_in;
 extern struct passwd *pw;
 extern int guest;
 extern int logging;
+extern int no_version;
 extern int type;
 extern int form;
 extern int debug;
diff --git a/ftpd/ftpcmd.y b/ftpd/ftpcmd.y
index d4b5d89..3c77d7a 100644
--- a/ftpd/ftpcmd.y
+++ b/ftpd/ftpcmd.y
@@ -529,7 +529,7 @@ cmd
 #ifdef HAVE_UNAME
                        struct utsname u;
 
-                       if (uname (&u) == 0)
+                       if (uname (&u) >= 0)
                          {
                            version = malloc (strlen (u.sysname) + 1
                                              + strlen (u.release) + 1);
@@ -548,7 +548,7 @@ cmd
                        sys_type = "UNKNOWN";
 #endif
 
-                       if (version)
+                       if (!no_version && version)
                          reply (215, "%s Type: L%d Version: %s",
                                 sys_type, NBBY, version);
                        else
diff --git a/ftpd/ftpd.c b/ftpd/ftpd.c
index 964ca2c..79839bd 100644
--- a/ftpd/ftpd.c
+++ b/ftpd/ftpd.c
@@ -128,6 +128,7 @@ socklen_t data_dest_len;
 struct sockaddr_storage his_addr;      /* Peer address.  */
 socklen_t his_addrlen;
 int logging;                   /* Enable log to syslog.  */
+int no_version;                        /* Don't print version to client.  */
 int type = TYPE_A;             /* Default TYPE_A.  */
 int form = FORM_N;             /* Default FORM_N.  */
 int debug;                     /* Enable debug mode if 1.  */
@@ -156,7 +157,6 @@ static jmp_buf urgcatch;
 static int stru = STRU_F;      /* Avoid C keyword.  */
 static int stru_mode = MODE_S; /* Default STRU mode stru_mode = MODE_S.  */
 static int anon_only;          /* Allow only anonymous login.  */
-static int no_version;         /* Don't print version to client.  */
 static int daemon_mode;                /* Start in daemon mode.  */
 static off_t file_size;
 static off_t byte_count;
diff --git a/telnetd/telnetd.c b/telnetd/telnetd.c
index ceca23c..549df95 100644
--- a/telnetd/telnetd.c
+++ b/telnetd/telnetd.c
@@ -716,7 +716,7 @@ print_hostinfo (void)
 #ifdef HAVE_UNAME
   struct utsname u;
 
-  if (uname (&u) == 0)
+  if (uname (&u) >= 0)
     {
       im = malloc (strlen (UNAME_IM_PREFIX)
                   + strlen (u.sysname)

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

Summary of changes:
 ChangeLog         |   19 +++++++++++++++++++
 ftpd/extern.h     |    1 +
 ftpd/ftpcmd.y     |    4 ++--
 ftpd/ftpd.c       |    2 +-
 telnetd/telnetd.c |    2 +-
 5 files changed, 24 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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