From MAILER-DAEMON Mon Sep 09 16:29:11 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VJ859-0000J7-NG
	for mharc-commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:29:11 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45118)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ857-0000IS-K6
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:29:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ856-0001nX-5M
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:29:09 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:51946)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ856-0001nS-29
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:29:08 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VJ855-0004cD-CV
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 20:29:07 +0000
Date: Mon, 09 Sep 2013 20:29:07 +0000
Message-Id: <E1VJ855-0004cD-CV@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-334-ge913773
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 6a47f400cae44ba53f5a4cbcfa43ea95b2e3cadc
X-Git-Newrev: e91377394b0431b98f7125f015e0d1c78823589c
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 20:29:11 -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  e91377394b0431b98f7125f015e0d1c78823589c (commit)
      from  6a47f400cae44ba53f5a4cbcfa43ea95b2e3cadc (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=e91377394b0431b98f7125f015e0d1c78823589c


commit e91377394b0431b98f7125f015e0d1c78823589c
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Tue Sep 3 23:59:10 2013 +0200

    ftp: Avoid numeric size coding.

diff --git a/ChangeLog b/ChangeLog
index 9bda5cb..2bad14a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2013-09-03  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftp: Avoid numeric size of char array.
+
+	* ftp/cmds.c (macdef): Use sizeof() to avoid size
+	knowledge about arrays `struct macel.mac_name'
+	or `macbuf'.
+	* ftp/domacro.c (domacro): Likewise.
+	* ftp/ruserpass.c (remote_userpass): Likewise.
+	Change type of I to size_t.
+
+	* doc/inetutils.texi <ftp invocation>: Mention
+	restriction on macro naming.
+
 2013-08-31  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* tests/syslogd.sh: Lengthen sleeping periods.
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index 1f20163..80c6cda 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -1617,23 +1617,27 @@ dash@tie{}@samp{-}, then output is sent to the terminal.
 @item macdef @var{macro-name}
 Define a macro called @var{macro-name}, with subsequent lines as the
 macro definition. A null line (consecutive newline characters in a
-file, or carriage returns from the terminal) terminates macro input
+file, or carriage returns at a terminal) terminates macro input
 mode.  There is a limit of 16 macros and a total of 4096 characters
-in all defined macros.
+shared by all defined macros.  Only the first eight characters in
+@var{macro-name} are significant when determining which
+macro to execute.
 Macros remain defined until a close command is executed.
 
 The macro processor interprets @samp{$} and @samp{\} as
-special characters.  A @samp{$} followed by a number (or numbers) is
-replaced by the corresponding argument on the macro invocation command
-line.
+special characters.  A @samp{$} followed by a number (one or more
+digits) is replaced by the corresponding argument on the macro's
+invocation command line.
 A @samp{$} followed by the letter @samp{i} tells the macro processor
 that the macro is to perform a loop.
-On the first pass @samp{$i}
-is replaced by the first argument on the macro invocation command
-line, on the second pass it is replaced by the second argument, and so
-on.  A @samp{\} followed by any character is replaced by that
-character.  Use the @samp{\} to prevent special treatment of the
-@samp{$}.
+On the first pass, @samp{$i} is replaced by the first argument on
+the macro's invocation command line, while on the second pass it is
+replaced by the second argument, and so forth.
+Iteration proceeds until all arguments have been consumed.
+
+A backslash @samp{\} followed by any character is replaced by that
+character.  Use the backslash @samp{\} to prevent special treatment
+of the dollar sign @samp{$}, as was just explained.
 
 @item mdelete [@var{remote-files}]
 Delete all @var{remote-files} on the remote machine.
diff --git a/ftp/cmds.c b/ftp/cmds.c
index cf09a9d..10b8d60 100644
--- a/ftp/cmds.c
+++ b/ftp/cmds.c
@@ -2519,7 +2519,8 @@ macdef (int argc, char **argv)
     {
       printf ("Enter macro line by line, terminating it with a null line\n");
     }
-  strncpy (macros[macnum].mac_name, argv[1], 8);
+  strncpy (macros[macnum].mac_name, argv[1],
+	   sizeof (macros[macnum].mac_name) - 1);
   if (macnum == 0)
     {
       macros[macnum].mac_start = macbuf;
@@ -2529,7 +2530,7 @@ macdef (int argc, char **argv)
       macros[macnum].mac_start = macros[macnum - 1].mac_end + 1;
     }
   tmp = macros[macnum].mac_start;
-  while (tmp != macbuf + 4096)
+  while (tmp < macbuf + sizeof (macbuf))
     {
       if ((c = getchar ()) == EOF)
 	{
diff --git a/ftp/domacro.c b/ftp/domacro.c
index 9cad900..1d2cc94 100644
--- a/ftp/domacro.c
+++ b/ftp/domacro.c
@@ -70,7 +70,8 @@ domacro (int argc, char *argv[])
     }
   for (i = 0; i < macnum; ++i)
     {
-      if (!strncmp (argv[1], macros[i].mac_name, 9))
+      if (!strncmp (argv[1], macros[i].mac_name,
+		    sizeof (macros[i].mac_name)))
 	{
 	  break;
 	}
diff --git a/ftp/ruserpass.c b/ftp/ruserpass.c
index 1bf9b41..33d99b0 100644
--- a/ftp/ruserpass.c
+++ b/ftp/ruserpass.c
@@ -115,7 +115,8 @@ remote_userpass (char *host, char **aname, char **apass, char **aacct)
 {
   char *hdir, buf[BUFSIZ], *tmp;
   char *myname = 0, *mydomain;
-  int t, i, c, usedefault = 0;
+  int t, c, usedefault = 0;
+  size_t i;
   struct stat stb;
 
   hdir = getenv ("HOME");
@@ -238,7 +239,8 @@ remote_userpass (char *host, char **aname, char **apass, char **aacct)
 		}
 	      tmp = macros[macnum].mac_name;
 	      *tmp++ = c;
-	      for (i = 0; i < 8 && (c = getc (cfile)) != EOF && !isspace (c);
+	      for (i = 0; i < (sizeof (macros[macnum].mac_name) - 1)
+			  && (c = getc (cfile)) != EOF && !isspace (c);
 		   ++i)
 		{
 		  *tmp++ = c;
@@ -267,7 +269,7 @@ remote_userpass (char *host, char **aname, char **apass, char **aacct)
 		  macros[macnum].mac_start = macros[macnum - 1].mac_end + 1;
 		}
 	      tmp = macros[macnum].mac_start;
-	      while (tmp != macbuf + 4096)
+	      while (tmp < macbuf + sizeof (macbuf))
 		{
 		  if ((c = getc (cfile)) == EOF)
 		    {
@@ -287,7 +289,7 @@ remote_userpass (char *host, char **aname, char **apass, char **aacct)
 		    }
 		  tmp++;
 		}
-	      if (tmp == macbuf + 4096)
+	      if (tmp == macbuf + sizeof (macbuf))
 		{
 		  printf ("4K macro buffer exceeded\n");
 		  goto bad;

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

Summary of changes:
 ChangeLog          |   14 ++++++++++++++
 doc/inetutils.texi |   26 +++++++++++++++-----------
 ftp/cmds.c         |    5 +++--
 ftp/domacro.c      |    3 ++-
 ftp/ruserpass.c    |   10 ++++++----
 5 files changed, 40 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Mon Sep 09 16:30:17 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VJ86D-0000fu-Bh
	for mharc-commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:30:17 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45346)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ86A-0000fP-VH
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:30:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ869-0002Cp-6h
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:30:14 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:51977)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ869-0002Cl-3b
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:30:13 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VJ868-0004rJ-EA
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 20:30:12 +0000
Date: Mon, 09 Sep 2013 20:30:12 +0000
Message-Id: <E1VJ868-0004rJ-EA@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-335-g0e8582e
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: e91377394b0431b98f7125f015e0d1c78823589c
X-Git-Newrev: 0e8582e3043a015a1d770056b58f0a8d80ab139b
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 20:30:16 -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  0e8582e3043a015a1d770056b58f0a8d80ab139b (commit)
      from  e91377394b0431b98f7125f015e0d1c78823589c (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=0e8582e3043a015a1d770056b58f0a8d80ab139b


commit 0e8582e3043a015a1d770056b58f0a8d80ab139b
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Sep 5 00:49:19 2013 +0200

    ftp: Macro execution segfaults.

diff --git a/ChangeLog b/ChangeLog
index 2bad14a..03c727c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-09-05  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftp: Macro execution segfaults.
+	Abort macro execution when command is ambiguous,
+	is invalid, or if the control connection has been
+	lost.  Otherwise segmentation faults can happen
+	when the macro includes further commands.
+
+	* ftp/domacro.c (domacro) <ambiguous, invalid>
+	<not connected>: Reset LOOPFLG and break loop.
+	Error message gives name of offending command.
+
 2013-09-03  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftp: Avoid numeric size of char array.
diff --git a/ftp/domacro.c b/ftp/domacro.c
index 1d2cc94..db7d9b3 100644
--- a/ftp/domacro.c
+++ b/ftp/domacro.c
@@ -142,18 +142,24 @@ domacro (int argc, char *argv[])
 
 	  if (c == (struct cmd *) -1)
 	    {
-	      printf ("?Ambiguous command\n");
+	      printf ("?Ambiguous command: '%s'.\n", margv[0]);
 	      code = -1;
+	      loopflg = 0;
+	      break;
 	    }
 	  else if (c == 0)
 	    {
-	      printf ("?Invalid command\n");
+	      printf ("?Invalid command: '%s'.\n", margv[0]);
 	      code = -1;
+	      loopflg = 0;
+	      break;
 	    }
 	  else if (c->c_conn && !connected)
 	    {
-	      printf ("Not connected.\n");
+	      printf ("Not connected, needed for '%s'.\n", margv[0]);
 	      code = -1;
+	      loopflg = 0;
+	      break;
 	    }
 	  else
 	    {

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

Summary of changes:
 ChangeLog     |   12 ++++++++++++
 ftp/domacro.c |   12 +++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Mon Sep 09 16:31:08 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VJ872-0000nI-Hi
	for mharc-commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:31:08 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45497)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ86y-0000mD-Kz
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:31:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ86x-0002Jt-4X
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:31:04 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:52005)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ86x-0002Jp-0k
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:31:03 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VJ86w-0004ua-Ja
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 20:31:02 +0000
Date: Mon, 09 Sep 2013 20:31:02 +0000
Message-Id: <E1VJ86w-0004ua-Ja@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-336-ga8ef961
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 0e8582e3043a015a1d770056b58f0a8d80ab139b
X-Git-Newrev: a8ef961c8078d28dbbe0121b89a3deff2ff539bd
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 20:31:06 -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  a8ef961c8078d28dbbe0121b89a3deff2ff539bd (commit)
      from  0e8582e3043a015a1d770056b58f0a8d80ab139b (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=a8ef961c8078d28dbbe0121b89a3deff2ff539bd


commit a8ef961c8078d28dbbe0121b89a3deff2ff539bd
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Sep 5 15:28:24 2013 +0200

    ftp: Minor allocation issues.

diff --git a/ChangeLog b/ChangeLog
index 03c727c..a205b64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,28 @@
 2013-09-05  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	ftp: Minor allocation issues.
+	Fix issues related to the global variable `line'.
+
+	* ftp/cmds.c (another): New variable NEW.  Assign
+	outcome of realloc() to NEW, to better avoid memory
+	leakage.  Determine new size with `linelen'.
+	(confirm): Rename LINE to INPUT, which does not
+	shadow the global variable `line'.
+
+	* ftp/domacro.c: Include <stdlib.h>.
+	(domacro): Change LINE2 to a string pointer.
+	Assign LINE2 using strdup(), freeing it later.
+
+	* ftp/ftp.c (login) <execution of macro `init'>:
+	Allocate MAXLINE bytes; set `linelen'.
+
+	* ftp/ftp_var.h (linelen): New variable.
+
+	* ftp/main.c (main): Reset `line', `linelen'.
+	(cmdscanner): Remove LEN, using `linelen' instead.
+
+2013-09-05  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	ftp: Macro execution segfaults.
 	Abort macro execution when command is ambiguous,
 	is invalid, or if the control connection has been
diff --git a/ftp/cmds.c b/ftp/cmds.c
index 10b8d60..a89ecbe 100644
--- a/ftp/cmds.c
+++ b/ftp/cmds.c
@@ -150,7 +150,7 @@ int
 another (int *pargc, char ***pargv, const char *prompt)
 {
   char *arg = NULL;
-  char *buffer;
+  char *buffer, *new;
   size_t size = 0, len = strlen (line);
   int ret;
 
@@ -198,13 +198,17 @@ another (int *pargc, char ***pargv, const char *prompt)
       return 0;
     }
 
-  line = realloc (line, sizeof (char) * (len + strlen (arg) + 2));
-  if (!line)
+  new = realloc (line, sizeof (char) *
+		       ((linelen ? linelen : len) + strlen (arg) + 2));
+  if (!new)
     {
       free (arg);
       intr (0);
     }
 
+  line = new;
+  linelen = sizeof (char) *
+	    ((linelen ? linelen : len) + strlen (arg) + 2);
   line[len++] = ' ';
   strcpy (&line[len], arg);
   free (arg);
@@ -1943,15 +1947,15 @@ disconnect (int argc _GL_UNUSED_PARAMETER, char **argv _GL_UNUSED_PARAMETER)
 int
 confirm (char *cmd, char *file)
 {
-  char line[BUFSIZ];
+  char input[BUFSIZ];
 
   if (!interactive)
     return (1);
   printf ("%s %s? ", cmd, file);
   fflush (stdout);
-  if (fgets (line, sizeof line, stdin) == NULL)
+  if (fgets (input, sizeof input, stdin) == NULL)
     return (0);
-  return (*line != 'n' && *line != 'N');
+  return (*input != 'n' && *input != 'N');
 }
 
 void
diff --git a/ftp/domacro.c b/ftp/domacro.c
index db7d9b3..3a01796 100644
--- a/ftp/domacro.c
+++ b/ftp/domacro.c
@@ -51,6 +51,7 @@
 
 #include <ctype.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "ftp_var.h"
@@ -59,7 +60,8 @@ void
 domacro (int argc, char *argv[])
 {
   int i, j, count = 2, loopflg = 0;
-  char *cp1, *cp2, line2[200];
+  char *cp1, *cp2;
+  char *line2;		/* Allocated copy of `line'.  */
   struct cmd *c;
 
   if (argc < 2 && !another (&argc, &argv, "macro name"))
@@ -82,28 +84,42 @@ domacro (int argc, char *argv[])
       code = -1;
       return;
     }
-  strcpy (line2, line);
+
+  line2 = strdup (line);
+  if (!line2)
+    {
+      printf ("System refused resources for macro '%s'.\n", argv[1]);
+      code = -1;
+      return;
+    }
 
   do
     {
       cp1 = macros[i].mac_start;
       while (cp1 != macros[i].mac_end)
 	{
+	  /* Skip initial white space on each line of input.  */
 	  while (isspace (*cp1))
 	    {
 	      cp1++;
 	    }
+	  /* Translate a line of text from macro definition
+	   * and put it in `line'.  This global variable is
+	   * referenced by some parsing functions, so the
+	   * translation target cannot be changed easily.
+	   */
 	  cp2 = line;
 	  while (*cp1 != '\0')
 	    {
 	      switch (*cp1)
 		{
-		case '\\':
+		case '\\':		/* Escaping character.  */
 		  *cp2++ = *++cp1;
 		  break;
-		case '$':
+		case '$':		/* Substitution.  */
 		  if (isdigit (*(cp1 + 1)))
 		    {
+		      /* Argument expansion.  */
 		      j = 0;
 		      while (isdigit (*++cp1))
 			j = 10 * j + *cp1 - '0';
@@ -117,8 +133,9 @@ domacro (int argc, char *argv[])
 		    }
 		  if (*(cp1 + 1) == 'i')
 		    {
+		      /* The loop counter "$i" was detected.  */
 		      loopflg = 1;
-		      cp1++;
+		      cp1++;		/* Back to last used char.  */
 		      if (count < argc)
 			{
 			  strcpy (cp2, argv[count]);
@@ -126,11 +143,15 @@ domacro (int argc, char *argv[])
 			}
 		      break;
 		    }
-		  /* intentional drop through */
+		  /* Intentional fall through, since no acceptable
+		   * use of '$' was detected.  Present input is the
+		   * dollar sign.
+		   */
 		default:
-		  *cp2++ = *cp1;
+		  *cp2++ = *cp1;	/* Copy present character.  */
 		  break;
 		}
+	      /* Advance to next usable character.  */
 	      if (*cp1 != '\0')
 		cp1++;
 	    }
@@ -168,8 +189,13 @@ domacro (int argc, char *argv[])
 	      (*c->c_handler) (margc, margv);
 	      if (bell && c->c_bell)
 		putchar ('\007');
-	      strcpy (line, line2);
-	      makeargv ();
+
+	      /* The arguments set at the time of invoking
+	       * the macro must be recovered, to be used
+	       * in parsing next line of macro definition.
+	       */
+	      strcpy (line, line2);	/* Known to fit.  */
+	      makeargv ();		/* Get the arguments.  */
 	      argc = margc;
 	      argv = margv;
 	    }
@@ -178,4 +204,6 @@ domacro (int argc, char *argv[])
 	}
     }
   while (loopflg && ++count < argc);
+
+  free (line2);
 }
diff --git a/ftp/ftp.c b/ftp/ftp.c
index 682bcbf..318a2f6 100644
--- a/ftp/ftp.c
+++ b/ftp/ftp.c
@@ -358,10 +358,12 @@ login (char *host)
       if (!strcmp ("init", macros[n].mac_name))
 	{
 	  free (line);
-	  line = calloc (200, sizeof (*line));
+	  line = calloc (MAXLINE, sizeof (*line));
+	  linelen = MAXLINE;
 	  if (!line)
 	    quit (0, 0);
 
+	  /* Simulate input of the macro 'init'.  */
 	  strcpy (line, "$init");
 	  makeargv ();
 	  domacro (margc, margv);
diff --git a/ftp/ftp_var.h b/ftp/ftp_var.h
index 499ad36..29247d1 100644
--- a/ftp/ftp_var.h
+++ b/ftp/ftp_var.h
@@ -113,7 +113,8 @@ FTP_EXTERN int unix_proxy;	/* proxy is unix, can use binary for ascii */
 
 FTP_EXTERN jmp_buf toplevel;	/* non-local goto stuff for cmd scanner */
 
-FTP_EXTERN char *line;
+FTP_EXTERN char *line;		/* input produced by readline or getline */
+FTP_EXTERN size_t linelen;	/* allocated length of the same, if known */
 
 FTP_EXTERN char *stringbase;	/* current scan point in line buffer */
 FTP_EXTERN char argbuf[MAXLINE];	/* argument storage buffer */
diff --git a/ftp/main.c b/ftp/main.c
index 4231951..2b847b3 100644
--- a/ftp/main.c
+++ b/ftp/main.c
@@ -73,7 +73,9 @@
 # include <locale.h>
 #endif
 
-/* Define macro to nothing so declarations in ftp_var.h become definitions. */
+/* Define macro to nothing so declarations
+ * in "ftp_var.h" become definitions.
+ */
 #define FTP_EXTERN
 #include "ftp_var.h"
 
@@ -217,6 +219,9 @@ main (int argc, char *argv[])
   usefamily = AF_UNSPEC;	/* allow any address family */
   usereadline = 1;		/* normally using readline */
 
+  line = NULL;			/* reset global input */
+  linelen = 0;
+
   /* Invoked as `pftp'?  Then set passive mode.  */
   cp = strrchr (argv[0], '/');
   if (cp)
@@ -359,7 +364,6 @@ cmdscanner (int top)
 {
   struct cmd *c;
   ssize_t l;
-  size_t len;
 
   if (!top)
     putchar ('\n');
@@ -369,12 +373,12 @@ cmdscanner (int top)
 	{
 	  free (line);
 	  line = NULL;
-	  len = 0;
 	}
+      linelen = 0;
 
 #if HAVE_READLINE
       if (usereadline)
-	line = readline (prompt);
+	line = readline (prompt);	/* malloc'd, no NL */
       else
 #endif /* HAVE_READLINE */
 	{
@@ -384,7 +388,8 @@ cmdscanner (int top)
 	      fflush (stdout);
 	    }
 
-	  l = getline (&line, &len, stdin);
+	  /* `linelen' is updated to allocated amount.  */
+	  l = getline (&line, &linelen, stdin);	/* includes NL */
 	  if ((l > 0) && line)
 	    {
 	      char *nl = strchr (line, '\n');
@@ -394,32 +399,34 @@ cmdscanner (int top)
 	    }
 	  else
 	    {
+	      /* Allocation takes place even without input.  */
 	      free (line);	/* EOF, et cetera */
 	      line = NULL;
+	      linelen = 0;
 	    }
 
 	  if (!fromatty && prompt)
 	    fprintf (stdout, "%s\n", line ? line : "");
-	}
+	} /* !usereadline ends */
 
       if (!line)
 	quit (0, 0);
 
       l = strlen (line);
-      if (l >= MAXLINE)
+      if (l >= MAXLINE)			/* XXX: Relax.  */
 	{
 	  printf ("Line too long.\n");
 	  break;
 	}
 
+      if (l == 0)
+	break;
+
 #if HAVE_READLINE
       if (usereadline && line && *line)
 	add_history (line);
 #endif /* HAVE_READLINE */
 
-      if (l == 0)
-	break;
-
       makeargv ();
       if (margc == 0)
 	continue;
@@ -440,7 +447,10 @@ cmdscanner (int top)
 	  printf ("Not connected.\n");
 	  continue;
 	}
+
+      /* Perform the requested action.  */
       (*c->c_handler) (margc, margv);
+
       if (bell && c->c_bell)
 	putchar ('\007');
       if (c->c_handler != help)
@@ -463,8 +473,8 @@ makeargv (void)
 
   margc = 0;
   argp = margv;
-  stringbase = line;		/* scan from first of buffer */
-  argbase = argbuf;		/* store from first of buffer */
+  stringbase = line;		/* scan from beginning of buffer */
+  argbase = argbuf;		/* store at beginning of buffer */
   slrflag = 0;
   while ((*argp++ = slurpstring ()))
     margc++;

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

Summary of changes:
 ChangeLog     |   23 +++++++++++++++++++++++
 ftp/cmds.c    |   16 ++++++++++------
 ftp/domacro.c |   46 +++++++++++++++++++++++++++++++++++++---------
 ftp/ftp.c     |    4 +++-
 ftp/ftp_var.h |    3 ++-
 ftp/main.c    |   34 ++++++++++++++++++++++------------
 6 files changed, 97 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Mon Sep 09 16:31:55 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VJ87n-0000ug-O9
	for mharc-commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:31:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45647)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ87l-0000uD-1z
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:31:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ87j-0002Pw-Me
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:31:52 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:52037)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ87j-0002Pq-Ii
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:31:51 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VJ87j-0004yk-8L
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 20:31:51 +0000
Date: Mon, 09 Sep 2013 20:31:51 +0000
Message-Id: <E1VJ87j-0004yk-8L@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-337-g7df832e
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: a8ef961c8078d28dbbe0121b89a3deff2ff539bd
X-Git-Newrev: 7df832e9413143011feb9bd0b9bcc3d7349ce785
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 20:31:54 -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  7df832e9413143011feb9bd0b9bcc3d7349ce785 (commit)
      from  a8ef961c8078d28dbbe0121b89a3deff2ff539bd (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=7df832e9413143011feb9bd0b9bcc3d7349ce785


commit 7df832e9413143011feb9bd0b9bcc3d7349ce785
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Sep 6 13:23:59 2013 +0200

    ftp: Macro execution and allocation.
    
    Rewrite code for macro execution to use
    dynamically allocated string storage.

diff --git a/ChangeLog b/ChangeLog
index a205b64..d19c41f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2013-09-06  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftp: Macro execution and allocation.
+	During macro execution, string parsing and
+	substitution is rewritten to use dynamically
+	allocated memory.
+
+	* ftp/domacro.c (lengthen): New static function.
+	(domacro): New variables ALLOCFLG, LINE2LEN.
+	New label END_EXEC.  The variable LINE2 is no
+	longer allocated, instead it stores the previous
+	global `line' for repeated access.  A temporary
+	string pointer `line' is dynamically allocated
+	and is adjusted using lengthen().  Recovery from
+	allocation failures jump to END_EXEC.  `line' is
+	restored from LINE2 before exiting.
+
 2013-09-05  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftp: Minor allocation issues.
diff --git a/ftp/domacro.c b/ftp/domacro.c
index 3a01796..9867b42 100644
--- a/ftp/domacro.c
+++ b/ftp/domacro.c
@@ -56,12 +56,43 @@
 
 #include "ftp_var.h"
 
+/* Increase allocated length of `*startl' with `add'
+ * beyond `*track',  should present length not suffice.
+ * `*track' points to last character in use.  All of
+ * the values `*start', `*track', * and `*size' are
+ * updated during a successful reallocation.
+ * Return zero on success.
+ */
+static int
+lengthen (char **start, char **track, size_t *size, size_t add)
+{
+  char *new;
+  size_t offset = (size_t) (*track - *start);
+
+  if (*track < *start)
+    return EXIT_FAILURE;	/* Sanity check.  */
+
+  if (offset + add < *size)
+    return EXIT_SUCCESS;	/* Sufficient allocation.  */
+
+  new = realloc (*start, *size + add);
+  if (!new)
+    return EXIT_FAILURE;	/* Parameters are unchanged here.  */
+
+  *start = new;
+  *size += add;
+  *track = *start + offset;
+
+  return EXIT_SUCCESS;
+}
+
 void
 domacro (int argc, char *argv[])
 {
-  int i, j, count = 2, loopflg = 0;
+  int i, j, count = 2, loopflg = 0, allocflg = 0;
   char *cp1, *cp2;
-  char *line2;		/* Allocated copy of `line'.  */
+  char *line2;		/* Saved original of `line'.  */
+  size_t line2len;	/* Its allocated length.  */
   struct cmd *c;
 
   if (argc < 2 && !another (&argc, &argv, "macro name"))
@@ -85,14 +116,33 @@ domacro (int argc, char *argv[])
       return;
     }
 
-  line2 = strdup (line);
-  if (!line2)
+  line2 = line;
+  line2len = linelen;
+
+  /* Generate a replacement for `line' to be used during
+   * macro evaluation.  There might appear some intr(),
+   * so care must be taken before changing `line'.
+   * The original is available as LINE2.
+   *
+   * Initially allocate an amount sufficient for
+   * storing a copy of the original `line', which
+   * is repeatedly reused once for each text line
+   * of the stored macro definition.
+   */
+  cp2 = malloc (strlen (line2) + 2);
+  if (!cp2)
     {
       printf ("System refused resources for macro '%s'.\n", argv[1]);
+      line = line2;
+      linelen = line2len;
       code = -1;
       return;
     }
 
+  linelen = strlen (line2) + 2;
+  line = cp2;
+  *line = '\0';
+
   do
     {
       cp1 = macros[i].mac_start;
@@ -111,6 +161,14 @@ domacro (int argc, char *argv[])
 	  cp2 = line;
 	  while (*cp1 != '\0')
 	    {
+	      /* Usually two characters suffice.
+	       * This covers the default case below.
+	       */
+	      if (lengthen (&line, &cp2, &linelen, 2))
+		{
+		  allocflg = 1;
+		  goto end_exec;
+		}
 	      switch (*cp1)
 		{
 		case '\\':		/* Escaping character.  */
@@ -126,6 +184,12 @@ domacro (int argc, char *argv[])
 		      cp1--;
 		      if (argc - 2 >= j)
 			{
+			  if (lengthen (&line, &cp2, &linelen,
+					strlen (argv[j + 1]) + 2))
+			    {
+			      allocflg = 1;
+			      goto end_exec;
+			    }
 			  strcpy (cp2, argv[j + 1]);
 			  cp2 += strlen (argv[j + 1]);
 			}
@@ -138,6 +202,12 @@ domacro (int argc, char *argv[])
 		      cp1++;		/* Back to last used char.  */
 		      if (count < argc)
 			{
+			  if (lengthen (&line, &cp2, &linelen,
+					strlen (argv[count]) + 2))
+			    {
+			      allocflg = 1;
+			      goto end_exec;
+			    }
 			  strcpy (cp2, argv[count]);
 			  cp2 += strlen (argv[count]);
 			}
@@ -205,5 +275,13 @@ domacro (int argc, char *argv[])
     }
   while (loopflg && ++count < argc);
 
-  free (line2);
+end_exec:
+  if (allocflg)
+    {
+      printf ("Memory allocation failed for macro '%s'.\n", argv[1]);
+      code = -1;
+    }
+  free (line);
+  line = line2;
+  linelen = line2len;
 }

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

Summary of changes:
 ChangeLog     |   17 +++++++++++
 ftp/domacro.c |   88 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 100 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Mon Sep 09 16:32:55 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VJ88l-00018a-UI
	for mharc-commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:32:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45756)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ88i-00017T-MX
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:32:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ88d-0002ob-Jn
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:32:52 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:43487)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ88d-0002oV-GB
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:32:47 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VJ88d-00052Z-71
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 20:32:47 +0000
Date: Mon, 09 Sep 2013 20:32:47 +0000
Message-Id: <E1VJ88d-00052Z-71@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-338-ga3a5ee8
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 7df832e9413143011feb9bd0b9bcc3d7349ce785
X-Git-Newrev: a3a5ee825f903d127c06d073af683b454165fc42
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 20:32:54 -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  a3a5ee825f903d127c06d073af683b454165fc42 (commit)
      from  7df832e9413143011feb9bd0b9bcc3d7349ce785 (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=a3a5ee825f903d127c06d073af683b454165fc42


commit a3a5ee825f903d127c06d073af683b454165fc42
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sat Sep 7 14:37:59 2013 +0200

    ftp: Remove line length limit.
    
    Final step to manage input lines of almost
    arbitrary lengths from the user.

diff --git a/ChangeLog b/ChangeLog
index d19c41f..d1d572c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2013-09-07  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftp: Remove line length limit.
+	Once the argument parsing routine is rewritten
+	to work with dynamic memory, the length limit
+	on input lines can be removed in its entirety.
+
+	* ftp/extern.h (slurpstring): Remove declaration.
+	* ftp/ftp_var.h (argbuf): Change to string pointer.
+	(MAXMARGV) [!MAXMARGV]: New macro.
+	(margv): Change array length to MAXMARGV.
+
+	* ftp/main.c (slurpstring): Declare as static.
+	(main): Initalize `argbuf' to NULL.
+	(cmdscanner): Remove check whether `line' exceeds
+	MAXLINE in length.
+	(slrflag): Declare as static.
+	(makeargv): Free and allocate `argbuf' at entry.
+	Insert a condition to ensure that at most MAXMARGV
+	arguments are located, thus avoiding an overflow.
+
+	* ftp/ruserpass.c (tokval): Change array length
+	to BUFSIZ.
+
 2013-09-06  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftp: Macro execution and allocation.
diff --git a/ftp/extern.h b/ftp/extern.h
index dff99cf..9a07965 100644
--- a/ftp/extern.h
+++ b/ftp/extern.h
@@ -152,7 +152,6 @@ void setverbose (int, char **);
 void shell (int, char **);
 void site (int, char **);
 void sizecmd (int, char **);
-char *slurpstring (void);
 void status (int, char **);
 void syst (int, char **);
 void tvsub (struct timeval *, struct timeval *, struct timeval *);
diff --git a/ftp/ftp_var.h b/ftp/ftp_var.h
index 29247d1..dedb357 100644
--- a/ftp/ftp_var.h
+++ b/ftp/ftp_var.h
@@ -117,10 +117,15 @@ FTP_EXTERN char *line;		/* input produced by readline or getline */
 FTP_EXTERN size_t linelen;	/* allocated length of the same, if known */
 
 FTP_EXTERN char *stringbase;	/* current scan point in line buffer */
-FTP_EXTERN char argbuf[MAXLINE];	/* argument storage buffer */
+FTP_EXTERN char *argbuf;	/* allocated argument storage buffer */
 FTP_EXTERN char *argbase;	/* current storage point in arg buffer */
+
+#ifndef MAXMARGV
+# define MAXMARGV 20
+#endif
+
 FTP_EXTERN int margc;		/* count of arguments on input line */
-FTP_EXTERN char *margv[20];	/* args parsed from input line */
+FTP_EXTERN char *margv[MAXMARGV]; /* args parsed from input line */
 FTP_EXTERN int cpend;		/* flag: if != 0, then pending server reply */
 FTP_EXTERN int mflag;		/* flag: if != 0, then active multi command */
 
diff --git a/ftp/main.c b/ftp/main.c
index 2b847b3..630cfe5 100644
--- a/ftp/main.c
+++ b/ftp/main.c
@@ -94,6 +94,8 @@
 #endif
 
 
+static char *slurpstring (void);
+
 #define DEFAULT_PROMPT "ftp> "
 static char *prompt = NULL;
 
@@ -221,6 +223,7 @@ main (int argc, char *argv[])
 
   line = NULL;			/* reset global input */
   linelen = 0;
+  argbuf = NULL;
 
   /* Invoked as `pftp'?  Then set passive mode.  */
   cp = strrchr (argv[0], '/');
@@ -413,12 +416,6 @@ cmdscanner (int top)
 	quit (0, 0);
 
       l = strlen (line);
-      if (l >= MAXLINE)			/* XXX: Relax.  */
-	{
-	  printf ("Line too long.\n");
-	  break;
-	}
-
       if (l == 0)
 	break;
 
@@ -464,19 +461,33 @@ cmdscanner (int top)
  * Slice a string up into argc/argv.
  */
 
-int slrflag;
+static int slrflag;
 
 void
 makeargv (void)
 {
   char **argp;
 
-  margc = 0;
+  margc = 0;			/* No content as of yet.  */
+
+  /* Make sure that `argbuf' is large enough
+   * to contain `line'.  As soon as `line' is
+   * invalidated, so will `argbuf' be.
+   **/
+  free (argbuf);		/* Get rid of previous content.  */
+  argbuf = malloc (strlen (line) + 4);
+  if (!argbuf)
+    {
+      /* `margc' is naught, which hopefully will cover our back.  */
+      printf ("Allocation failure.  Serious error.\n");
+      return;
+    }
+
   argp = margv;
   stringbase = line;		/* scan from beginning of buffer */
   argbase = argbuf;		/* store at beginning of buffer */
   slrflag = 0;
-  while ((*argp++ = slurpstring ()))
+  while ((margc < MAXMARGV) && (*argp++ = slurpstring ()))
     margc++;
 }
 
@@ -485,7 +496,7 @@ makeargv (void)
  * implemented with FSM to
  * handle quoting and strings
  */
-char *
+static char *
 slurpstring (void)
 {
   int got_one = 0;
diff --git a/ftp/ruserpass.c b/ftp/ruserpass.c
index 33d99b0..8e1775c 100644
--- a/ftp/ruserpass.c
+++ b/ftp/ruserpass.c
@@ -84,7 +84,7 @@ static FILE *cfile;
 #undef	MACHINE
 #define MACHINE	11
 
-static char tokval[100];
+static char tokval[BUFSIZ];
 
 static struct toktab
 {

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

Summary of changes:
 ChangeLog       |   24 ++++++++++++++++++++++++
 ftp/extern.h    |    1 -
 ftp/ftp_var.h   |    9 +++++++--
 ftp/main.c      |   31 +++++++++++++++++++++----------
 ftp/ruserpass.c |    2 +-
 5 files changed, 53 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Mon Sep 09 16:33:42 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VJ89W-0001Kh-36
	for mharc-commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:33:42 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45853)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ89T-0001Jh-0r
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:33:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ89P-00035f-G3
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:33:38 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:43502)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ89P-00035b-Cc
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:33:35 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VJ89P-000555-3M
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 20:33:35 +0000
Date: Mon, 09 Sep 2013 20:33:35 +0000
Message-Id: <E1VJ89P-000555-3M@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-339-g5b5ba41
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: a3a5ee825f903d127c06d073af683b454165fc42
X-Git-Newrev: 5b5ba41fae8baa3cae3d20bab6b8ef8e79f10aaa
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 20:33:40 -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  5b5ba41fae8baa3cae3d20bab6b8ef8e79f10aaa (commit)
      from  a3a5ee825f903d127c06d073af683b454165fc42 (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=5b5ba41fae8baa3cae3d20bab6b8ef8e79f10aaa


commit 5b5ba41fae8baa3cae3d20bab6b8ef8e79f10aaa
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sun Sep 8 01:21:14 2013 +0200

    ifconfig: Legacy use with GNU/kFreeBSD.

diff --git a/ChangeLog b/ChangeLog
index d1d572c..32217f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2013-09-08  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ifconfig: Legacy use with GNU/kFreeBSD.
+
+	* configure.ac: Check for header <netinet/ether.h>.
+
+	* ifconfig/system.c [__DragonFly || __FreeBSD__ ||
+	__FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__]:
+	Add __FreeBSD_kernel__ to conditional.
+	* ifconfig/system.h [__DragonFly || __FreeBSD__ ||
+	__FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__]:
+	Likewise.
+	* ifconfig/system/bsd.c [HAVE_NETINET_ETHER_H]:
+	Include <netinet/ether.h>.
+	* ifconfig/system/bsd.h (IU_BSD_TYPE)
+	[__FreeBSD_kernel__]: Assign value to macro.
+
+	* tests/ifconfig.sh: Add an informational check
+	whether the legacy form `ifconfig lo0' works.
+
 2013-09-07  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftp: Remove line length limit.
diff --git a/configure.ac b/configure.ac
index 556bc0d..201b80a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -586,8 +586,8 @@ AC_HEADER_TIME
 AC_HEADER_DIRENT
 
 AC_CHECK_HEADERS([arpa/nameser.h errno.h fcntl.h features.h \
-		  glob.h memory.h netinet/in_systm.h netinet/ip.h \
-		  netinet/ip_icmp.h netinet/ip_var.h \
+		  glob.h memory.h netinet/ether.h netinet/in_systm.h \
+		  netinet/ip.h netinet/ip_icmp.h netinet/ip_var.h \
 		  security/pam_appl.h shadow.h \
 		  stdarg.h stdlib.h string.h stropts.h sys/tty.h \
 		  sys/utsname.h sys/ptyvar.h sys/msgbuf.h sys/filio.h \
diff --git a/ifconfig/system.c b/ifconfig/system.c
index 7c00597..90030c7 100644
--- a/ifconfig/system.c
+++ b/ifconfig/system.c
@@ -26,6 +26,7 @@
 #elif defined __QNX__
 # include "system/qnx.c"
 # elif defined __DragonFly__ || defined __FreeBSD__ || \
+       defined __FreeBSD_kernel__ || \
        defined __NetBSD__ || defined __OpenBSD__
 #  include "system/bsd.c"
 #else
diff --git a/ifconfig/system.h b/ifconfig/system.h
index 7bc297d..f97618b 100644
--- a/ifconfig/system.h
+++ b/ifconfig/system.h
@@ -94,6 +94,7 @@ extern struct if_nameindex* (*system_if_nameindex) (void);
 # elif defined __QNX__
 #  include "system/qnx.h"
 # elif defined __DragonFly__ || defined __FreeBSD__ || \
+       defined __FreeBSD_kernel__ || \
        defined __NetBSD__ || defined __OpenBSD__
 #  include "system/bsd.h"
 # else
diff --git a/ifconfig/system/bsd.c b/ifconfig/system/bsd.c
index a42da42..601be88 100644
--- a/ifconfig/system/bsd.c
+++ b/ifconfig/system/bsd.c
@@ -26,6 +26,9 @@
 #include <net/if.h>
 #include <net/if_types.h>
 #include <net/if_dl.h>
+#ifdef HAVE_NETINET_ETHER_H
+# include <netinet/ether.h>
+#endif
 #include <netinet/if_ether.h>
 #include <ifaddrs.h>
 
diff --git a/ifconfig/system/bsd.h b/ifconfig/system/bsd.h
index 5b1b866..8143c34 100644
--- a/ifconfig/system/bsd.h
+++ b/ifconfig/system/bsd.h
@@ -28,6 +28,8 @@
 #  define IU_BSD_TYPE "dragonfly"
 # elif defined __FreeBSD__
 #  define IU_BSD_TYPE "freebsd"
+# elif defined __FreeBSD_kernel__
+#  define IU_BSD_TYPE "GNU/kFreeBSD"
 # elif defined __NetBSD__
 #  define IU_BSD_TYPE "netbsd"
 # elif defined __OpenBSD__
diff --git a/tests/ifconfig.sh b/tests/ifconfig.sh
index 6d438df..6561647 100755
--- a/tests/ifconfig.sh
+++ b/tests/ifconfig.sh
@@ -97,6 +97,18 @@ for fmt in ${FORMAT:-gnu gnu-one-entry net-tools osf unix}; do
     find_lo_addr $fmt || { errno=1; echo >&2 "Failed with format '$fmt'."; }
 done
 
+# Informational check whether the legacy form use
+# is implemented.  No error produced, only message.
+
+if $IFCONFIG $LO >/dev/null 2>&1; then
+    :
+else
+    cat <<-EOT
+	Hint: This system does not yet support the legacy use
+	      which does without switches:  ifconfig $LO
+EOT
+fi
+
 test $errno -ne 0 || $silence echo "Successful testing".
 
 exit $errno

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

Summary of changes:
 ChangeLog             |   20 ++++++++++++++++++++
 configure.ac          |    4 ++--
 ifconfig/system.c     |    1 +
 ifconfig/system.h     |    1 +
 ifconfig/system/bsd.c |    3 +++
 ifconfig/system/bsd.h |    2 ++
 tests/ifconfig.sh     |   12 ++++++++++++
 7 files changed, 41 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Mon Sep 09 16:37:16 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VJ8Cy-0002TO-72
	for mharc-commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:37:16 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46352)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ8Cw-0002S6-0W
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:37:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ8Cu-0003i9-57
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:37:13 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:43551)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJ8Cu-0003i5-25
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 16:37:12 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VJ8Ct-0005Cw-Es
	for commit-inetutils@gnu.org; Mon, 09 Sep 2013 20:37:11 +0000
Date: Mon, 09 Sep 2013 20:37:11 +0000
Message-Id: <E1VJ8Ct-0005Cw-Es@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-340-g9bbef0c
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 5b5ba41fae8baa3cae3d20bab6b8ef8e79f10aaa
X-Git-Newrev: 9bbef0cb92f92b12586d0368ff05b15f73ba74c9
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 20:37:15 -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  9bbef0cb92f92b12586d0368ff05b15f73ba74c9 (commit)
      from  5b5ba41fae8baa3cae3d20bab6b8ef8e79f10aaa (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=9bbef0cb92f92b12586d0368ff05b15f73ba74c9


commit 9bbef0cb92f92b12586d0368ff05b15f73ba74c9
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Mon Sep 9 15:20:10 2013 +0200

    ftp: Guard buffer size.

diff --git a/ChangeLog b/ChangeLog
index 32217f3..3cf43a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,31 @@
 2013-09-08  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	ftp: Guard buffer size.
+	An evil SHELL in environment would overflow a buffer.
+
+	* ftp/cmds.c (shell): Step over a slash in NAMEP
+	only if one was found.  Use strncat() with correct
+	length parameter, instead of strcat().
+
+
+	Minor coding issues.
+
+	* ftp/ftp.c (pswitch) <struct comvars>: Declare array
+	sizes for `nti[]' and `nto[]' to be identical to those
+	of `ntin[]' and `ntout[]'.
+
+	* ftp/ftp_var.h (stringbase, argbuf, argbase):
+	Remove declarations.
+	* ftp/main.c (argbase, argbuf, atringbase):
+	New static string variables.
+
+	* telnet/Makefile.am: Add @PATHDEFS_MAKE@.
+	(AM_CPPFLAGS): Add $(PATHDEF_BSHELL).
+	* telnet/commands.c (shell): Use PATH_BSHELL as default
+	shell.  Put assignment before if-clause.
+
+2013-09-08  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	ifconfig: Legacy use with GNU/kFreeBSD.
 
 	* configure.ac: Check for header <netinet/ether.h>.
diff --git a/NEWS b/NEWS
index c1f4992..6a50f88 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,9 @@ Called as `pftp', passive mode is preset.  New switch `-e/--no-edit'
 for compatibility with other implementations.  Can now be built
 without readline ability: configure using `--disable-readline'.
 New command `lpwd' avoids a shell call for a common task.
+The legacy limit for lengths of input lines (previously 200)
+has been removed.  Now it is system dependent and is in common
+with most other tools.
 
 * ifconfig
 
diff --git a/ftp/cmds.c b/ftp/cmds.c
index a89ecbe..15ecefc 100644
--- a/ftp/cmds.c
+++ b/ftp/cmds.c
@@ -1623,9 +1623,11 @@ shell (int argc, char **argv _GL_UNUSED_PARAMETER)
 	shell = PATH_BSHELL;
       namep = strrchr (shell, '/');
       if (namep == NULL)
-	namep = shell;
+	namep = shell;		/* No slash in this name.  */
+      else
+	namep++;		/* Skip the slash character.  */
       strcpy (shellnam, "-");
-      strcat (shellnam, ++namep);
+      strncat (shellnam, namep, sizeof (shellnam) - 2);
       if (strcmp (namep, "sh") != 0)
 	shellnam[0] = '+';
       if (debug)
diff --git a/ftp/ftp.c b/ftp/ftp.c
index 318a2f6..6fd0e19 100644
--- a/ftp/ftp.c
+++ b/ftp/ftp.c
@@ -314,11 +314,14 @@ login (char *host)
 	printf ("Name (%s): ", host);
       if (fgets (tmp, sizeof (tmp) - 1, stdin))
 	{
-	  /* If they press Ctrl-d immediately, it's empty.  */
+	  /* If the user presses return immediately, we get "\n".
+	   * In all other cases, the assignment is a no-op,
+	   * and is always well defined thanks to fgets().
+	   */
 	  tmp[strlen (tmp) - 1] = '\0';
 	}
       else
-	*tmp = '\0';
+	*tmp = '\0';		/* Ctrl-D received.  */
       if (*tmp == '\0')
 	user = myname;
       else
@@ -1614,8 +1617,8 @@ pswitch (int flag)
     int runqe;
     int mcse;
     int ntflg;
-    char nti[17];
-    char nto[17];
+    char nti[sizeof (ntin)];
+    char nto[sizeof (ntout)];
     int mapflg;
     char *mi;
     char *mo;
diff --git a/ftp/ftp_var.h b/ftp/ftp_var.h
index dedb357..0b25f5a 100644
--- a/ftp/ftp_var.h
+++ b/ftp/ftp_var.h
@@ -116,10 +116,6 @@ FTP_EXTERN jmp_buf toplevel;	/* non-local goto stuff for cmd scanner */
 FTP_EXTERN char *line;		/* input produced by readline or getline */
 FTP_EXTERN size_t linelen;	/* allocated length of the same, if known */
 
-FTP_EXTERN char *stringbase;	/* current scan point in line buffer */
-FTP_EXTERN char *argbuf;	/* allocated argument storage buffer */
-FTP_EXTERN char *argbase;	/* current storage point in arg buffer */
-
 #ifndef MAXMARGV
 # define MAXMARGV 20
 #endif
diff --git a/ftp/main.c b/ftp/main.c
index 630cfe5..b640d3c 100644
--- a/ftp/main.c
+++ b/ftp/main.c
@@ -96,6 +96,10 @@
 
 static char *slurpstring (void);
 
+static char *argbase;		/* current pointer into arg buffer */
+static char *argbuf;		/* allocated argument storage buffer */
+static char *stringbase;	/* current scan point in line buffer */
+
 #define DEFAULT_PROMPT "ftp> "
 static char *prompt = NULL;
 
diff --git a/telnet/Makefile.am b/telnet/Makefile.am
index 02e6ae9..8ebd02b 100644
--- a/telnet/Makefile.am
+++ b/telnet/Makefile.am
@@ -18,8 +18,11 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see `http://www.gnu.org/licenses/'.
 
+@PATHDEFS_MAKE@
+
 AM_CPPFLAGS = \
 	-DTERMCAP -DLINEMODE -DKLUDGELINEMODE -DENV_HACK \
+	$(PATHDEF_BSHELL) \
 	$(iu_INCLUDES) \
 	-I$(top_srcdir) \
 	$(NCURSES_INCLUDE) $(INCIDN)
diff --git a/telnet/commands.c b/telnet/commands.c
index a9ed244..f0307f7 100644
--- a/telnet/commands.c
+++ b/telnet/commands.c
@@ -1585,8 +1585,9 @@ shell (int argc, char *argv[] _GL_UNUSED_PARAMETER)
 
 	shellp = getenv ("SHELL");
 	if (shellp == NULL)
-	  shellp = "/bin/sh";
-	if ((shellname = strrchr (shellp, '/')) == 0)
+	  shellp = PATH_BSHELL;
+	shellname = strrchr (shellp, '/');
+	if (shellname == NULL)
 	  shellname = shellp;
 	else
 	  shellname++;

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

Summary of changes:
 ChangeLog          |   26 ++++++++++++++++++++++++++
 NEWS               |    3 +++
 ftp/cmds.c         |    6 ++++--
 ftp/ftp.c          |   11 +++++++----
 ftp/ftp_var.h      |    4 ----
 ftp/main.c         |    4 ++++
 telnet/Makefile.am |    3 +++
 telnet/commands.c  |    5 +++--
 8 files changed, 50 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Tue Sep 10 06:39:20 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VJLLs-0004GQ-HR
	for mharc-commit-inetutils@gnu.org; Tue, 10 Sep 2013 06:39:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51911)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJLLp-0004Ew-9d
	for commit-inetutils@gnu.org; Tue, 10 Sep 2013 06:39:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJLLo-0005mw-9l
	for commit-inetutils@gnu.org; Tue, 10 Sep 2013 06:39:17 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:57213)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VJLLo-0005mp-5e
	for commit-inetutils@gnu.org; Tue, 10 Sep 2013 06:39:16 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VJLLn-0007hg-G3
	for commit-inetutils@gnu.org; Tue, 10 Sep 2013 10:39:15 +0000
Date: Tue, 10 Sep 2013 10:39:15 +0000
Message-Id: <E1VJLLn-0007hg-G3@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-341-gaa759e0
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 9bbef0cb92f92b12586d0368ff05b15f73ba74c9
X-Git-Newrev: aa759e0f86f275bd673a9b6361cba20dff6b2210
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 10:39:18 -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  aa759e0f86f275bd673a9b6361cba20dff6b2210 (commit)
      from  9bbef0cb92f92b12586d0368ff05b15f73ba74c9 (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=aa759e0f86f275bd673a9b6361cba20dff6b2210


commit aa759e0f86f275bd673a9b6361cba20dff6b2210
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Tue Sep 10 12:22:44 2013 +0200

    ftp: Rare memory leak.

diff --git a/ChangeLog b/ChangeLog
index 3cf43a2..bcaef78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-09-10  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftp: Rare memory leak.
+
+	* ftp/ruserpass.c (remote_userpass) <missing domain>:
+	Assign empty string to MYDOMAIN, do not allocate.
+	The standard use is to set MYDOMAIN pointing into
+	MYNAME without allocation.  Do assignment of TMP
+	before if-clause.
+
 2013-09-08  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftp: Guard buffer size.
diff --git a/ftp/ruserpass.c b/ftp/ruserpass.c
index 8e1775c..4df004f 100644
--- a/ftp/ruserpass.c
+++ b/ftp/ruserpass.c
@@ -114,7 +114,7 @@ int
 remote_userpass (char *host, char **aname, char **apass, char **aacct)
 {
   char *hdir, buf[BUFSIZ], *tmp;
-  char *myname = 0, *mydomain;
+  char *myname, *mydomain;
   int t, c, usedefault = 0;
   size_t i;
   struct stat stb;
@@ -137,7 +137,8 @@ remote_userpass (char *host, char **aname, char **apass, char **aacct)
 
   mydomain = strchr (myname, '.');
   if (mydomain == NULL)
-    mydomain = xstrdup ("");
+    mydomain = "";
+
  next:
   while ((t = token ()))
     switch (t)
@@ -159,12 +160,14 @@ remote_userpass (char *host, char **aname, char **apass, char **aacct)
 	      goto match;
 	    if (strcasecmp (hostname, tokval) == 0)
 	      goto match;
-	    if ((tmp = strchr (hostname, '.')) != NULL
+	    tmp = strchr (hostname, '.');
+	    if (tmp != NULL
 		&& strcasecmp (tmp, mydomain) == 0
 		&& strncasecmp (hostname, tokval, tmp - hostname) == 0
 		&& tokval[tmp - hostname] == '\0')
 	      goto match;
-	    if ((tmp = strchr (host, '.')) != NULL
+	    tmp = strchr (host, '.');
+	    if (tmp != NULL
 		&& strcasecmp (tmp, mydomain) == 0
 		&& strncasecmp (host, tokval, tmp - host) == 0
 		&& tokval[tmp - host] == '\0')

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

Summary of changes:
 ChangeLog       |   10 ++++++++++
 ftp/ruserpass.c |   11 +++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Sep 13 16:53:31 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VKaMt-0001Ev-T6
	for mharc-commit-inetutils@gnu.org; Fri, 13 Sep 2013 16:53:31 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:40542)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VKaMo-00017p-4c
	for commit-inetutils@gnu.org; Fri, 13 Sep 2013 16:53:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VKaMm-000614-Dn
	for commit-inetutils@gnu.org; Fri, 13 Sep 2013 16:53:26 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:49214)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VKaMm-00060w-AM
	for commit-inetutils@gnu.org; Fri, 13 Sep 2013 16:53:24 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VKaMl-00067h-FU
	for commit-inetutils@gnu.org; Fri, 13 Sep 2013 20:53:23 +0000
Date: Fri, 13 Sep 2013 20:53:23 +0000
Message-Id: <E1VKaMl-00067h-FU@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-342-g489e189
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: aa759e0f86f275bd673a9b6361cba20dff6b2210
X-Git-Newrev: 489e189add01f52ece8ba68ea75ec5434f90f555
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 20:53:30 -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  489e189add01f52ece8ba68ea75ec5434f90f555 (commit)
      from  aa759e0f86f275bd673a9b6361cba20dff6b2210 (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=489e189add01f52ece8ba68ea75ec5434f90f555


commit 489e189add01f52ece8ba68ea75ec5434f90f555
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Sep 12 01:04:29 2013 +0200

    Fix comments in template.

diff --git a/ChangeLog b/ChangeLog
index bcaef78..73b429a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-09-12  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* configure.ac: Add a relevant comment where AC_DEFINE
+	and AH_TEMPLATE offered only the text `FIXME'.
+
+	* am/result.m4 (IU_RESULT_ACTIONS): Build a relevant
+	comment better than `FIXME'.
+
 2013-09-10  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftp: Rare memory leak.
diff --git a/TODO b/TODO
index 050313a..3ca7da3 100644
--- a/TODO
+++ b/TODO
@@ -164,6 +164,14 @@ prefixes.  Will anybody contribute it?
 
 Add Exodus rwhois server (e.g. 216.35.0.0/16).
 
+* rlogind, telnetd
+
+The Kerberized authentication is not passed on to login(1)
+on Solaris correctly, since its command line arguments are
+not understood properly from the manual page alone.  Do an
+analysis of the source code of login(1) from OpenSolaris to
+remedy this shortcoming.
+
 Local Variables:
 mode: outline
 End:
diff --git a/am/result.m4 b/am/result.m4
index 9511329..9761c00 100644
--- a/am/result.m4
+++ b/am/result.m4
@@ -31,7 +31,7 @@ AC_DEFUN([IU_RESULT_ACTIONS], [
 [if test "$$1" = yes; then
   ]ifelse([$3], ,
           [AC_DEFINE(HAVE_]translit($2, [a-z ./<>], [A-Z___])[, 1,
-	             [FIXME])],
+             [Define to 1 if ]translit($2, [a-z ./<>], [A-Z___])[ exists])],
           [$3])[
 else
   ]ifelse([$4], , [:], [$4])[
diff --git a/configure.ac b/configure.ac
index 201b80a..4197de9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -314,7 +314,7 @@ if test "$enable_encryption" = yes \
   AH_TEMPLATE(KRB4, [Define to one if you have Kerberos IV])
   AH_TEMPLATE(KRB5, [Define to one if you have Kerberos V])
   AH_TEMPLATE(SHISHI, [Define to 1 if you have Shishi])
-  AH_TEMPLATE(DES_ENCRYPTION, [FIXME])
+  AH_TEMPLATE(DES_ENCRYPTION, [Define to 1 if you have DES encryption])
 
   case $KERBEROS_VERSION in
   krb4)
@@ -618,10 +618,10 @@ AC_CHECK_HEADERS([arpa/nameser.h errno.h fcntl.h features.h \
 AC_TYPE_SIGNAL
 
 AC_CHECK_TYPE(socklen_t, ,
-              [AC_DEFINE([socklen_t], int,
-                         [Define to int if <sys/types.h> does not define])],
-              [IU_FLUSHLEFT([#include <sys/types.h>
-	                     #include <sys/socket.h>])])
+  [AC_DEFINE([socklen_t], int,
+    [Define to int if <sys/types.h> does not define])],
+  [IU_FLUSHLEFT([#include <sys/types.h>
+                 #include <sys/socket.h>])])
 
 AC_CHECK_TYPES(struct if_nameindex, , ,
   [IU_FLUSHLEFT([#include <sys/types.h>
@@ -629,13 +629,17 @@ AC_CHECK_TYPES(struct if_nameindex, , ,
                  #include <net/if.h>])])
 
 # sigset_t is a set of signals (4.4BSD)
-AC_CHECK_TYPE(sigset_t, , AC_DEFINE([sigset_t], unsigned long, [FIXME]),
+AC_CHECK_TYPE(sigset_t, ,
+  [AC_DEFINE([sigset_t], unsigned long,
+    [Define to `unsigned long' if not defined in <signal.h>])],
   [IU_FLUSHLEFT([#include <sys/types.h>
                  #include <signal.h> ])])
 
 # I'm not sure what this is, but netbsd has it; just use int if
 # necessary.
-AC_CHECK_TYPE(sig_atomic_t, , AC_DEFINE([sig_atomic_t], int, [FIXME]),
+AC_CHECK_TYPE(sig_atomic_t, ,
+  [AC_DEFINE([sig_atomic_t], int,
+    [Define to `int' if not defined in <signal.h>])],
   [IU_FLUSHLEFT([#include <sys/types.h>
                  #include <signal.h> ])])
 
@@ -848,7 +852,9 @@ AC_CHECK_DECLS(crypt, , , [#include <unistd.h>])
 
 # EWOULDBLOCK is more or less the BSD version of posix EAGAIN.
 IU_CHECK_MACRO(EWOULDBLOCK, [#include <errno.h>], , ,
-  AC_DEFINE([EWOULDBLOCK], EAGAIN, 1, [FIXME]))
+  [AC_DEFINE([EWOULDBLOCK], EAGAIN, 1,
+     [Define to EAGAIN if system does not provide EWOULDBLOCK])])
+
 AC_CHECK_DECLS(errno, , , [#include <errno.h>])
 
 # See whether <syslog.h> will declare special internal stuff if we
@@ -864,7 +870,8 @@ IU_CHECK_MACRO(syslog internal macros,
   [LOG_PRI LOG_FAC],
   AC_CHECK_TYPE(CODE,
     AC_CHECK_DECL(prioritynames,
-      AC_DEFINE([HAVE_SYSLOG_INTERNAL], 1, [FIXME]),,
+      [§AC_DEFINE([HAVE_SYSLOG_INTERNAL], 1,
+        [Define to 1 if <syslog.h> defines prioritynames])], ,
       iu_syslog_includes), , iu_syslog_includes),)
 undefine([iu_syslog_includes])
 
@@ -911,21 +918,21 @@ IU_CHECK_MACRO(SEEK_ macros,
   :,
   IU_CHECK_MACRO(L_ seek macros,
     [#include <unistd.h>], L_SET L_INCR L_XTND,
-    AC_DEFINE([SEEK_SET], L_SET, [FIXME])
-    AC_DEFINE([SEEK_CUR], L_INCR, [FIXME])
-    AC_DEFINE([SEEK_END], L_XTND, [FIXME]),
-    AC_DEFINE([SEEK_SET], 0, [FIXME])
-    AC_DEFINE([SEEK_CUR], 1, [FIXME])
-    AC_DEFINE([SEEK_END], 2, [FIXME])))
+    AC_DEFINE([SEEK_SET], L_SET, [Define to L_SET as replacement])
+    AC_DEFINE([SEEK_CUR], L_INCR, [Define to L_INCR as replacement])
+    AC_DEFINE([SEEK_END], L_XTND, [Define to L_XTND as replacement]),
+    AC_DEFINE([SEEK_SET], 0, [Define to 0 if missing])
+    AC_DEFINE([SEEK_CUR], 1, [Define to 1 if missing])
+    AC_DEFINE([SEEK_END], 2, [Define to 2 if missing])))
 
 # Look for the posix _FILENO macros; if not found, use the classic
 # unix values.
 IU_CHECK_MACRO(_FILENO macros,
   [#include <unistd.h>], STDIN_FILENO STDOUT_FILENO STDERR_FILENO,
   :,
-  AC_DEFINE([STDIN_FILENO], 0, [FIXME])
-  AC_DEFINE([STDOUT_FILENO], 1, [FIXME])
-  AC_DEFINE([STDERR_FILENO], 2, [FIXME]))
+  AC_DEFINE([STDIN_FILENO], 0, [Define to 0 if missing])
+  AC_DEFINE([STDOUT_FILENO], 1, [Define to 1 if missing])
+  AC_DEFINE([STDERR_FILENO], 2, [Define to 2 if missing]))
 
 # See where to find fd_set (bit-vectors for select) manipulation
 # macros.
@@ -975,11 +982,12 @@ case "$host" in
     # Older Solaris variants.
     ;;
   esac
-  AC_DEFINE([SOLARIS], 1, [FIXME])
-  AC_DEFINE([HAVE_STREAMSPTY], 1, [FIXME])
+  AC_DEFINE([SOLARIS], 1, [Define to 1 for any Solaris system])
+  AC_DEFINE([HAVE_STREAMSPTY], 1,
+    [Define to 1 for a system using streams for ptys])
   ;;
 *irix* | *hpux* )
-  # Known and needed workarounds?
+  # Known and needed work-arounds?
   ;;
 esac
 

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

Summary of changes:
 ChangeLog    |    8 ++++++++
 TODO         |    8 ++++++++
 am/result.m4 |    2 +-
 configure.ac |   50 +++++++++++++++++++++++++++++---------------------
 4 files changed, 46 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Sat Sep 14 21:45:05 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VL1Ob-0005vo-2c
	for mharc-commit-inetutils@gnu.org; Sat, 14 Sep 2013 21:45:05 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56959)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VL1OY-0005uT-OB
	for commit-inetutils@gnu.org; Sat, 14 Sep 2013 21:45:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VL1OT-0007XA-O8
	for commit-inetutils@gnu.org; Sat, 14 Sep 2013 21:45:02 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:55510)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VL1OT-0007X4-Jt
	for commit-inetutils@gnu.org; Sat, 14 Sep 2013 21:44:57 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VL1OS-0007Qv-SQ
	for commit-inetutils@gnu.org; Sun, 15 Sep 2013 01:44:57 +0000
Date: Sun, 15 Sep 2013 01:44:57 +0000
Message-Id: <E1VL1OS-0007Qv-SQ@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-343-gea7b8e2
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 489e189add01f52ece8ba68ea75ec5434f90f555
X-Git-Newrev: ea7b8e2c2d266fea32124c1ca7f564b5cd03f74c
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Sep 2013 01:45:04 -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  ea7b8e2c2d266fea32124c1ca7f564b5cd03f74c (commit)
      from  489e189add01f52ece8ba68ea75ec5434f90f555 (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=ea7b8e2c2d266fea32124c1ca7f564b5cd03f74c


commit ea7b8e2c2d266fea32124c1ca7f564b5cd03f74c
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sun Sep 15 03:26:06 2013 +0200

    telnet: Uninitialized array of pointers.

diff --git a/ChangeLog b/ChangeLog
index 73b429a..2329d79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2013-09-15  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	telnet: Uninitialized array of pointers.
+	Contemporary tgetent() emulations are known to ignore
+	the scratch buffer, as well as fill it in (contrary to
+	claim in manual page).  Account for this.
+
+	* telnet/telnet.c (mklist): Return quickly in case of
+	an empty first parameter `buf'.  Carefully initialize
+	`*ARGVP' to NULL at every stage.
+
+
+	Harmless memory leak in test program.
+
+	* tests/localhost.c: Include <stdlib.h>.
+	(main): Remove `const' on P, and it free after use.
+
 2013-09-12  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* configure.ac: Add a relevant comment where AC_DEFINE
diff --git a/telnet/telnet.c b/telnet/telnet.c
index 73406ed..9dda4a3 100644
--- a/telnet/telnet.c
+++ b/telnet/telnet.c
@@ -633,30 +633,41 @@ mklist (char *buf, char *name)
     }
   else
     unknown[0] = name_unknown;
+
+  /*
+   * An empty capability buffer finishes the analysis.
+   */
+  if (!buf || !*buf)
+    return (unknown);
+
   /*
-   * Count up the number of names.
+   * Count the number of alias names.
+   * Stop at the first field separator, a colon.
    */
   for (n = 1, cp = buf; *cp && *cp != ':'; cp++)
     {
       if (*cp == '|')
 	n++;
     }
+
   /*
-   * Allocate an array to put the name pointers into.
+   * Allocate an array to hold the name pointers.
    */
   argv = (char **) malloc ((n + 3) * sizeof (char *));
   if (argv == 0)
     return (unknown);
 
   /*
-   * Fill up the array of pointers to names.
+   * Fill the array of pointers with the established aliases.
+   * Reserve the first slot for the preferred name.
    */
-  *argv = 0;
   argvp = argv + 1;
-  n = 0;
+  *argv = *argvp = 0;
+  n = 0;		/* Positive: name uses white space.  */
+
   for (cp = cp2 = buf; (c = *cp); cp++)
     {
-      if (c == '|' || c == ':')
+      if (c == '|' || c == ':')		/* Delimiters */
 	{
 	  *cp++ = '\0';
 	  /*
@@ -667,21 +678,28 @@ mklist (char *buf, char *name)
 	   * insensitive) add it to the list.
 	   */
 	  if (n || (cp - cp2 > 41))
-	    ;
+	    ;			/* Ignore the just scanned name.  */
 	  else if (name && (strncasecmp (name, cp2, cp - cp2) == 0))
-	    *argv = cp2;
+	    *argv = cp2;	/* Preferred name, exact match.  */
 	  else if (is_unique (cp2, argv + 1, argvp))
-	    *argvp++ = cp2;
+	    {
+	      *argvp++ = cp2;
+	      *argvp = 0;	/* Prevent looking forward.  */
+	    }
+
+	  /* Abort parsing at first field delimiter.  */
 	  if (c == ':')
 	    break;
+
 	  /*
-	   * Skip multiple delimiters. Reset cp2 to
-	   * the beginning of the next name. Reset n,
+	   * Skip multiple delimiters. Reset CP2 to
+	   * the beginning of the next name. Reset N,
 	   * the flag for names with spaces.
 	   */
 	  while ((c = *cp) == '|')
 	    cp++;
-	  cp2 = cp;
+
+	  cp2 = cp;		/* Proceed to next alias name.  */
 	  n = 0;
 	}
       /*
@@ -733,8 +751,8 @@ mklist (char *buf, char *name)
     return (unknown);
 }
 
-/* Mostly ignored by contemorary implementations,
- * but still used by NetBSD.
+/* Claimed to be ignored by contemporary implementations,
+ * but still modified by FreeBSD and NetBSD.
  * mklist will examine this buffer, so erase it
  * to cover corner cases.
  */
diff --git a/tests/localhost.c b/tests/localhost.c
index ec914b0..aa25b9f 100644
--- a/tests/localhost.c
+++ b/tests/localhost.c
@@ -22,18 +22,20 @@
 #include "libinetutils.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <unused-parameter.h>
 #include <progname.h>
 
 int
 main (int argc _GL_UNUSED_PARAMETER, char **argv)
 {
-  const char *p = localhost ();
+  char *p = localhost ();
   set_program_name (argv[0]);
   if (!p)
     return 1;
 
   printf ("localhost: %s\n", p);
+  free (p);
 
   return 0;
 }

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

Summary of changes:
 ChangeLog         |   17 +++++++++++++++++
 telnet/telnet.c   |   46 ++++++++++++++++++++++++++++++++--------------
 tests/localhost.c |    4 +++-
 3 files changed, 52 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Sep 18 10:41:32 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VMIwd-0006Pn-MX
	for mharc-commit-inetutils@gnu.org; Wed, 18 Sep 2013 10:41:31 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60286)
	by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <ams@gnu.org>)
	id 1VMIwZ-0006It-Qi
	for commit-inetutils@gnu.org; Wed, 18 Sep 2013 10:41:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ams@gnu.org>) id 1VMIwU-0004f2-Al
	for commit-inetutils@gnu.org; Wed, 18 Sep 2013 10:41:27 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:50156)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ams@gnu.org>)
	id 1VMIwU-0004ex-7V
	for commit-inetutils@gnu.org; Wed, 18 Sep 2013 10:41:22 -0400
Received: from ams by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <ams@gnu.org>) id 1VMIwT-0002Dh-RF
	for commit-inetutils@gnu.org; Wed, 18 Sep 2013 14:41:22 +0000
Date: Wed, 18 Sep 2013 14:41:21 +0000
Message-Id: <E1VMIwT-0002Dh-RF@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-345-gbedab2f
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: ea7b8e2c2d266fea32124c1ca7f564b5cd03f74c
X-Git-Newrev: bedab2f2d1f87a5a84866e9cf26b982a2f14e61a
From: "Alfred M. Szmidt" <ams@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Sep 2013 14:41:30 -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  bedab2f2d1f87a5a84866e9cf26b982a2f14e61a (commit)
       via  385a79097984f95c4661fece8f6f3fd3e9545324 (commit)
      from  ea7b8e2c2d266fea32124c1ca7f564b5cd03f74c (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=bedab2f2d1f87a5a84866e9cf26b982a2f14e61a


commit bedab2f2d1f87a5a84866e9cf26b982a2f14e61a
Author: Alfred M. Szmidt <ams@gnu.org>
Date:   Wed Sep 18 16:12:50 2013 +0200

    NEWS: Bump version. (silent change)

diff --git a/NEWS b/NEWS
index 6a50f88..940d854 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ Foundation, Inc.  See the end of this file for license conditions.
 
 Please send inetutils bug reports to <bug-inetutils@gnu.org>.
 
+September 18, 2013
+Version 1.9.1.100:
+
 An advisory file CHECKLIST containing testing and verification
 advice has been added, pointing administrators to important
 properties and settings for built executables.

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


commit 385a79097984f95c4661fece8f6f3fd3e9545324
Author: Alfred M. Szmidt <ams@gnu.org>
Date:   Wed Sep 18 15:51:00 2013 +0200

    Skip several syntax checks from maint.mk.

diff --git a/ChangeLog b/ChangeLog
index 2329d79..fc172a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-09-18  Alfred M. Szmidt  <ams@gnu.org>
+
+	* cfg.mk (local-checks-to-skip): Added the
+	sc_cast_of_x_alloc_return_value, sc_copyright_check,
+	sc_program_name, sc_prohibit_always_true_header_tests,
+	sc_prohibit_assert_without_use, sc_prohibit_doubled_word,
+	sc_prohibit_error_without_use, sc_prohibit_have_config_h,
+	sc_prohibit_magic_number_exit, sc_prohibit_strncpy,
+	sc_prohibit_undesirable_word_seq, sc_prohibit_xalloc_without_use
+	to list.
+
 2013-09-15  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	telnet: Uninitialized array of pointers.
diff --git a/cfg.mk b/cfg.mk
index 917c7d7..9b89f12 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -23,6 +23,18 @@ _makefile_at_at_check_exceptions = ' && !/PATHDEFS_MAKE/'
 _build-aux = build-aux
 
 local-checks-to-skip = \
+	sc_cast_of_x_alloc_return_value \
+	sc_copyright_check \
+	sc_program_name \
+	sc_prohibit_always_true_header_tests \
+	sc_prohibit_assert_without_use \
+	sc_prohibit_doubled_word \
+	sc_prohibit_error_without_use \
+	sc_prohibit_have_config_h \
+	sc_prohibit_magic_number_exit \
+	sc_prohibit_strncpy \
+	sc_prohibit_undesirable_word_seq \
+	sc_prohibit_xalloc_without_use \
 	sc_error_message_period \
 	sc_error_message_uppercase \
 	sc_immutable_NEWS \

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

Summary of changes:
 ChangeLog |   11 +++++++++++
 NEWS      |    3 +++
 cfg.mk    |   12 ++++++++++++
 3 files changed, 26 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Sep 18 10:41:39 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VMIwl-0006ce-4G
	for mharc-commit-inetutils@gnu.org; Wed, 18 Sep 2013 10:41:39 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60300)
	by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <ams@gnu.org>)
	id 1VMIwc-0006Nx-ML
	for commit-inetutils@gnu.org; Wed, 18 Sep 2013 10:41:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ams@gnu.org>) id 1VMIwZ-0004ft-TD
	for commit-inetutils@gnu.org; Wed, 18 Sep 2013 10:41:30 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:50163)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ams@gnu.org>)
	id 1VMIwZ-0004fk-PR
	for commit-inetutils@gnu.org; Wed, 18 Sep 2013 10:41:27 -0400
Received: from ams by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <ams@gnu.org>) id 1VMIwZ-0002Er-Gj
	for commit-inetutils@gnu.org; Wed, 18 Sep 2013 14:41:27 +0000
Date: Wed, 18 Sep 2013 14:41:27 +0000
Message-Id: <E1VMIwZ-0002Er-Gj@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  annotated tag, inetutils-1_9_1_100,
	created. inetutils-1_9_1_100
X-Git-Refname: refs/tags/inetutils-1_9_1_100
X-Git-Reftype: annotated tag
X-Git-Oldrev: 0000000000000000000000000000000000000000
X-Git-Newrev: bffeb9e872473cbabf8cd6f35ed2c7b40cfed899
From: "Alfred M. Szmidt" <ams@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Sep 2013 14:41:37 -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 annotated tag, inetutils-1_9_1_100 has been created
        at  bffeb9e872473cbabf8cd6f35ed2c7b40cfed899 (tag)
   tagging  bedab2f2d1f87a5a84866e9cf26b982a2f14e61a (commit)
  replaces  inetutils-1_9_1
 tagged by  Alfred M. Szmidt
        on  Wed Sep 18 16:14:13 2013 +0200

- Log -----------------------------------------------------------------
inetutils 1.9.1.100 (alpha)

Alfred M. Szmidt (17):
      src/inetd.c (main, tcpmux, chargen_dg, chargen_stream, nextconfig,
      bootstrap: Updated from gnulib.
      New syntax rule to checks for assignments inside if statements: sc_assignment_in_if.
      Silence sc_makefile_at_at_check.
      bootstrap.conf (gnulib_modules): Sort lexically.
      Revert to commit 99c71142f24033c2027a846df7c68be60f0625ef.  (silent
      Check return code of malloc, or use xmalloc.
      Create xz compressed tarballs as part of `make dist'.
      tests/.gitignore: Added tools.sh to list.
      ChangeLog: Formating fixes.  (silent change)
      Makefile.am (DISTCLEANFILES): Added $(PACKAGE)-$(VERSION).tar.xz to list.
      README: Updated.  (silent change)
      README-alpha: Updated.  (silent change)
      configure.ac: Replace M4 comments with `#'.  (silent change)
      configure.ac: Minor cleanup.
      Skip several syntax checks from maint.mk.
      NEWS: Bump version. (silent change)

Guillem Jover (2):
      Cleanup automake variables.
      Use standard suid-mode.

Mats Erik Andersson (314):
      telnet: Non-constant format strings.
      telnet: Filename buffer overrun when tracing.
      ifconfig: Portability fix.
      ftpd: Inetd-mode with EPRT and EPSV.
      ftpd: Standalone-mode with IPv6.
      Test portability fix.
      Portability of user identity.
      Portability of FTP and TFTP tests.
      tests/syslogd.sh: Refinement and robustness.
      Prerequisites for test execution.
      tests/syslogd.sh: Avoid long socket name.
      Seek free port while testing.
      libtelnet: Wrong declaration, missing prototypes.
      Robustness of tests and TFTP client.
      libtelnet: Portability of macros.
      Protect headers in Kerberos code.
      Fix incomplete Kerberos code.
      Remove unneeded library dependencies.
      Restart failed TFTP test.
      Missing prototypes with libshishi.
      Tighten test diagnosis for FTP and TFTP.
      False negatives in test evaluations.
      Ducument test dependency. (silent change)
      libinetutils: Actually use INCAUTH.
      logger: Add standard option `-u'.
      tests/tftp.sh: Activate job control.
      Test presence of lookup files.
      syslogd: Allow use of non-standard ports.
      Test syslogd on standard port.
      Update sensing of Kerberos5 implementation.
      ftpd: Portability fix.
      Use gnulib module sethostname.
      Address resolution and reduced linking.
      Basic telnet test.
      tests/telnet-localhost.sh: Assure active TTY.
      inetd: Allow runtime group identity.
      Test script review.
      Revert removal of header inclusion. (silent change)
      Reduce test script prerequisites.
      Tests for configuration reload.
      ftp: Relax need for service lookup.
      tftp: Silence prompt for non-interactive.
      ping,ping6: Host resolving issues.
      whois: Update TLD server list.
      traceroute: Print format changes.
      Detection of termcap and libwrap.
      Shell portability issue in test.
      Diagnose linking to libtermlib correctly.
      Common helper for test scripts.
      tests: Distribute tools.sh.in.
      Portability fixes and cleanup.
      ftpd: Incomplete access verification.
      rexec, rexecd: Corrected functionality.
      rexec, rexecd: Reliability and exit codes.
      rexec, rexecd: Implement support for IPv6.
      ping, ping6, traceroute: 64-bit portability issues.
      rexecd: Protocol conformity and privilege audit.
      rexecd: Implement system logging.
      rexec: Password from stdin.
      ping: Payload adjustment.
      ping, ping6, traceroute: Portability and regression.
      libicmp, ping: Symbolic sizes. Better diagnostics.
      libicmp, ping, ping6: Endianness conversions.
      ping, ping6: Critical sizing errors.
      ping: Identify UTC time stamps.
      ping, ping6: Time-to-live, hoplimit.
      ping, ping6: Additional verbosity.
      ping, ping6: Refactor common resolver.
      traceroute: Identity and sequence.
      ping: Support IP option Timestamp.
      traceroute: Handle unreachable destinations.
      Build test binaries early.
      ping, traceroute: Type-of-service.
      rexecd: Allow getpwnam_r.
      rexecd: Implement PAM support.
      ftp: Large file offsets.
      ftp: Missing inclusion.
      ftp: Large file's accounting.
      More FTP test cases.
      ftpd: Grave binary mode issues.
      Incomplete variadic printing.
      ftpd: Adaptive block sizes.
      ftp: Adaptive block size.
      Documentation (silent change).
      ftpd: Long passive transfer request.
      ftpd: Only allow Linux-PAM.
      ftpd: Audit of PAM code.
      rexecd: PAM code audit.
      ftpd: LPRT transfer request.
      rexecd, rlogind: Review use of LOG_AUTH.
      rshd: Prefer use of getpwnam_r.
      rshd: Support PAM.
      rshd: Host resolver changes.
      rcp, rsh, rshd: Alternate r-calls.
      rshd: Add PAM session code.
      rcp, rlogin, rsh, rshd: IPv6 ability.
      rlogind: Address manipulations.
      rshd: Usability with deactivated Shishi.
      rlogin, rsh: Libshishi issues.
      Shishi related error messages.
      rsh, rshd: Verified Shishi support.
      rshd: PAM conversation matters.
      rshd: 64-bit issue with libshishi.
      Solaris builds with libshishi.
      telnet: Service and realm for libshishi.
      telnetd: Authmode only with Kerberos.
      telnetd: Effective authentication modes.
      rlogin: Usable non-authenticating libshishi.
      rlogin: Close libshishi handle.
      r-commands: Partial IPv6 support.
      rlogin, rsh: IPv6 with libshishi.
      rlogin, rsh: Host lookup.
      rcp, rlogin, rlogind: IP_TOS mending.
      rcp: Non-encrypting libshishi support.
      rlogind, rshd: Protocol coherence.
      Out-of-tree binary build.
      Reworked support for utmpx/utmp.
      Macro usage for socket lengths.
      rlogind, rshd: Exchange protocol audit.
      Authorization type k5login.
      Documentation (silent change)
      Update makefile templates.
      Test script update.
      Refine r-commands with libshishi.
      rcp, rlogin, rsh: Better setuid checking.
      telnetd: Server principal naming.
      telnet: Activate principal naming.
      Realm for server lookup.
      Test script update.
      Configuration impovements.
      ping, ping6: Support IDN named hosts.
      talkd: Nominally functional ACL checking.
      talkd: Full ACL implementation.
      Compiler warnings.
      talk, talkd: Compiler warnings.
      traceroute: Support IDN named hosts.
      talk, talkd: Portability issue.
      ping, ping6: Compiler warnings.
      ftpd, libls: Compiler warnings.
      Address resolution alternative.
      Configuration of library linkage.
      telnetd: Compiler warnings.
      telnetd: More compiler warnings.
      libinetutils: Compiler warnings.
      Missing values in initialization.
      Mark unused parameters.
      talk, talkd: User interface and security.
      Consistency checks.
      Discard strange utmpx.
      rlogin: Signal protection issues.
      rlogind: Daemon mode update.
      uucpd: Restore inetd code.
      uucpd: Upgrade, including IPv6.
      Overflow protection.
      ping, traceroute: IDN for glibc.
      telnet: Signal action portability.
      rlogind: Support libwrap in daemon mode.
      Documentation (silent change)
      telnetd: Resolve mixed up host names.
      rlogind: Protect code blocks for Kerberos.
      rlogin: Urgent data handling.
      rlogind: Name specification in Kerberos mode.
      ftpd: Prevent privilege escalation.
      ftpd: User session close down.
      syslogd: Portability of utmp reading.
      ftpd: PAM messaging robustness.
      ftpd: Glob overflow and dereference.
      ftp: Support standard options.
      Test script for read_utmp.
      ftp: Building with readline is optional.
      telnet: Port sanity check.
      telnet: Portability matter.
      rlogind: Buffer overflow with encryption.
      rlogind: Force encrypted sessions.
      rcp: Encrypted libshishi support.
      Consistent macro usage.
      Mixed testing issues.
      Disable targets robustly.
      syslogd, talkd: Alternative utmp access.
      syslogd: Adapt to legacy utmp.
      ifconfig: Stub for BSD systems.
      Distribute new files.
      Add a lost file.
      ifconfig: Interface listing mode.
      ifconfig: Address changing on BSD.
      ifconfig: Hwaddr support for BSD.
      ifconfig: Output formatting.
      syslogd: Reuse socket addresses.
      Move if_nameindex to libinetutils.
      Add tests/ifconfig.sh. (silent change)
      Small fixes.
      ifconfig: Displaying of interface metric.
      ifconfig: Parse command line for BSD.
      ifconfig: Protect interface flag operations.
      rcp: Tracking of allocated buffer.
      Activate servers for FreeBSD 9.
      Documentation (silent change)
      Documentation (silent change)
      ftp: Check for allocated buffer.
      ftp: Buffer errors in nmap mode.
      ftp-localhost.sh: New subtest.
      traceroute: Common behaviour.
      tftpd: Chrooted mode.
      tftpd: Group setting.
      tftpd: Error handling.
      Documentation (silent change).
      ping, ping6: Error handling.
      ping: Less verbosity in echo mode.
      ping6: Verbose packet info.
      ping: CVE-2010-2529
      ping6: More options.
      Support recent automake.
      traceroute: Source routing.
      Documentation (silent change).
      libls: Use __opendir2 if present.
      Code formatting (silent change).
      libls: Small code audit.
      syslogd: Portably restart signals.
      syslogd: Logging on program name.
      Refine transfer sub-test for FTP.
      Relax setuid demands.
      bootstrap: Updated from gnulib
      rcp: Portability fixes.
      rcp: Implement directory switch.
      rlogind: Initial PAM support.
      rlogind: Additional user check.
      rlogind: PAM support with libshishi.
      rshd: Differentiate PAM services.
      rlogind: Incomplete source route security.
      ftpd: Support PAM beyond Linux-PAM.
      ftpd: Portability of PAM to Solaris.
      Documentation (silent change).
      Detection of Kerberos5.
      Partial adaptions to Kerberos5.
      telnet: Specify realm with Kerberos5.
      Configuration summary.
      More IDN support for clients.
      talk: Address resolution.
      talk: Non-ASCII characters.
      telnet, telnetd: Buffer security.
      Documentation
      Summary printout.
      Working distcheck target.
      rlogind: Side stepped error message.
      rlogind, rshd: Set realm with Kerberos5.
      rlogind, rshd: Diagnostics with libshishi.
      Detection of libidn and krb5.
      syslogd: Probe recurring test errors.
      rcp: Make encryption portable.
      ftpd: Account expiration.
      Small code clean-up.
      configure.ac: Minor clean-up.
      libtelnet: Parity adjust non-DES key.
      logger: Default priority.
      Login fixes for Solaris.
      libtelnet: Availability of DES_OFB64.
      libtelnet: Check authentication name strings.
      telnetd: Silence unwanted debugging.
      Audit of login options.
      rlogind: Client's principal name.
      rshd: Client's principal name.
      libtelnet: Standard type for strings.
      ftp, telnet: Erase passwords after use.
      libtelnet: Selected compiler warnings.
      libtelnet: Portability of enctype_names.
      libtelnet: Unused parameters.
      Mixed compiler warnings.
      Update copyright years with 2013. (silent change)
      rshd: Locked or expired accounts.
      syslogd: Refactor configuration loading.
      syslogd: Load configuration from directory.
      tests: Directory loading in syslogd.
      logger: Flexible UNIX socket name.
      ftpd: Erroneous access check.
      Portable value for PATH_NOLOGIN.
      ftpd: Group name matching.
      Documentation
      ftpd: Prevent disclosure of system version.
      telnetd: Portability of banner.
      telnetd: Reverse resolution of client.
      rlogind: Error handling.
      rshd: Require host name.
      traceroute: Portability of PID range.
      traceroute: Gateway selection.
      talk, talkd: Convenience changes.
      bootstrap: Updated from gnulib.
      talkd: Less ACL-logging.
      Documentation (silent change)
      talkd: Small audit of ACL.
      syslogd: Elementary fix.
      One new test script.
      Make test robust.
      Needing tty for inetd test.
      Run inetd test without tty.
      False negative in test.
      ftp: Secrecy in debug mode.
      Portability of Unix macros.
      ftp: New command lpwd.
      Documentation (silent change)
      Handle socket debugging.
      bootstrap: Updated from gnulib.
      Support BSD libedit.
      ftpd: Status reveals timeout.
      Diagnostics in syslogd test.
      ftp: Avoid numeric size coding.
      ftp: Macro execution segfaults.
      ftp: Minor allocation issues.
      ftp: Macro execution and allocation.
      ftp: Remove line length limit.
      ifconfig: Legacy use with GNU/kFreeBSD.
      ftp: Guard buffer size.
      ftp: Rare memory leak.
      Fix comments in template.
      telnet: Uninitialized array of pointers.

Simon Josefsson (12):
      ftpd/ftpd.c (options): Don't use OPTION_ARG_OPTIONAL for -a.
      README (Notes): Doc fix.
      Add new tool dnsdomainname.
      tests/dnsdomainname.sh: Don't fail on configuration errors.
      tests/dnsdomainname.sh: Reject non-0 and non-1 exit codes (i.e., crashes).
      dnsdomainname: Don't error when no domain component.
      dnsdomainname: Doc fixes.
      bootstrap: Updated from gnulib.
      bootstrap: Updated from gnulib.
      telnet: fix responding to DO commands, by initializing variables properly.
      Don't busy loop when waiting for data from client.
      Use 2kb buffer, as suggested by GNU termcap manual.

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


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Sep 19 09:05:07 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VMdus-0000pq-Ur
	for mharc-commit-inetutils@gnu.org; Thu, 19 Sep 2013 09:05:06 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54762)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VMdum-0000nK-4U
	for commit-inetutils@gnu.org; Thu, 19 Sep 2013 09:05:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VMdug-0006C6-Bo
	for commit-inetutils@gnu.org; Thu, 19 Sep 2013 09:05:00 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:60946)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VMdug-0006C2-7i
	for commit-inetutils@gnu.org; Thu, 19 Sep 2013 09:04:54 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VMduf-0002p6-GI
	for commit-inetutils@gnu.org; Thu, 19 Sep 2013 13:04:53 +0000
Date: Thu, 19 Sep 2013 13:04:53 +0000
Message-Id: <E1VMduf-0002p6-GI@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1_100-1-g3dc3bb4
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: bedab2f2d1f87a5a84866e9cf26b982a2f14e61a
X-Git-Newrev: 3dc3bb447e058b7903b242ce231a27736c569066
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 19 Sep 2013 13:05:06 -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  3dc3bb447e058b7903b242ce231a27736c569066 (commit)
      from  bedab2f2d1f87a5a84866e9cf26b982a2f14e61a (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=3dc3bb447e058b7903b242ce231a27736c569066


commit 3dc3bb447e058b7903b242ce231a27736c569066
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Sep 19 02:20:37 2013 +0200

    ifconfig: Status and medium reports.
    
    Provide BSD systems, including GNU/kFreeBSD, with
    information on status and medium of the given unit.

diff --git a/ChangeLog b/ChangeLog
index fc172a3..4f2b026 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+2013-09-19  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ifconfig: Status and medium reports on BSD.
+
+	* ifconfig/options.c (formats) <gnu, net-tools, unix>:
+	Add medium and status to printout.
+	* ifconfig/printif.c (format_handles): Add keys
+	`media?', `media', `status?', and `status'.
+	(fh_media_query, fh_media, fh_status_query, fh_status):
+	New functions.
+	* ifconfig/printif.h (fh_media_query, fh_media)
+	(fh_status_query, fh_status): New declarations.
+
+	* ifconfig/system/bsd.c: Include <net/if_media.h>.
+	(ifm) [SIOCGIFMEDIA]: New variable.
+	(media_descr): New variable.
+	(subtype_descr) [IFM_SUBTYPE_DESCRIPTIONS]: Likewise.
+	(ethernet_descr) [IFM_SUBTYPE_ETHERNET_DESCRIPTIONS]:
+	Likewise.
+	(subtype_shared_descr) [IFM_SUBTYPE_SHARED_DESCRIPTIONS]:
+	Likewise.
+	(option_descr): Likewise.
+	(status_descr) [IFM_STATUS_DESCRIPTION]: Likewise.
+	(system_fh_media_query, system_fh_media)
+	(system_fh_status_query, system_fh_status): New functions.
+	* ifconfig/system/bsd.h (SYSTEM_FORMAT_HANDLER):
+	Add keys `media?', `media', `status?', and `status'.
+	(system_fh_media_query)
+	(system_fh_media, system_fh_status_quey, system_fh_status):
+	New declarations.
+
 2013-09-18  Alfred M. Szmidt  <ams@gnu.org>
 
 	* cfg.mk (local-checks-to-skip): Added the
diff --git a/ifconfig/options.c b/ifconfig/options.c
index 25d89db..90c46de 100644
--- a/ifconfig/options.c
+++ b/ifconfig/options.c
@@ -89,6 +89,8 @@ struct format formats[] = {
    "${metric?}{  metric ${tab}{16}${metric}${\\n}}"
    "${exists?}{hwtype?}{${hwtype?}{  link encap ${tab}{16}${hwtype}${\\n}}}"
    "${exists?}{hwaddr?}{${hwaddr?}{  hardware addr ${tab}{16}${hwaddr}${\\n}}}"
+   "${media?}{  link medium ${tab}{16}${media}${\\n}}"
+   "${status?}{  link status ${tab}{16}${status}${\\n}}"
    "${exists?}{txqlen?}{${txqlen?}{  tx queue len ${tab}{16}${txqlen}${\\n}}}"
    "}"
   },
@@ -106,6 +108,9 @@ struct format formats[] = {
    "${tab}{10}${flags}"
    "${mtu?}{  MTU:${mtu}}"
    "${metric?}{  Metric:${metric}}"
+   "${media?}{"
+   "${newline}${tab}{10}Media: ${media}"
+   "${status?}{, ${status}}}"
    "${exists?}{ifstat?}{"
    "${ifstat?}{"
    "${newline}          RX packets:${rxpackets}"
@@ -164,6 +169,8 @@ struct format formats[] = {
    " netmask ${netmask}{0}{%#02x}${netmask}{1}{%02x}"
    "${netmask}{2}{%02x}${netmask}{3}{%02x}"
    "${brdaddr?}{ broadcast ${brdaddr}}${\\n}}"
+   "${media?}{${\\t}media: ${media}${\\n}}"
+   "${status?}{${\\t}status: ${status}${\\n}}"
    "}"
   },
   /* Resembles the output of ifconfig shipped with OSF 4.0g.  */
diff --git a/ifconfig/printif.c b/ifconfig/printif.c
index 4883539..c2efdbc 100644
--- a/ifconfig/printif.c
+++ b/ifconfig/printif.c
@@ -96,6 +96,10 @@ struct format_handle format_handles[] = {
   {"mtu", fh_mtu},
   {"metric?", fh_metric_query},
   {"metric", fh_metric},
+  {"media?", fh_media_query},
+  {"media", fh_media},
+  {"status?", fh_status_query},
+  {"status", fh_status},
 #ifdef HAVE_STRUCT_IFREQ_IFR_MAP
   {"map?", fh_map_query},
   {"irq?", fh_irq_query},
@@ -108,7 +112,7 @@ struct format_handle format_handles[] = {
   {"memend", fh_memend},
   {"dma?", fh_dma_query},
   {"dma", fh_dma},
-#endif
+#endif /* HAVE_STRUCT_IFREQ_IFR_MAP */
   {NULL, NULL}
 };
 
@@ -870,6 +874,40 @@ fh_flags (format_data_t form, int argc, char *argv[])
 #endif
 }
 
+void
+fh_media_query (format_data_t form, int argc, char *argv[])
+{
+  /* Must be overridden by a system dependent implementation.  */
+
+  /* Claim it to be absent.  */
+  select_arg (form, argc, argv, 1);
+}
+
+void
+fh_media (format_data_t form, int argc _GL_UNUSED_PARAMETER,
+	  char *argv[] _GL_UNUSED_PARAMETER)
+{
+  /* Must be overridden by a system dependent implementation.  */
+  put_string (form, "(not known)");
+}
+
+void
+fh_status_query (format_data_t form, int argc, char *argv[])
+{
+  /* Must be overridden by a system dependent implementation.  */
+
+  /* Claim it to be absent.  */
+  select_arg (form, argc, argv, 1);
+}
+
+void
+fh_status (format_data_t form, int argc _GL_UNUSED_PARAMETER,
+	   char *argv[] _GL_UNUSED_PARAMETER)
+{
+  /* Must be overridden by a system dependent implementation.  */
+  put_string (form, "(not known)");
+}
+
 #ifdef HAVE_STRUCT_IFREQ_IFR_MAP
 
 void
@@ -969,7 +1007,8 @@ fh_dma (format_data_t form, int argc, char *argv[])
   else
     put_string (form, "(not available)");
 }
-#endif
+
+#endif /* HAVE_STRUCT_IFREQ_IFR_MAP */
 
 void
 print_interfaceX (format_data_t form, int quiet)
diff --git a/ifconfig/printif.h b/ifconfig/printif.h
index e378349..9f945db 100644
--- a/ifconfig/printif.h
+++ b/ifconfig/printif.h
@@ -120,6 +120,10 @@ void fh_memend_query (format_data_t form, int argc, char *argv[]);
 void fh_memend (format_data_t form, int argc, char *argv[]);
 void fh_dma_query (format_data_t form, int argc, char *argv[]);
 void fh_dma (format_data_t form, int argc, char *argv[]);
+void fh_media_query (format_data_t form, int argc, char *argv[]);
+void fh_media (format_data_t form, int argc, char *argv[]);
+void fh_status_query (format_data_t form, int argc, char *argv[]);
+void fh_status (format_data_t form, int argc, char *argv[]);
 
 /* Used for recursion by format handlers.  */
 void print_interfaceX (format_data_t form, int quiet);
diff --git a/ifconfig/system/bsd.c b/ifconfig/system/bsd.c
index 601be88..321efee 100644
--- a/ifconfig/system/bsd.c
+++ b/ifconfig/system/bsd.c
@@ -26,6 +26,7 @@
 #include <net/if.h>
 #include <net/if_types.h>
 #include <net/if_dl.h>
+#include <net/if_media.h>
 #ifdef HAVE_NETINET_ETHER_H
 # include <netinet/ether.h>
 #endif
@@ -157,6 +158,10 @@ system_configure (int sfd _GL_UNUSED_PARAMETER,
 /* System hooks. */
 static struct ifaddrs *ifp = NULL;
 
+#ifdef SIOCGIFMEDIA
+struct ifmediareq ifm;
+#endif /* SIOCGIFMEDIA */
+
 #define ESTABLISH_IFADDRS \
   if (!ifp) \
     getifaddrs (&ifp);
@@ -264,3 +269,182 @@ system_fh_hwtype (format_data_t form, int argc _GL_UNUSED_PARAMETER,
 	put_string (form, "(unknown hwtype)");
     }
 }
+
+/* Lookup structures provided by the system, each decoding
+ * to clear text the meaning of media and status flags.
+ *
+ * The naming is different in NetBSD and in FreeBSD.
+ */
+static const struct ifmedia_description media_descr[] =
+			IFM_TYPE_DESCRIPTIONS;
+
+#ifdef IFM_SUBTYPE_DESCRIPTIONS
+static const struct ifmedia_description subtype_descr[] =
+			IFM_SUBTYPE_DESCRIPTIONS;
+#endif
+
+#ifdef IFM_SUBTYPE_ETHERNET_DESCRIPTIONS
+static const struct ifmedia_description ethernet_descr[] =
+			IFM_SUBTYPE_ETHERNET_DESCRIPTIONS;
+#endif
+
+#ifdef IFM_SUBTYPE_SHARED_DESCRIPTIONS
+static const struct ifmedia_description subtype_shared_descr[] =
+			IFM_SUBTYPE_SHARED_DESCRIPTIONS;
+#endif
+
+static const struct ifmedia_description option_descr[] =
+#ifdef IFM_OPTION_DESCRIPTIONS
+			IFM_OPTION_DESCRIPTIONS;
+#elif defined IFM_SHARED_OPTION_DESCRIPTIONS
+			IFM_SHARED_OPTION_DESCRIPTIONS;
+#else
+			{ { 0, NULL }, };
+#endif
+
+
+#ifdef IFM_STATUS_DESCRIPTIONS
+static const struct ifmedia_status_description status_descr[] =
+			IFM_STATUS_DESCRIPTIONS;
+#endif
+
+void
+system_fh_media_query (format_data_t form, int argc, char *argv[])
+{
+#ifdef SIOCGIFMEDIA
+  memset (&ifm, 0, sizeof (ifm));
+  strncpy (ifm.ifm_name, form->ifr->ifr_name, sizeof (ifm.ifm_name));
+
+  if (ioctl (form->sfd, SIOCGIFMEDIA, &ifm) >= 0)
+    select_arg (form, argc, argv, 0);
+  else
+#endif /* SIOCGIFMEDIA */
+    select_arg (form, argc, argv, 1);
+}
+
+void
+system_fh_media (format_data_t form, int argc _GL_UNUSED_PARAMETER,
+		 char *argv[] _GL_UNUSED_PARAMETER)
+{
+#ifdef SIOCGIFMEDIA
+  memset (&ifm, 0, sizeof (ifm));
+  strncpy (ifm.ifm_name, form->ifr->ifr_name, sizeof (ifm.ifm_name));
+  if (ioctl (form->sfd, SIOCGIFMEDIA, &ifm) >= 0)
+    {
+      const char *medium = NULL, *options = NULL;
+      const char *subtype = NULL, *active_subtype = NULL;
+      const struct ifmedia_description *item;
+
+      /* Determine media type of adapter.  */
+      for (item = media_descr; item->ifmt_word; item++)
+	if (item->ifmt_word == IFM_TYPE (ifm.ifm_current))
+	  {
+	    medium = item->ifmt_string;
+	    break;
+	  }
+
+#ifdef IFM_SUBTYPE_DESCRIPTIONS
+      for (item = subtype_descr; item->ifmt_word || item->ifmt_string; item++)
+	{
+	  if (item->ifmt_word == IFM_SUBTYPE (ifm.ifm_current) && !subtype)
+	    subtype = item->ifmt_string;
+
+	  if (item->ifmt_word == (ifm.ifm_active & (IFM_NMASK | IFM_TMASK))
+	      && !active_subtype)
+	    active_subtype = item->ifmt_string;
+	}
+#else /* !IFM_SUBTYPE_DESCRIPTIONS */
+      /* Systems like FreeBSD with sub-types split
+       * into shared and media specific structures.
+       *
+       * Sub-type specific media labels.
+       */
+      switch (IFM_TYPE (ifm.ifm_current))
+	{
+	case IFM_ETHER:
+	  for (item = ethernet_descr; item->ifmt_word; item++)
+	    {
+	      /* Configured sub-type.  */
+	      if (item->ifmt_word == IFM_SUBTYPE (ifm.ifm_current))
+		subtype = item->ifmt_string;
+
+	      /* Active subtype.  */
+	      if (item->ifmt_word == IFM_SUBTYPE (ifm.ifm_active))
+		active_subtype = item->ifmt_string;
+	    }
+	  ;;
+	default:
+	  ;;
+	}
+
+      /* Shared media sub-types.  Only works if the previous
+       * loops did not assign any string value.
+       *
+       * One valid instance of 'ifmt_word' is naught,
+       * so loop condition needs care.
+       */
+      for (item = subtype_shared_descr; item->ifmt_word || item->ifmt_string; item++)
+	{
+	  if (item->ifmt_word == IFM_SUBTYPE (ifm.ifm_current))
+	    subtype = item->ifmt_string;
+
+	  if (item->ifmt_word == IFM_SUBTYPE (ifm.ifm_active))
+	    active_subtype = item->ifmt_string;
+	}
+#endif /* !IFM_SUBTYPE_DESCRIPTIONS */
+
+      /* Negotiated mode of operation.  */
+      for (item = option_descr; item->ifmt_word; item++)
+	if (item->ifmt_word == (ifm.ifm_active & IFM_GMASK) && !options)
+	  options = item->ifmt_string;
+
+      /* Print the gathered information.  */
+      if (options)
+        printf ("%s %s (%s <%s>)", medium, subtype, active_subtype, options);
+      else
+        printf ("%s %s (%s)", medium, subtype,
+		active_subtype ? active_subtype : "none");
+
+      had_output++;
+    }
+  else
+#endif /* SIOCGIFMEDIA */
+    put_string (form, "(not known)");
+}
+
+void
+system_fh_status_query (format_data_t form, int argc, char *argv[])
+{
+  system_fh_media_query (form, argc, argv);
+}
+
+void
+system_fh_status (format_data_t form, int argc, char *argv[])
+{
+#ifdef SIOCGIFMEDIA
+  memset (&ifm, 0, sizeof (ifm));
+  strncpy (ifm.ifm_name, form->ifr->ifr_name, sizeof (ifm.ifm_name));
+  if (ioctl (form->sfd, SIOCGIFMEDIA, &ifm) >= 0)
+    {
+#ifdef IFM_STATUS_DESCRIPTIONS
+      const struct ifmedia_status_description *item;
+
+      for (item = status_descr; item->ifms_type; item++)
+	if (item->ifms_type == IFM_TYPE (ifm.ifm_current))
+	  break;
+
+      if (item->ifms_type)
+	put_string (form, IFM_STATUS_DESC (item, ifm.ifm_status));
+      else
+	put_int (form, argc, argv, ifm.ifm_status);
+#else /* !IFM_STATUS_DESCRIPTIONS */
+      if (ifm.ifm_status & IFM_ACTIVE)
+	put_string (form, "active");
+      else
+	put_string (form, "no carrier");
+#endif /* IFM_STATUS_DESCRIPTIONS */
+    }
+  else
+#endif /* SIOCGIFMEDIA */
+    put_string (form, "(not known)");
+}
diff --git a/ifconfig/system/bsd.h b/ifconfig/system/bsd.h
index 8143c34..7bf4853 100644
--- a/ifconfig/system/bsd.h
+++ b/ifconfig/system/bsd.h
@@ -63,11 +63,19 @@ struct system_ifconfig
   {"hwaddr?", system_fh_hwaddr_query}, \
   {"hwaddr", system_fh_hwaddr}, \
   {"hwtype?", system_fh_hwtype_query}, \
-  {"hwtype", system_fh_hwtype},
+  {"hwtype", system_fh_hwtype},	\
+  {"media?", system_fh_media_query}, \
+  {"media", system_fh_media},	\
+  {"status?", system_fh_status_query}, \
+  {"status", system_fh_status},
 
 void system_fh_hwaddr_query (format_data_t form, int argc, char *argv[]);
 void system_fh_hwaddr (format_data_t form, int argc, char *argv[]);
 void system_fh_hwtype_query (format_data_t form, int argc, char *argv[]);
 void system_fh_hwtype (format_data_t form, int argc, char *argv[]);
+void system_fh_media_query (format_data_t form, int argc, char *argv[]);
+void system_fh_media (format_data_t form, int argc, char *argv[]);
+void system_fh_status_query (format_data_t form, int argc, char *argv[]);
+void system_fh_status (format_data_t form, int argc, char *argv[]);
 
 #endif /* IFCONFIG_SYSTEM_BSD_H */

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

Summary of changes:
 ChangeLog             |   31 ++++++++
 ifconfig/options.c    |    7 ++
 ifconfig/printif.c    |   43 +++++++++++-
 ifconfig/printif.h    |    4 +
 ifconfig/system/bsd.c |  184 +++++++++++++++++++++++++++++++++++++++++++++++++
 ifconfig/system/bsd.h |   10 +++-
 6 files changed, 276 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Sep 25 18:36:24 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VOxh2-00080S-8w
	for mharc-commit-inetutils@gnu.org; Wed, 25 Sep 2013 18:36:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57720)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VOxh0-00080M-MF
	for commit-inetutils@gnu.org; Wed, 25 Sep 2013 18:36:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VOxgz-0008Ci-NQ
	for commit-inetutils@gnu.org; Wed, 25 Sep 2013 18:36:22 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:54178)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VOxgz-0008Cb-Ie
	for commit-inetutils@gnu.org; Wed, 25 Sep 2013 18:36:21 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VOxgy-0005bJ-JN
	for commit-inetutils@gnu.org; Wed, 25 Sep 2013 22:36:21 +0000
Date: Wed, 25 Sep 2013 22:36:20 +0000
Message-Id: <E1VOxgy-0005bJ-JN@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1_100-2-g5f59063
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 3dc3bb447e058b7903b242ce231a27736c569066
X-Git-Newrev: 5f59063e2b5a9864250ab7473e5ba81ea4be817c
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Sep 2013 22:36:23 -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  5f59063e2b5a9864250ab7473e5ba81ea4be817c (commit)
      from  3dc3bb447e058b7903b242ce231a27736c569066 (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=5f59063e2b5a9864250ab7473e5ba81ea4be817c


commit 5f59063e2b5a9864250ab7473e5ba81ea4be817c
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Mon Sep 23 23:32:31 2013 +0200

    ftpd: Setting of idle time.
    
    The command to change idle time was broken.

diff --git a/ChangeLog b/ChangeLog
index 4f2b026..b40daf9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-09-23  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftpd: Setting of idle time.
+	The command to change idle time was broken.
+
+	* ftpd/ftpcmd.y (cmd) <SITE IDLE NUMBER>: The token IDLE
+	must go before `check_login' to avoid a lookahead syntax
+	error.  Adjust the parameter reference for `check_login'.
+
 2013-09-19  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ifconfig: Status and medium reports on BSD.
diff --git a/ftpd/ftpcmd.y b/ftpd/ftpcmd.y
index 5e126f5..451ce4d 100644
--- a/ftpd/ftpcmd.y
+++ b/ftpd/ftpcmd.y
@@ -497,9 +497,9 @@ cmd
 			       "Current IDLE time limit is %d seconds; max %d",
 			       timeout, maxtimeout);
 		}
-	| SITE SP check_login IDLE SP NUMBER CRLF
+	| SITE SP IDLE check_login SP NUMBER CRLF
 		{
-			if ($3)
+			if ($4)
 			  {
 			    if ($6 < 30 || $6 > maxtimeout)
 			      reply (501,

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

Summary of changes:
 ChangeLog     |    9 +++++++++
 ftpd/ftpcmd.y |    4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Sep 25 20:12:03 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VOzBb-0005zL-5p
	for mharc-commit-inetutils@gnu.org; Wed, 25 Sep 2013 20:12:03 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44302)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VOzBW-0005yj-Cz
	for commit-inetutils@gnu.org; Wed, 25 Sep 2013 20:12:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VOzBU-00016A-N5
	for commit-inetutils@gnu.org; Wed, 25 Sep 2013 20:11:58 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:34743)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VOzBU-000165-JB
	for commit-inetutils@gnu.org; Wed, 25 Sep 2013 20:11:56 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VOzBT-0002zp-Po
	for commit-inetutils@gnu.org; Thu, 26 Sep 2013 00:11:55 +0000
Date: Thu, 26 Sep 2013 00:11:55 +0000
Message-Id: <E1VOzBT-0002zp-Po@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1_100-3-g58da4a7
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 5f59063e2b5a9864250ab7473e5ba81ea4be817c
X-Git-Newrev: 58da4a716879b8ad602db4911d1d61312f108657
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Sep 2013 00:12:01 -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  58da4a716879b8ad602db4911d1d61312f108657 (commit)
      from  5f59063e2b5a9864250ab7473e5ba81ea4be817c (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=58da4a716879b8ad602db4911d1d61312f108657


commit 58da4a716879b8ad602db4911d1d61312f108657
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Sep 26 01:18:01 2013 +0200

    ftp: Abort transfer in ascii mode.

diff --git a/ChangeLog b/ChangeLog
index b40daf9..0d58f30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2013-09-26  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftp: Abort transfer in ascii mode.
+	If the local ascii file causes a seek failure,
+	then tell the server to abort transmission.
+
+	* ftp/ftp.c (sendrequest) <restart_point && (STOR || APPE)>:
+	Change RC to off_t.  On seek failure, send ABOR command,
+	and get the reply.
+	(recvrequest) <TYPE_A && restart_point>: Reset `errno'.
+	<label done>: Send ABOR command, get reply.  Produce correct
+	error message if stepping through the local file gave EOF.
+
+
+	ftpd: Error message after seek failure.
+	The standard RFC 1123 introduced a better error code 554
+	to be used when a restart command is not successful.
+
+	* ftpd/ftpd.c (retrieve) <restart_point && TYPE_A>: Reply
+	with error code 554 if EOF was reach while seeking in file.
+	<restart_point && !TYPE_I>: Likewise when lseek() gave EINVAL.
+	(store) <restart_point>: Likewise for both modes.
+
 2013-09-23  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftpd: Setting of idle time.
diff --git a/ftp/ftp.c b/ftp/ftp.c
index 6fd0e19..d834c2c 100644
--- a/ftp/ftp.c
+++ b/ftp/ftp.c
@@ -676,7 +676,7 @@ sendrequest (char *cmd, char *local, char *remote, int printnames)
   if (restart_point &&
       (strcmp (cmd, "STOR") == 0 || strcmp (cmd, "APPE") == 0))
     {
-      int rc;
+      off_t rc;
 
       switch (curtype)
 	{
@@ -690,6 +690,8 @@ sendrequest (char *cmd, char *local, char *remote, int printnames)
 	}
       if (rc < 0)
 	{
+	  (void) command ("ABOR");
+	  getreply (0);
 	  error (0, errno, "local: %s", local);
 	  restart_point = 0;
 	  if (closefunc != NULL)
@@ -1066,6 +1068,8 @@ recvrequest (char *cmd, char *local, char *remote, char *lmode, int printnames)
 	  off_t i, n;
 	  int ch;
 
+	  errno = 0;
+
 	  if (fseeko (fout, 0L, SEEK_SET) < 0)
 	    goto done;
 	  n = restart_point;
@@ -1079,7 +1083,17 @@ recvrequest (char *cmd, char *local, char *remote, char *lmode, int printnames)
 	  if (fseeko (fout, 0L, SEEK_CUR) < 0)
 	    {
 	    done:
-	      error (0, errno, "local: %s", local);
+	      /* Cancel server's action quickly.  */
+	      (void) command ("ABOR");
+	      getreply (0);
+
+	      /* Explain our failure.  */
+	      if (ch == EOF)
+		printf ("Action not taken: offset %jd is outside of %s.\n",
+		       restart_point, local);
+	      else
+		error (0, errno, "local: %s", local);
+
 	      if (closefunc != NULL)
 		(*closefunc) (fout);
 	      return;
diff --git a/ftpd/ftpd.c b/ftpd/ftpd.c
index 1174dbc..8e35b3e 100644
--- a/ftpd/ftpd.c
+++ b/ftpd/ftpd.c
@@ -982,7 +982,10 @@ retrieve (const char *cmd, const char *name)
 	      c = getc (fin);
 	      if (c == EOF)
 		{
-		  perror_reply (550, name);
+		  /* Error code 554 was introduced in RFC 1123.  */
+		  reply (554,
+			 "Action not taken: invalid REST value %jd for %s.",
+			 restart_point, name);
 		  goto done;
 		}
 	      if (c == '\n')
@@ -991,7 +994,11 @@ retrieve (const char *cmd, const char *name)
 	}
       else if (lseek (fileno (fin), restart_point, SEEK_SET) < 0)
 	{
-	  perror_reply (550, name);
+	  if (errno == EINVAL)
+	    reply (554, "Action not taken: invalid REST value %jd for %s.",
+		   restart_point, name);
+	  else
+	    perror_reply (550, name);
 	  goto done;
 	}
     }
@@ -1053,7 +1060,10 @@ store (const char *name, const char *mode, int unique)
 	      c = getc (fout);
 	      if (c == EOF)
 		{
-		  perror_reply (550, name);
+		  /* Error code 554 was introduced in RFC 1123.  */
+		  reply (554,
+			 "Action not taken: invalid REST value %jd for %s.",
+			 restart_point, name);
 		  goto done;
 		}
 	      if (c == '\n')
@@ -1070,7 +1080,11 @@ store (const char *name, const char *mode, int unique)
 	}
       else if (lseek (fileno (fout), restart_point, SEEK_SET) < 0)
 	{
-	  perror_reply (550, name);
+	  if (errno == EINVAL)
+	    reply (554, "Action not taken: invalid REST value %jd for %s.",
+		   restart_point, name);
+	  else
+	    perror_reply (550, name);
 	  goto done;
 	}
     }

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

Summary of changes:
 ChangeLog   |   23 +++++++++++++++++++++++
 ftp/ftp.c   |   18 ++++++++++++++++--
 ftpd/ftpd.c |   22 ++++++++++++++++++----
 3 files changed, 57 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Sep 26 15:35:30 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1VPHLW-0002zA-2c
	for mharc-commit-inetutils@gnu.org; Thu, 26 Sep 2013 15:35:30 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38479)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VPHLP-0002sJ-VS
	for commit-inetutils@gnu.org; Thu, 26 Sep 2013 15:35:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VPHLJ-0007yt-5U
	for commit-inetutils@gnu.org; Thu, 26 Sep 2013 15:35:23 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:59797)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1VPHLJ-0007yp-1E
	for commit-inetutils@gnu.org; Thu, 26 Sep 2013 15:35:17 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1VPHLI-00060f-GX
	for commit-inetutils@gnu.org; Thu, 26 Sep 2013 19:35:16 +0000
Date: Thu, 26 Sep 2013 19:35:16 +0000
Message-Id: <E1VPHLI-00060f-GX@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1_100-4-g88488eb
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 58da4a716879b8ad602db4911d1d61312f108657
X-Git-Newrev: 88488ebc5adbce76551d85945c3033553db666c7
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Sep 2013 19:35:29 -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  88488ebc5adbce76551d85945c3033553db666c7 (commit)
      from  58da4a716879b8ad602db4911d1d61312f108657 (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=88488ebc5adbce76551d85945c3033553db666c7


commit 88488ebc5adbce76551d85945c3033553db666c7
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Sep 26 20:56:32 2013 +0200

    ftpd: Implement FEAT and OPTS.
    
    Satisfy RFC 2389 for improved standard.

diff --git a/ChangeLog b/ChangeLog
index 0d58f30..0d1aa41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2013-09-26  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	ftpd: Implement FEAT and OPTS.
+	Add two commands in accordance with RFC 2389.
+
+	* ftpd/ftpcmd.y (cmdtab, sitetab): Change to static.
+	(extlist): New variable, listing command extensions.
+	(FEAT, OPTS): New tokens.
+	(cmd) <FEAT || FEAT STRING || OPTS || OPTS STRING>:
+	New cases.
+	(cmdtab): Put commands in the order of RFC 959.
+	Add FEAT and OPTS.
+	(sitetab): Use lexicographic order.
+
+2013-09-26  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	ftp: Abort transfer in ascii mode.
 	If the local ascii file causes a seek failure,
 	then tell the server to abort transmission.
diff --git a/ftpd/ftpcmd.y b/ftpd/ftpcmd.y
index 451ce4d..b2f4081 100644
--- a/ftpd/ftpcmd.y
+++ b/ftpd/ftpcmd.y
@@ -50,13 +50,11 @@
 /*
  * Grammar for FTP commands:
  *
- *   See RFC 959, RFC 1639, RFC 2428,
+ *   See RFC 959, RFC 1639, RFC 2389, RFC 2428,
  *   and RFC 3659 (MDTM, REST, SIZE).
  *
  * TODO: Update with RFC 3659 (MLST, MLSD).
  *
- * TODO: RFC 2389 (FEAT, OPTS).
- *
  * TODO: RFC 2428 (EPSV ALL).
  *
  * FIXME: Rewrite with GNU standard formatting.  Legacy code is changed!
@@ -121,8 +119,9 @@ struct tab
   const char	*help;
 };
 
-extern struct tab cmdtab[];
-extern struct tab sitetab[];
+static struct tab cmdtab[];
+static struct tab sitetab[];
+static char *extlist[];
 static char *copy         (char *);
 static void help          (struct tab *, char *);
 static struct tab *lookup (struct tab *, char *);
@@ -151,6 +150,8 @@ static void yyerror       (const char *s);
 	STAT	HELP	NOOP	MKD	RMD	PWD
 	CDUP	STOU	SMNT	SYST	SIZE	MDTM
 
+	FEAT	OPTS
+
 	EPRT	EPSV	LPRT	LPSV
 
 	UMASK	IDLE	CHMOD
@@ -441,6 +442,46 @@ cmd
 			if ($2)
 			  cwd ("..");
 		}
+	| FEAT check_login CRLF
+		{
+			if ($2)
+			  {
+			    char **name;
+
+			    lreply (211, "Supported extensions:");
+			    for (name = extlist; *name; name++)
+			      printf (" %s\r\n", *name);
+			    reply (211, "End");
+			  }
+		}
+	/* Catch all variants of the above FEAT, and reject them.  */
+	| FEAT check_login SP STRING CRLF
+		{
+			if ($2)
+			  {
+			    reply (501, "Not accepting arguments.");
+			    free ($4);
+			  }
+		}
+	/* Changable behaviour is yet to be implemented,
+	 * so OPTS is a no-op for the time being.  It is
+	 * mandatory by RFC 2389, since FEAT now exists.
+	 */
+	| OPTS check_login CRLF
+		{
+			if ($2)
+			  {
+			    reply (501, "Must have an argument.");
+			  }
+		}
+	| OPTS check_login SP STRING CRLF
+		{
+			if ($2)
+			  {
+			    reply (501, "No options are available.");
+			    free ($4);
+			  }
+		}
 	| SITE SP HELP CRLF
 		{
 			help (sitetab, (char *) 0);
@@ -1267,36 +1308,37 @@ check_login
 #define	NSTR	8	/* Number followed by a string */
 #define	DLIST	9	/* SP and delimited list for EPRT/EPSV */
 
-struct tab cmdtab[] = {		/* In order defined in RFC 765 */
+static struct tab cmdtab[] = {
+  /* In the order defined by RFC 959.  See also RFC 1123.  */
+  /* Access control commands.  */
   { "USER", USER, STR1, 1,	"<sp> username" },
   { "PASS", PASS, ZSTR1, 1,	"<sp> password" },
   { "ACCT", ACCT, STR1, 0,	"(specify account)" },
+  { "CWD",  CWD,  OSTR, 1,	"[ <sp> directory-name ]" },
+  { "CDUP", CDUP, ARGS, 1,	"(change to parent directory)" },
   { "SMNT", SMNT, ARGS, 0,	"(structure mount)" },
   { "REIN", REIN, ARGS, 0,	"(reinitialize server state)" },
   { "QUIT", QUIT, ARGS, 1,	"(terminate service)", },
+  /* Transfer parameter commands.  */
   { "PORT", PORT, ARGS, 1,	"<sp> b0, b1, b2, b3, b4" },
   { "PASV", PASV, ARGS, 1,	"(set server in passive mode)" },
   { "TYPE", TYPE, ARGS, 1,	"<sp> [ A | E | I | L ]" },
   { "STRU", STRU, ARGS, 1,	"(specify file structure)" },
   { "MODE", MODE, ARGS, 1,	"(specify transfer mode)" },
+  /* FTP service commands.  */
   { "RETR", RETR, STR1, 1,	"<sp> file-name" },
   { "STOR", STOR, STR1, 1,	"<sp> file-name" },
+  { "STOU", STOU, STR1, 1,	"<sp> file-name" },
   { "APPE", APPE, STR1, 1,	"<sp> file-name" },
-  { "MLFL", MLFL, OSTR, 0,	"(mail file)" },
-  { "MAIL", MAIL, OSTR, 0,	"(mail to user)" },
-  { "MSND", MSND, OSTR, 0,	"(mail send to terminal)" },
-  { "MSOM", MSOM, OSTR, 0,	"(mail send to terminal or mailbox)" },
-  { "MSAM", MSAM, OSTR, 0,	"(mail send to terminal and mailbox)" },
-  { "MRSQ", MRSQ, OSTR, 0,	"(mail recipient scheme question)" },
-  { "MRCP", MRCP, STR1, 0,	"(mail recipient)" },
   { "ALLO", ALLO, ARGS, 1,	"allocate storage (vacuously)" },
   { "REST", REST, ARGS, 1,	"<sp> offset (restart command)" },
   { "RNFR", RNFR, STR1, 1,	"<sp> file-name" },
   { "RNTO", RNTO, STR1, 1,	"<sp> file-name" },
   { "ABOR", ABOR, ARGS, 1,	"(abort operation)" },
   { "DELE", DELE, STR1, 1,	"<sp> file-name" },
-  { "CWD",  CWD,  OSTR, 1,	"[ <sp> directory-name ]" },
-  { "XCWD", CWD,	OSTR, 1,	"[ <sp> directory-name ]" },
+  { "RMD",  RMD,  STR1, 1,	"<sp> path-name" },
+  { "MKD",  MKD,  STR1, 1,	"<sp> path-name" },
+  { "PWD",  PWD,  ARGS, 1,	"(return current directory)" },
   { "LIST", LIST, OSTR, 1,	"[ <sp> path-name ]" },
   { "NLST", NLST, OSTR, 1,	"[ <sp> path-name ]" },
   { "SITE", SITE, SITECMD, 1,	"site-cmd [ <sp> arguments ]" },
@@ -1304,32 +1346,50 @@ struct tab cmdtab[] = {		/* In order defined in RFC 765 */
   { "STAT", STAT, OSTR, 1,	"[ <sp> path-name ]" },
   { "HELP", HELP, OSTR, 1,	"[ <sp> <string> ]" },
   { "NOOP", NOOP, ARGS, 1,	"" },
-  { "MKD",  MKD,  STR1, 1,	"<sp> path-name" },
+  /* Experimental commands, as mentioned in RFC 1123.  Now obsolete.  */
   { "XMKD", MKD,  STR1, 1,	"<sp> path-name" },
-  { "RMD",  RMD,  STR1, 1,	"<sp> path-name" },
   { "XRMD", RMD,  STR1, 1,	"<sp> path-name" },
-  { "PWD",  PWD,  ARGS, 1,	"(return current directory)" },
   { "XPWD", PWD,  ARGS, 1,	"(return current directory)" },
-  { "CDUP", CDUP, ARGS, 1,	"(change to parent directory)" },
   { "XCUP", CDUP, ARGS, 1,	"(change to parent directory)" },
-  { "STOU", STOU, STR1, 1,	"<sp> file-name" },
+  { "XCWD", CWD,  OSTR, 1,	"[ <sp> directory-name ]" },
+  /* Commands in RFC 2389.  */
+  { "FEAT", FEAT, OSTR, 1,	"(display command extensions)" },
+  /* XXX: Replace OSTR once some functionality exists.  */
+  { "OPTS", OPTS, OSTR, 1,	"<sp> cmd-name [ <sp> options ]" },
+  /* Commands in RFC 3659.  */
   { "SIZE", SIZE, OSTR, 1,	"<sp> path-name" },
   { "MDTM", MDTM, OSTR, 1,	"<sp> path-name" },
+  /* Unimplemented, but reserved in RFC ???.  */
+  { "MLFL", MLFL, OSTR, 0,	"(mail file)" },
+  { "MAIL", MAIL, OSTR, 0,	"(mail to user)" },
+  { "MSND", MSND, OSTR, 0,	"(mail send to terminal)" },
+  { "MSOM", MSOM, OSTR, 0,	"(mail send to terminal or mailbox)" },
+  { "MSAM", MSAM, OSTR, 0,	"(mail send to terminal and mailbox)" },
+  { "MRSQ", MRSQ, OSTR, 0,	"(mail recipient scheme question)" },
+  { "MRCP", MRCP, STR1, 0,	"(mail recipient)" },
+  /* Extended addressing in RFC 2428.  */
   { "EPRT", EPRT, DLIST, 1,	"<sp> <d> proto <d> addr <d> port <d>" },
   { "EPSV", EPSV, ARGS, 1,	"[ <sp> af ]" },
+  /* Long addressing in RFC 1639.  Obsoleted in RFC 5797.  */
   { "LPRT", LPRT, ARGS, 1,	"<sp> af,hal,h0..hn,2,p0,p1" },
   { "LPSV", LPSV, ARGS, 1,	"(set server in long passive mode)" },
   { NULL,   0,    0,    0,	0 }
 };
 
-struct tab sitetab[] = {
-  { "UMASK", UMASK, ARGS, 1,	"[ <sp> umask ]" },
-  { "IDLE", IDLE, ARGS, 1,	"[ <sp> maximum-idle-time ]" },
+static struct tab sitetab[] = {
   { "CHMOD", CHMOD, NSTR, 1,	"<sp> mode <sp> file-name" },
   { "HELP", HELP, OSTR, 1,	"[ <sp> <string> ]" },
+  { "IDLE", IDLE, ARGS, 1,	"[ <sp> maximum-idle-time ]" },
+  { "UMASK", UMASK, ARGS, 1,	"[ <sp> umask ]" },
   { NULL,   0,    0,    0,	0 }
 };
 
+/* Extensions beyond RFC 959 and RFC 2389.  Ordered as implemented.  */
+static char *extlist[] = {
+  "MDTM", "SIZE", "REST STREAM",
+  "EPRT", "EPSV", "LPRT", "LPSV",
+  NULL };
+
 static struct tab *
 lookup (struct tab *p, char *cmd)
 {

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

Summary of changes:
 ChangeLog     |   14 +++++++
 ftpd/ftpcmd.y |  106 ++++++++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 97 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


