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_3-3-g98b0ccf


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_3-3-g98b0ccf
Date: Mon, 18 May 2015 17:38:05 +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  98b0ccfc1fc13a6f73119223fe930f8e957e61d9 (commit)
      from  ddfc1fda581f61f5154a9dd5827e49584409ee86 (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=98b0ccfc1fc13a6f73119223fe930f8e957e61d9


commit 98b0ccfc1fc13a6f73119223fe930f8e957e61d9
Author: Mats Erik Andersson <address@hidden>
Date:   Mon May 18 19:25:16 2015 +0200

    ftp: Accept named, non-numerical ports.

diff --git a/ChangeLog b/ChangeLog
index b04e0aa..8101429 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-05-18  Mats Erik Andersson  <address@hidden>
+
+       ftp: Accept named, non-numerical ports.
+
+       * ftp/cmds.c (setpeer): Test whether port string looks
+       numerical.  Perform a look-up in the contrary case.
+
 2015-05-17  Mats Erik Andersson  <address@hidden>
 
        ifconfig: Regression during interface selection.
diff --git a/ftp/cmds.c b/ftp/cmds.c
index 422d365..c12f24c 100644
--- a/ftp/cmds.c
+++ b/ftp/cmds.c
@@ -262,10 +262,19 @@ setpeer (int argc, char **argv)
 
   if (argc == 3)
     {
-      port = atoi (argv[2]);
+      if (isdigit(argv[2][0]) || argv[2][0] == '-')
+       port = atoi (argv[2]);
+      else
+       {
+         struct servent *sp;
+
+         sp = getservbyname (argv[2], "tcp");
+         port = (sp) ? ntohs (sp->s_port) : 0;
+       }
+
       if (port <= 0 || port > 65535)
        {
-         printf ("%s: bad port number-- %s\n", argv[1], argv[2]);
+         printf ("%s: bad port -- %s\n", argv[1], argv[2]);
          printf ("usage: %s host-name [port]\n", argv[0]);
          code = -1;
          return;

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

Summary of changes:
 ChangeLog  |    7 +++++++
 ftp/cmds.c |   13 +++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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