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 <[email protected]>
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 <[email protected]>
+
+ 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 <[email protected]>
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
_______________________________________________
Commit-inetutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/commit-inetutils