From MAILER-DAEMON Thu Jan 03 08:17:17 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Tqkfd-0004Og-GJ
	for mharc-commit-inetutils@gnu.org; Thu, 03 Jan 2013 08:17:17 -0500
Received: from eggs.gnu.org ([208.118.235.92]:33825)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TqkfZ-0004O7-BO
	for commit-inetutils@gnu.org; Thu, 03 Jan 2013 08:17:16 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TqkfW-0004Yb-Lr
	for commit-inetutils@gnu.org; Thu, 03 Jan 2013 08:17:13 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:32851)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TqkfW-0004YW-Hj
	for commit-inetutils@gnu.org; Thu, 03 Jan 2013 08:17:10 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TqkfV-0005wQ-Gg
	for commit-inetutils@gnu.org; Thu, 03 Jan 2013 13:17:10 +0000
Date: Thu, 03 Jan 2013 13:17:09 +0000
Message-Id: <E1TqkfV-0005wQ-Gg@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-230-g7d48334
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: fb9dcf487b3cac5bf6d32923241193bb967a9cb4
X-Git-Newrev: 7d4833481e9e9fc5998c66fadd666e727b169323
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, 03 Jan 2013 13:17: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  7d4833481e9e9fc5998c66fadd666e727b169323 (commit)
      from  fb9dcf487b3cac5bf6d32923241193bb967a9cb4 (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=7d4833481e9e9fc5998c66fadd666e727b169323


commit 7d4833481e9e9fc5998c66fadd666e727b169323
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Jan 2 19:28:35 2013 +0100

    tftpd: Chrooted mode.

diff --git a/ChangeLog b/ChangeLog
index 9131746..3b56f74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2013-01-02  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	tftpd: Chrooted mode.
+
+	* src/tftpd.c: Include <grp.h>, <pwd.h>, <xalloc.h>.
+	(chrootdir, group, user): New variables.
+	(DEFAULT_GROUP, DEFAULT_USER): New macros.
+	(options): New options `-g/--group', `-s/--secure-dir',
+	and `-u/--user'.  Put new options in separate group.
+	(parse_opt): Parameter `arg' is now in use.
+	<`g', `s', `u'>: New cases.
+	(main): Assign default values to `group', `user'.
+	If chrooted mode was specified, execute chroot(),
+	setgid(), and setuid().
+	* tests/tftp.sh (do_secure_setting): New variable.
+	Set to true only for the super-user, then activating
+	two further read tests.
+	(REDIRECT): Set also for empty VERBOSE.
+
+	* doc/inetutils.texi <tftpd invocation>: Fill with
+	sensible content for old and new capabilities.
+
 2012-12-27  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	traceroute: Conform to standard application set-up.
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index 663744a..b0375f1 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -3587,22 +3587,157 @@ access is refused.
 @chapter @command{tftpd}: TFTP server
 @cindex tftpd
 
+@command{tftpd} is intended to be invoked via @command{inetd}
+at all times.
+
 @noindent
 Synopsis:
 
 @example
-tftpd [@var{OPTIONS}]@dots{}
+tftpd [@var{options}] [@var{directory} @dots{}]
 @end example
 
 @table @option
+@item -g @var{group}
+@itemx --group=@var{group}
+@opindex -g
+@opindex --group
+Specify group membership of the process owner.
+This is used only along with the option @option{-s}.
+The default choice is @samp{nogroup}.
+
 @item -l
+@itemx --logging
+@opindex -l
+@opindex --logging
 Enable logging.
 
 @item -n
+@itemx --nonexistent
+@opindex -n
+@opindex --nonexistent
 Supress negative acknowledgement of requests for nonexistent relative
 filenames.
+
+@item -s @var{dir}
+@itemx --secure-dir=@var{dir}
+@opindex -s
+@opindex --secure-dir
+Let the serving process change its root directory to @var{dir}
+before attending to any requests.
+This directory is not observable by any client, but improves
+server isolation, since servable contents must be located
+below this chrooted directory @var{dir}.
+
+@item -u @var{user}
+@itemx --user=@var{user}
+@opindex -u
+@opindex --user
+Specify the process owner for serving requests.
+Only relevant along with the option @option{-s}.
+The default name is @samp{nobody}.
 @end table
 
+@section Directory prefixes
+@anchor{tftpd validation}
+
+In addition to options, an invocation of @command{tftpd} can
+specify an optional list of directory prefixes.
+These are approved of according to two principles:
+
+@itemize @bullet
+@item
+Relative pathnames are ignored.
+
+@item
+At most twenty prefixes are approved, the rest is discarded.
+@end itemize
+
+@noindent
+A request for a file is decided upon as a consequence
+of evaluating these criteria:
+
+@itemize @bullet
+@item
+Every file request containing the substring @samp{/../} is denied,
+as is a file name beginning with @samp{../}.
+
+@item
+Write requests must specify absolute locations.
+
+@item
+A file request, if specified as an @emph{absolute} pathname,
+must begin with one of the approved directory prefixes,
+should at least one such prefix have been accepted.
+
+@item
+In the absence of a prefix collection, any absolute pathname is
+accepted, should the corresponding file exist.
+
+@item
+A file request, if specified as a @emph{relative} name,
+will only be searched for below the acceptable prefixes,
+should at least one such prefix have been approved.
+
+@item
+A request for a relatively named file, is denied in the absence
+of approved directory prefixes.
+
+@item
+The resulting file must be world readable, or world writable,
+for a read request, or a write request, to succeed.
+@end itemize
+
+@section Use cases
+@anchor{tftpd setup cases}
+
+The standard use case is an entry in @file{/etc/inetd.conf} like
+
+@example
+tftp dgram tcp4 wait root nobody /usr/sbin/tftpd \
+@verb{        } tftpd /tftpboot /altboot
+@end example
+
+@noindent
+This would allow the TFTP client to use any of
+
+@smallexample
+get kernel
+get /tftpboot/kernel
+get kernel.alt
+get /altboot/kernel.alt
+get /etc/motd
+@end smallexample
+
+@noindent
+given that @file{/tftpboot/kernel} and @file{/altboot/kernel.alt} exist.
+Observe that also @file{/etc/motd} is accessible, inspite there being
+no explicit mention of standard file locations.
+
+A stronger mode of running a TFTP server is to use the `secure mode',
+meaning that the serving process is running in a chrooted mode.
+Then a suitable configuration could be
+
+@example
+tftp dgram tcp4 wait root nobody /usr/sbin/tftpd \
+@verb{        } tftpd --secure-dir=/srv/tftp-root  /tftpboot /altboot
+@end example
+
+@noindent
+Supposing that the files @file{/srv/tftp-root/tftpboot/kernel}
+and @file{/srv/tftp-root/altboot/kernel.alt} were available,
+all the previously suggested client requests for a kernel would
+still be granted, but now any request for @file{/etc/motd}
+would be declined, and would get a reply `File not found' back.
+
+The chrooted setting is denying access outside of
+@file{/srv/tftp-root}, yet is not indicating this lock-in
+to the client, and is thus improving server isolation.
+Since neither of @option{-u} and @option{-g} were specified,
+the configuration reproduced above will in fact have the
+transmitting server process running with the default
+owner set to @samp{nobody:nogroup}.
+
 @node rshd invocation
 @chapter @command{rshd}: Remote shell server
 @cindex rshd
diff --git a/src/tftpd.c b/src/tftpd.c
index 004803d..d648733 100644
--- a/src/tftpd.c
+++ b/src/tftpd.c
@@ -79,10 +79,13 @@
 #include <string.h>
 #include <syslog.h>
 #include <unistd.h>
+#include <grp.h>
+#include <pwd.h>
 
 #include "tftpsubs.h"
 
 #include <unused-parameter.h>
+#include <xalloc.h>
 #include <argp.h>
 #include <progname.h>
 #include <libinetutils.h>
@@ -98,6 +101,17 @@ void usage (void);
 static int peer;
 static int rexmtval = TIMEOUT;
 static int maxtimeout = 5 * TIMEOUT;
+static char *chrootdir = NULL;
+static char *group;
+static char *user;
+
+#ifndef DEFAULT_GROUP
+# define DEFAULT_GROUP	"nogroup"
+#endif
+
+#ifndef DEFAULT_USER
+# define DEFAULT_USER	"nobody"
+#endif
 
 /* Some systems define PKTSIZE in <arpa/tftp.h>.  */
 #ifndef PKTSIZE
@@ -133,16 +147,30 @@ static const char *verifyhost (struct sockaddr_storage *, socklen_t);
 
 
 static struct argp_option options[] = {
+#define GRP 0
   { "logging", 'l', NULL, 0,
-    "enable logging", 1},
+    "enable logging", GRP+1},
   { "nonexistent", 'n', NULL, 0,
     "supress negative acknowledgement of requests for "
-    "nonexistent relative filenames", 1},
+    "nonexistent relative filenames", GRP+1},
+#undef GRP
+#define GRP 10
+  { NULL, 0, NULL, 0, "", GRP},
+  { "group", 'g', "GRP", 0,
+    "set group of process owner, used with '-s' and "
+    "defaults to 'nogroup'", GRP+1},
+  { "secure-dir", 's', "DIR", 0,
+    "change root directory to DIR before searching and "
+    "serving content", GRP+1},
+  { "user", 'u', "USR", 0,
+    "set name of process owner, used with '-s' and "
+    "defaults to 'nobody'", GRP+1},
+#undef GRP
   { NULL, 0, NULL, 0, NULL, 0}
 };
 
 static error_t
-parse_opt (int key, char *arg _GL_UNUSED_PARAMETER,
+parse_opt (int key, char *arg,
 	   struct argp_state *state _GL_UNUSED_PARAMETER)
 {
   switch (key)
@@ -151,10 +179,24 @@ parse_opt (int key, char *arg _GL_UNUSED_PARAMETER,
       logging = 1;
       break;
 
+    case 'g':
+      free (group);
+      group = xstrdup (arg);
+      break;
+
     case 'n':
       suppress_naks = 1;
       break;
 
+    case 's':
+      chrootdir = xstrdup (arg);
+      break;
+
+    case 'u':
+      free (user);
+      user = xstrdup (arg);
+      break;
+
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -180,6 +222,9 @@ main (int argc, char *argv[])
   int on, n;
   struct sockaddr_storage sin;
 
+  group = xstrdup (DEFAULT_GROUP);
+  user = xstrdup (DEFAULT_USER);
+
   set_program_name (argv[0]);
   iu_argp_init ("tftpd", default_program_authors);
   argp_parse (&argp, argc, argv, 0, &index, NULL);
@@ -202,12 +247,52 @@ main (int argc, char *argv[])
 	}
     }
 
+  if (chrootdir && *chrootdir)
+    {
+      struct passwd *pwd = NULL;
+      struct group *grp = NULL;
+
+      /* Ignore user and group setting for non-root invokations.  */
+      if (!getuid())
+	{
+	  pwd = getpwnam (user);
+	  if (!pwd)
+	    {
+	      syslog (LOG_ERR, "getpwnam('%s'): %m", user);
+	      exit (EXIT_FAILURE);
+	    }
+
+	  grp = getgrnam (group);
+	  if (!grp)
+	    {
+	      syslog (LOG_ERR, "getgrnam('%s'): %m", group);
+	      exit (EXIT_FAILURE);
+	    }
+	}
+
+      if (chroot (chrootdir) || chdir ("/"))
+	{
+	  syslog (LOG_ERR, "chroot('%s'): %m", chrootdir);
+	  exit (EXIT_FAILURE);
+	}
+
+      if (pwd && grp)
+	{
+	  if (setgid (grp->gr_gid) || setuid (pwd->pw_uid))
+	    {
+	      syslog (LOG_ERR, "setgid/setuid: %m");
+	      exit (EXIT_FAILURE);
+	    }
+	}
+    }
+
   on = 1;
   if (ioctl (0, FIONBIO, &on) < 0)
     {
-      syslog (LOG_ERR, "ioctl(FIONBIO): %m\n");
+      syslog (LOG_ERR, "ioctl(FIONBIO): %m");
       exit (EXIT_FAILURE);
     }
+
   fromlen = sizeof (from);
   n = recvfrom (0, buf, sizeof (buf), 0, (struct sockaddr *) &from, &fromlen);
   if (n < 0)
diff --git a/tests/tftp.sh b/tests/tftp.sh
index 6efe305..93a041d 100755
--- a/tests/tftp.sh
+++ b/tests/tftp.sh
@@ -30,6 +30,20 @@
 #
 #    OpenBSD uses /etc/services directly, not via /etc/nsswitch.conf.
 
+#
+# Currently implemented tests (10 or 12 in total):
+#
+#  * Read three files in binary mode, from 127.0.0.1 and ::1,
+#    needing one, two, and multiple data packets, respectively.
+#
+#  * Read one moderate size ascii file from 127.0.0.1 and ::1.
+#
+#  * Reload configuration and read a small binary file twice.
+#
+#  * (root only) Reload configuration for chrooted mode.
+#    Read one binary file with a relative name, and one ascii
+#    file with absolute location.
+
 . ./tools.sh
 
 $need_dd || exit_no_dd
@@ -95,6 +109,10 @@ USER=`func_id_user`
 
 # Late supplimentary subtest.
 do_conf_reload=true
+do_secure_setting=true
+
+# Disable chrooted mode for non-root invocation.
+test `func_id_uid` -eq 0 || do_secure_setting=false
 
 # Random base directory at testing time.
 TMPDIR=`$MKTEMP -d $PWD/tmp.XXXXXXXXXX` ||
@@ -195,7 +213,7 @@ write_conf ||
 # would like to suppress the verbose output.  The variable
 # REDIRECT is set to '2>/dev/null' in non-verbose mode.
 #
-test -n "${VERBOSE+yes}" || REDIRECT='2>/dev/null'
+test -n "$VERBOSE" || REDIRECT='2>/dev/null'
 
 eval "$INETD -d -p'$INETD_PID' '$INETD_CONF' $REDIRECT &"
 
@@ -385,6 +403,53 @@ else
     $silence echo >&2 'Informational: Inhibiting config reload test.'
 fi
 
+if $do_secure_setting; then
+    # Allow an underprivileged process owner to read files.
+    chmod g=rx,o=rx $TMPDIR
+
+    cat > "$INETD_CONF" <<-EOF
+	$PORT dgram ${PROTO}4 wait $USER $TFTPD   tftpd -l -s $TMPDIR /tftp-test
+	$PORT dgram ${PROTO}6 wait $USER $TFTPD   tftpd -l -s $TMPDIR /tftp-test
+	EOF
+
+    # Let inetd reload configuration.
+    kill -HUP $inetd_pid
+
+    # Test two files: file-small and asciifile.txt
+    #
+    addr=`echo "$ADDRESSES" | $SED 's/ .*//'`
+    name=`echo "$FILELIST" | $SED 's/ .*//'`
+    rm -f "$name" "$ASCIIFILE"
+    EFFORTS=`expr $EFFORTS + 2`
+
+    echo "binary
+get $name
+ascii
+get /tftp-test/$ASCIIFILE" | \
+    eval "$TFTP" ${VERBOSE:+-v} "$addr" $PORT $bucket
+
+    cmp "$TMPDIR/tftp-test/$name" "$name" 2>/dev/null
+    result=$?
+    if test $? -ne 0; then
+	$silence echo >&2 "Failed chrooted access to $name."
+	RESULT=$result
+    else
+	$silence echo >&2 "Success with chrooted access to $name."
+	SUCCESSES=`expr $SUCCESSES + 1`
+    fi
+    cmp "$TMPDIR/tftp-test/$ASCIIFILE" "$ASCIIFILE" 2>/dev/null
+    result=$?
+    if test $? -ne 0; then
+	$silence echo >&2 "Failed chrooted access to /tftp-test/$ASCIIFILE."
+	RESULT=$result
+    else
+	$silence echo >&2 "Success with chrooted /tftp-test/$ASCIIFILE."
+	SUCCESSES=`expr $SUCCESSES + 1`
+    fi
+else
+    $silence echo >&2 'Informational: Inhibiting chroot test.'
+fi
+
 # Minimal clean up. Main work in posttesting().
 $silence echo
 test $RESULT -eq 0 && $silence false \

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

Summary of changes:
 ChangeLog          |   22 ++++++++
 doc/inetutils.texi |  137 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 src/tftpd.c        |   93 ++++++++++++++++++++++++++++++++++--
 tests/tftp.sh      |   67 +++++++++++++++++++++++++-
 4 files changed, 313 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Sat Jan 05 10:34:00 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TrVl2-000348-2f
	for mharc-commit-inetutils@gnu.org; Sat, 05 Jan 2013 10:34:00 -0500
Received: from eggs.gnu.org ([208.118.235.92]:35847)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TrVkz-000342-M0
	for commit-inetutils@gnu.org; Sat, 05 Jan 2013 10:33:58 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TrVkx-0006tK-Uk
	for commit-inetutils@gnu.org; Sat, 05 Jan 2013 10:33:57 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:55338)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TrVkx-0006tF-R5
	for commit-inetutils@gnu.org; Sat, 05 Jan 2013 10:33:55 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TrVkx-00076v-7H
	for commit-inetutils@gnu.org; Sat, 05 Jan 2013 15:33:55 +0000
Date: Sat, 05 Jan 2013 15:33:55 +0000
Message-Id: <E1TrVkx-00076v-7H@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-231-g19c966e
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 7d4833481e9e9fc5998c66fadd666e727b169323
X-Git-Newrev: 19c966ef509931470c379f8e15da511a19bbf8f2
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: Sat, 05 Jan 2013 15:33:59 -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  19c966ef509931470c379f8e15da511a19bbf8f2 (commit)
      from  7d4833481e9e9fc5998c66fadd666e727b169323 (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=19c966ef509931470c379f8e15da511a19bbf8f2


commit 19c966ef509931470c379f8e15da511a19bbf8f2
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sat Jan 5 16:14:02 2013 +0100

    tftpd: Group setting.

diff --git a/ChangeLog b/ChangeLog
index 3b56f74..ccc45e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2013-01-05  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	tftpd: Group setting.
+	A group named `nogroup' is not portable enough,
+	so tidy the chrooting code for robustness.
+
+	* src/tftpd.c (DEFAULT_GROUP): Remove macro.
+	(main): Do not initialize `group'.  Delay code
+	block for chroot set-up until after forking and
+	socket binding.  Separate setgid() from setuid(),
+	and inherit group membership from owner, should
+	no group have been specified.
+
 2013-01-02  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	tftpd: Chrooted mode.
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index b0375f1..e13a5c7 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -3603,8 +3603,9 @@ tftpd [@var{options}] [@var{directory} @dots{}]
 @opindex -g
 @opindex --group
 Specify group membership of the process owner.
-This is used only along with the option @option{-s}.
-The default choice is @samp{nogroup}.
+This is used only along with the option @option{-s},
+and replaces the group membership that comes from
+the process owner himself.
 
 @item -l
 @itemx --logging
@@ -3694,7 +3695,7 @@ for a read request, or a write request, to succeed.
 The standard use case is an entry in @file{/etc/inetd.conf} like
 
 @example
-tftp dgram tcp4 wait root nobody /usr/sbin/tftpd \
+tftp dgram udp4 wait root nobody /usr/sbin/tftpd \
 @verb{        } tftpd /tftpboot /altboot
 @end example
 
@@ -3719,7 +3720,7 @@ meaning that the serving process is running in a chrooted mode.
 Then a suitable configuration could be
 
 @example
-tftp dgram tcp4 wait root nobody /usr/sbin/tftpd \
+tftp dgram udp4 wait root nobody /usr/sbin/tftpd \
 @verb{        } tftpd --secure-dir=/srv/tftp-root  /tftpboot /altboot
 @end example
 
diff --git a/src/tftpd.c b/src/tftpd.c
index d648733..7f078ee 100644
--- a/src/tftpd.c
+++ b/src/tftpd.c
@@ -102,13 +102,9 @@ static int peer;
 static int rexmtval = TIMEOUT;
 static int maxtimeout = 5 * TIMEOUT;
 static char *chrootdir = NULL;
-static char *group;
+static char *group = NULL;
 static char *user;
 
-#ifndef DEFAULT_GROUP
-# define DEFAULT_GROUP	"nogroup"
-#endif
-
 #ifndef DEFAULT_USER
 # define DEFAULT_USER	"nobody"
 #endif
@@ -157,8 +153,7 @@ static struct argp_option options[] = {
 #define GRP 10
   { NULL, 0, NULL, 0, "", GRP},
   { "group", 'g', "GRP", 0,
-    "set group of process owner, used with '-s' and "
-    "defaults to 'nogroup'", GRP+1},
+    "set explicit group of process owner, used with '-s'", GRP+1},
   { "secure-dir", 's', "DIR", 0,
     "change root directory to DIR before searching and "
     "serving content", GRP+1},
@@ -222,7 +217,6 @@ main (int argc, char *argv[])
   int on, n;
   struct sockaddr_storage sin;
 
-  group = xstrdup (DEFAULT_GROUP);
   user = xstrdup (DEFAULT_USER);
 
   set_program_name (argv[0]);
@@ -247,45 +241,6 @@ main (int argc, char *argv[])
 	}
     }
 
-  if (chrootdir && *chrootdir)
-    {
-      struct passwd *pwd = NULL;
-      struct group *grp = NULL;
-
-      /* Ignore user and group setting for non-root invokations.  */
-      if (!getuid())
-	{
-	  pwd = getpwnam (user);
-	  if (!pwd)
-	    {
-	      syslog (LOG_ERR, "getpwnam('%s'): %m", user);
-	      exit (EXIT_FAILURE);
-	    }
-
-	  grp = getgrnam (group);
-	  if (!grp)
-	    {
-	      syslog (LOG_ERR, "getgrnam('%s'): %m", group);
-	      exit (EXIT_FAILURE);
-	    }
-	}
-
-      if (chroot (chrootdir) || chdir ("/"))
-	{
-	  syslog (LOG_ERR, "chroot('%s'): %m", chrootdir);
-	  exit (EXIT_FAILURE);
-	}
-
-      if (pwd && grp)
-	{
-	  if (setgid (grp->gr_gid) || setuid (pwd->pw_uid))
-	    {
-	      syslog (LOG_ERR, "setgid/setuid: %m");
-	      exit (EXIT_FAILURE);
-	    }
-	}
-    }
-
   on = 1;
   if (ioctl (0, FIONBIO, &on) < 0)
     {
@@ -385,6 +340,69 @@ main (int argc, char *argv[])
       exit (EXIT_FAILURE);
     }
 
+  if (chrootdir && *chrootdir)
+    {
+      struct passwd *pwd = NULL;
+      struct group *grp = NULL;
+
+      /* Ignore user and group setting for non-root invocations.  */
+      if (!getuid())
+	{
+	  pwd = getpwnam (user);
+	  if (!pwd)
+	    {
+	      syslog (LOG_ERR, "getpwnam('%s'): %m", user);
+	      exit (EXIT_FAILURE);
+	    }
+
+	  /* Group names are not portable enough to allow
+	   * for a preset value.  The server inherits
+	   * group membership from owner, in other cases.
+	   */
+	  if (group && *group)
+	    {
+	      grp = getgrnam (group);
+	      if (!grp)
+		{
+		  syslog (LOG_ERR, "getgrnam('%s'): %m", group);
+		  exit (EXIT_FAILURE);
+		}
+	    }
+	}
+
+      if (chroot (chrootdir) || chdir ("/"))
+	{
+	  syslog (LOG_ERR, "chroot('%s'): %m", chrootdir);
+	  exit (EXIT_FAILURE);
+	}
+
+      if (pwd)
+	{
+	  if (grp)
+	    {
+	      if (setgid (grp->gr_gid))
+		{
+		  syslog (LOG_ERR, "setgid: %m");
+		  exit (EXIT_FAILURE);
+		}
+	    }
+	  else
+	    {
+	      if (setgid (pwd->pw_gid))
+		{
+		  syslog (LOG_ERR, "setgid: %m");
+		  exit (EXIT_FAILURE);
+		}
+	    }
+
+	  if (setuid (pwd->pw_uid))
+	    {
+	      syslog (LOG_ERR, "setuid: %m");
+	      exit (EXIT_FAILURE);
+	    }
+	}
+    }
+
   tp = (struct tftphdr *) buf;
   tp->th_opcode = ntohs (tp->th_opcode);
   if (tp->th_opcode == RRQ || tp->th_opcode == WRQ)

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

Summary of changes:
 ChangeLog          |   13 ++++++
 doc/inetutils.texi |    9 ++--
 src/tftpd.c        |  112 ++++++++++++++++++++++++++++++----------------------
 3 files changed, 83 insertions(+), 51 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Tue Jan 08 15:56:18 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TsgDa-0008Fx-F9
	for mharc-commit-inetutils@gnu.org; Tue, 08 Jan 2013 15:56:18 -0500
Received: from eggs.gnu.org ([208.118.235.92]:58933)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TsgDW-0008FQ-Rz
	for commit-inetutils@gnu.org; Tue, 08 Jan 2013 15:56:17 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TsgDV-0004zS-DX
	for commit-inetutils@gnu.org; Tue, 08 Jan 2013 15:56:14 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:32934)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TsgDV-0004zN-AN
	for commit-inetutils@gnu.org; Tue, 08 Jan 2013 15:56:13 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TsgDU-0003Aw-RE
	for commit-inetutils@gnu.org; Tue, 08 Jan 2013 20:56:13 +0000
Date: Tue, 08 Jan 2013 20:56:12 +0000
Message-Id: <E1TsgDU-0003Aw-RE@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-232-g894c336
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 19c966ef509931470c379f8e15da511a19bbf8f2
X-Git-Newrev: 894c336937692e1813aab50348c10686df37518e
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, 08 Jan 2013 20:56:17 -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  894c336937692e1813aab50348c10686df37518e (commit)
      from  19c966ef509931470c379f8e15da511a19bbf8f2 (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=894c336937692e1813aab50348c10686df37518e


commit 894c336937692e1813aab50348c10686df37518e
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Mon Jan 7 23:51:51 2013 +0100

    tftpd: Error handling.

diff --git a/ChangeLog b/ChangeLog
index ccc45e0..8ec09ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-01-07  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	tftpd: Error handling.
+	Send NAK on error conditions in chrooted mode,
+	preventing the client from hanging indefinitely.
+
+	* src/tftpd.c (main): Send NAK with ENOUSER as
+	response, should chrooted mode specify non-existent
+	user or group.  Likewise when setgid() or setuid()
+	fails.  Send NAK with EACCESS, should chroot() fail.
+	(usage_str, usage): Remove unused constructs.
+
 2013-01-05  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	tftpd: Group setting.
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index e13a5c7..954c2b9 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -3695,7 +3695,7 @@ for a read request, or a write request, to succeed.
 The standard use case is an entry in @file{/etc/inetd.conf} like
 
 @example
-tftp dgram udp4 wait root nobody /usr/sbin/tftpd \
+tftp dgram udp4 wait root /usr/sbin/tftpd \
 @verb{        } tftpd /tftpboot /altboot
 @end example
 
@@ -3720,7 +3720,7 @@ meaning that the serving process is running in a chrooted mode.
 Then a suitable configuration could be
 
 @example
-tftp dgram udp4 wait root nobody /usr/sbin/tftpd \
+tftp dgram udp4 wait root /usr/sbin/tftpd \
 @verb{        } tftpd --secure-dir=/srv/tftp-root  /tftpboot /altboot
 @end example
 
diff --git a/src/tftpd.c b/src/tftpd.c
index 7f078ee..2492f3e 100644
--- a/src/tftpd.c
+++ b/src/tftpd.c
@@ -90,8 +90,6 @@
 #include <progname.h>
 #include <libinetutils.h>
 
-void usage (void);
-
 #define TIMEOUT		5
 
 #ifndef LOG_FTP
@@ -352,6 +350,7 @@ main (int argc, char *argv[])
 	  if (!pwd)
 	    {
 	      syslog (LOG_ERR, "getpwnam('%s'): %m", user);
+	      nak (ENOUSER);
 	      exit (EXIT_FAILURE);
 	    }
 
@@ -365,6 +364,7 @@ main (int argc, char *argv[])
 	      if (!grp)
 		{
 		  syslog (LOG_ERR, "getgrnam('%s'): %m", group);
+		  nak (ENOUSER);
 		  exit (EXIT_FAILURE);
 		}
 	    }
@@ -373,6 +373,7 @@ main (int argc, char *argv[])
       if (chroot (chrootdir) || chdir ("/"))
 	{
 	  syslog (LOG_ERR, "chroot('%s'): %m", chrootdir);
+	  nak (EACCESS);
 	  exit (EXIT_FAILURE);
 	}
 
@@ -383,6 +384,7 @@ main (int argc, char *argv[])
 	      if (setgid (grp->gr_gid))
 		{
 		  syslog (LOG_ERR, "setgid: %m");
+		  nak (ENOUSER);
 		  exit (EXIT_FAILURE);
 		}
 	    }
@@ -391,6 +393,7 @@ main (int argc, char *argv[])
 	      if (setgid (pwd->pw_gid))
 		{
 		  syslog (LOG_ERR, "setgid: %m");
+		  nak (ENOUSER);
 		  exit (EXIT_FAILURE);
 		}
 	    }
@@ -398,6 +401,7 @@ main (int argc, char *argv[])
 	  if (setuid (pwd->pw_uid))
 	    {
 	      syslog (LOG_ERR, "setuid: %m");
+	      nak (ENOUSER);
 	      exit (EXIT_FAILURE);
 	    }
 	}
@@ -884,19 +888,3 @@ verifyhost (struct sockaddr_storage *fromp, socklen_t frlen)
       return "0.0.0.0";
     }
 }
-
-static const char usage_str[] =
-  "Usage: tftpd [OPTIONS...]\n"
-  "\n"
-  "Options are:\n"
-  "   -l                      Enable logging\n"
-  "   -n                      Supress negative acknowledgement of\n"
-  "                           requests for nonexistent relative filenames\n"
-  "       --help              Display usage instructions\n"
-  "       --version           Display program version\n";
-
-void
-usage (void)
-{
-  printf ("%s\n" "Send bug reports to <%s>\n", usage_str, PACKAGE_BUGREPORT);
-}

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

Summary of changes:
 ChangeLog          |   12 ++++++++++++
 doc/inetutils.texi |    4 ++--
 src/tftpd.c        |   24 ++++++------------------
 3 files changed, 20 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Jan 16 04:59:50 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TvPmg-0001DL-0L
	for mharc-commit-inetutils@gnu.org; Wed, 16 Jan 2013 04:59:50 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52923)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvPme-0001Co-0R
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 04:59:49 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvPma-0005Ir-VT
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 04:59:47 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:53725)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvPma-0005IP-Rw
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 04:59:44 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TvPma-0003JX-5I
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 09:59:44 +0000
Date: Wed, 16 Jan 2013 09:59:44 +0000
Message-Id: <E1TvPma-0003JX-5I@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-233-g41058f5
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 894c336937692e1813aab50348c10686df37518e
X-Git-Newrev: 41058f573aefc006eabc7c1fb1071b0f23e8ab14
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, 16 Jan 2013 09:59:49 -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  41058f573aefc006eabc7c1fb1071b0f23e8ab14 (commit)
      from  894c336937692e1813aab50348c10686df37518e (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=41058f573aefc006eabc7c1fb1071b0f23e8ab14


commit 41058f573aefc006eabc7c1fb1071b0f23e8ab14
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Jan 16 10:55:38 2013 +0100

    Documentation (silent change).

diff --git a/NEWS b/NEWS
index b29896e..e5a9fea 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,80 @@ 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'.
 
+* ifconfig
+
+Provides new support for BSD and improved support for Solaris.
+Argument handling has been corrected to avoid some segfaults.
+
+* ping
+
+New switches `--ip-timestamp', `--mask', `-T/--tos' and `--ttl'.
+
+* ping6
+
+New switches `--hoplimit' and `-v/--verbose'.
+
+* rcp
+
+Supports IPv6 and Shishi.  New switches `-4/--ipv4', `-6/--ipv6',
+`-k/--realm', `-K/--kerberos', and `-x/--encrypt'.
+
+* rexec
+
+Supports IPv6.  New switches `-4/--ipv4', `-6/--ipv6', `-a/--ipany'
+
+* rlogin, rsh
+
+Support IPv6.  New switches `-4/--ipv4', `-6/--ipv6'.
+
+* telnet
+
+New switch `-k/--realm'.
+
+* traceroute
+
+Default mode is now UDP, for better conformity with Unices.
+New switches `-f/--first-hop', `-I/--icmp', `-t/--tos', and
+`-w/--wait'.
+
+* ftpd
+
+Full IPv6 support.  PAM support is restricted to Linux-PAM,
+since `pam_ftp.so' exists only there and our code depends on
+its response for handling anonymous users.  Server now accepts
+commands LPRT and LPSV.
+
+* inetd
+
+Service configuration now allows setting also the group.
+
+* rexecd
+
+Can be built with PAM support.  New option `-l/--logging'.
+
+* rlogind
+
+Support for IPv6.  New switches `-4/--ipv4', `-6/--ipv6',
+and `-S/--server-principal'.
+
+* rshd
+
+Now has support for IPv6, PAM, and Shishi.  New switches
+`-k/--kerberos', `-S/--server-principal', `-v/--vacuous',
+and `-x/--encrypt'.
+
+* telnetd
+
+New switch `-S/--server-principal'.
+
+* tftpd
+
+New switches `-g/--group', `-s/--secure-dir', and `-u/--user'.
+
+* uucpd
+
+New switch `-u/--uucico'.
+
 
 January 6, 2012
 Version 1.9.1:

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

Summary of changes:
 NEWS |   74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 74 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Jan 16 05:47:17 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TvQWb-0007Ai-1M
	for mharc-commit-inetutils@gnu.org; Wed, 16 Jan 2013 05:47:17 -0500
Received: from eggs.gnu.org ([208.118.235.92]:37025)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvQWX-00079W-Pe
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 05:47:14 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvQWV-00012Q-9W
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 05:47:13 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:51627)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvQWV-00012M-6K
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 05:47:11 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TvQWU-0006SH-RI
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 10:47:11 +0000
Date: Wed, 16 Jan 2013 10:47:10 +0000
Message-Id: <E1TvQWU-0006SH-RI@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-234-gba47e90
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 41058f573aefc006eabc7c1fb1071b0f23e8ab14
X-Git-Newrev: ba47e906562bd24bac4b24f1c6f8ecc29dfacbdc
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, 16 Jan 2013 10:47: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  ba47e906562bd24bac4b24f1c6f8ecc29dfacbdc (commit)
      from  41058f573aefc006eabc7c1fb1071b0f23e8ab14 (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=ba47e906562bd24bac4b24f1c6f8ecc29dfacbdc


commit ba47e906562bd24bac4b24f1c6f8ecc29dfacbdc
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Jan 16 11:25:11 2013 +0100

    ping, ping6: Error handling.

diff --git a/ChangeLog b/ChangeLog
index 8ec09ee..6c5bc95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-01-16  Guillem Jover  <guillem@hadrons.org>
+
+	* ping/libping.c (ping_xmit): Do not call perror().
+	Instead return a negative status.
+	* ping/ping.c (send_echo): New variable RC.
+	Abort with a message on any error condition.
+	* ping/ping6.c (ping_xmit): Likewise.
+	(send_echo): Likewise.
+
 2013-01-07  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	tftpd: Error handling.
diff --git a/ping/libping.c b/ping/libping.c
index d269150..cd6c016 100644
--- a/ping/libping.c
+++ b/ping/libping.c
@@ -152,7 +152,7 @@ ping_xmit (PING * p)
   i = sendto (p->ping_fd, (char *) p->ping_buffer, buflen, 0,
 	      (struct sockaddr *) &p->ping_dest.ping_sockaddr, sizeof (struct sockaddr_in));
   if (i < 0)
-    perror ("ping: sendto");
+    return -1;
   else
     {
       p->ping_num_xmit++;
diff --git a/ping/ping.c b/ping/ping.c
index 9f51671..5da4d99 100644
--- a/ping/ping.c
+++ b/ping/ping.c
@@ -497,6 +497,7 @@ int
 send_echo (PING * ping)
 {
   size_t off = 0;
+  int rc;
 
   if (PING_TIMING (data_length))
     {
@@ -509,7 +510,12 @@ send_echo (PING * ping)
     ping_set_data (ping, data_buffer, off,
 		   data_length > off ? data_length - off : data_length,
 		   USE_IPV6);
-  return ping_xmit (ping);
+
+  rc = ping_xmit (ping);
+  if (rc < 0)
+    error (EXIT_FAILURE, errno, "sending packet");
+
+  return rc;
 }
 
 int
diff --git a/ping/ping6.c b/ping/ping6.c
index 2035ec2..ff3f4b7 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -384,6 +384,7 @@ static int
 send_echo (PING * ping)
 {
   size_t off = 0;
+  int rc;
 
   if (PING_TIMING (data_length))
     {
@@ -396,7 +397,12 @@ send_echo (PING * ping)
     ping_set_data (ping, data_buffer, off,
 		   data_length > off ? data_length - off : data_length,
 		   USE_IPV6);
-  return ping_xmit (ping);
+
+  rc = ping_xmit (ping);
+  if (rc < 0)
+    error (EXIT_FAILURE, errno, "sending packet");
+
+  return rc;
 }
 
 static int
@@ -796,7 +802,7 @@ ping_xmit (PING * p)
 	      (struct sockaddr *) &p->ping_dest.ping_sockaddr6,
 	      sizeof (p->ping_dest.ping_sockaddr6));
   if (i < 0)
-    perror ("ping: sendto");
+    return -1;
   else
     {
       p->ping_num_xmit++;

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

Summary of changes:
 ChangeLog      |    9 +++++++++
 ping/libping.c |    2 +-
 ping/ping.c    |    8 +++++++-
 ping/ping6.c   |   10 ++++++++--
 4 files changed, 25 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Jan 16 13:54:12 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TvY7o-0006m4-3N
	for mharc-commit-inetutils@gnu.org; Wed, 16 Jan 2013 13:54:12 -0500
Received: from eggs.gnu.org ([208.118.235.92]:42322)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvVrb-0006v5-R5
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 11:29:22 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvVrV-0007wY-Ob
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 11:29:19 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:38848)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvVrV-0007wN-L7
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 11:29:13 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TvVrS-000848-NP
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 16:29:12 +0000
Date: Wed, 16 Jan 2013 16:29:11 +0000
Message-Id: <E1TvVrS-000848-NP@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-235-gab029ce
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: ba47e906562bd24bac4b24f1c6f8ecc29dfacbdc
X-Git-Newrev: ab029ce23a3cfa9f2051cb07fa7c16228c5d3775
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, 16 Jan 2013 18:54:10 -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  ab029ce23a3cfa9f2051cb07fa7c16228c5d3775 (commit)
      from  ba47e906562bd24bac4b24f1c6f8ecc29dfacbdc (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=ab029ce23a3cfa9f2051cb07fa7c16228c5d3775


commit ab029ce23a3cfa9f2051cb07fa7c16228c5d3775
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Jan 16 17:27:06 2013 +0100

    ping: Less verbosity in echo mode.

diff --git a/ChangeLog b/ChangeLog
index 6c5bc95..a9a190b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-16  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* ping/ping_echo.c (print_ip_header): Empirically test
+	`ip->ip_len' to decide whether ntohs() is needed.
+	(print_icmp): Call print_ip_data() only in verbose mode.
+
 2013-01-16  Guillem Jover  <guillem@hadrons.org>
 
 	* ping/libping.c (ping_xmit): Do not call perror().
diff --git a/ping/ping_echo.c b/ping/ping_echo.c
index 7ba698a..70c5b1d 100644
--- a/ping/ping_echo.c
+++ b/ping/ping_echo.c
@@ -318,8 +318,14 @@ print_ip_header (struct ip *ip)
 
   printf
     ("Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src\tDst\tData\n");
-  printf (" %1x  %1x  %02x %04x %04x", ip->ip_v, ip->ip_hl, ip->ip_tos,
-	  ntohs (ip->ip_len), ntohs (ip->ip_id));
+  printf (" %1x  %1x  %02x", ip->ip_v, ip->ip_hl, ip->ip_tos);
+  /*
+   * The member `ip_len' is not portably reported in any byte order.
+   * Use a simple heuristic to print a reasonable value.
+   */
+  printf (" %04x %04x",
+	  (ip->ip_len > 0x2000) ? ntohs (ip->ip_len) : ip->ip_len,
+	  ntohs (ip->ip_id));
   printf ("   %1x %04x", (ntohs (ip->ip_off) & 0xe000) >> 13,
 	  ntohs (ip->ip_off) & 0x1fff);
   printf ("  %02x  %02x %04x", ip->ip_ttl, ip->ip_p, ntohs (ip->ip_sum));
@@ -367,7 +373,8 @@ static void
 print_icmp (icmphdr_t * icmp, void *data)
 {
   print_icmp_code (icmp->icmp_type, icmp->icmp_code, data);
-  print_ip_data (icmp, NULL);
+  if (options && OPT_VERBOSE)
+    print_ip_data (icmp, NULL);
 }
 
 static void

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

Summary of changes:
 ChangeLog        |    6 ++++++
 ping/ping_echo.c |   13 ++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Jan 16 20:36:38 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TvePG-0001xw-OC
	for mharc-commit-inetutils@gnu.org; Wed, 16 Jan 2013 20:36:38 -0500
Received: from eggs.gnu.org ([208.118.235.92]:55355)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvePD-0001xR-Ep
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 20:36:36 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvePB-0000Ku-TC
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 20:36:35 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:50356)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TveAa-0005Mt-3l
	for commit-inetutils@gnu.org; Wed, 16 Jan 2013 20:21:28 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TveAY-00042e-Ql
	for commit-inetutils@gnu.org; Thu, 17 Jan 2013 01:21:27 +0000
Date: Thu, 17 Jan 2013 01:21:26 +0000
Message-Id: <E1TveAY-00042e-Ql@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-236-g3853b33
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: ab029ce23a3cfa9f2051cb07fa7c16228c5d3775
X-Git-Newrev: 3853b33cf34fcf0773a861947bfd9b7b7731815f
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, 17 Jan 2013 01:36:36 -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  3853b33cf34fcf0773a861947bfd9b7b7731815f (commit)
      from  ab029ce23a3cfa9f2051cb07fa7c16228c5d3775 (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=3853b33cf34fcf0773a861947bfd9b7b7731815f


commit 3853b33cf34fcf0773a861947bfd9b7b7731815f
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Jan 17 01:51:12 2013 +0100

    ping6: Verbose packet info.

diff --git a/ChangeLog b/ChangeLog
index a9a190b..6afd5d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-01-17  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* ping/ping6.c: Include <arpa/inet.h>.
+	(print_ip_data): New function.
+	(print_icmp_error): In verbose mode, let print_ip_data()
+	display information on returned packet.
+
+	* ping/ping_echo.c (print_icmp): Use bitwise-and in test.
+
 2013-01-16  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* ping/ping_echo.c (print_ip_header): Empirically test
diff --git a/NEWS b/NEWS
index e5a9fea..f7b703c 100644
--- a/NEWS
+++ b/NEWS
@@ -66,7 +66,8 @@ Can be built with PAM support.  New option `-l/--logging'.
 
 * rlogind
 
-Support for IPv6.  New switches `-4/--ipv4', `-6/--ipv6',
+Support for IPv6.  Buildable with libwrap support for use in
+stand-alone daemon mode.  New switches `-4/--ipv4', `-6/--ipv6',
 and `-S/--server-principal'.
 
 * rshd
diff --git a/ping/ping6.c b/ping/ping6.c
index ff3f4b7..77b4f03 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -31,6 +31,7 @@
 #include <netinet/in.h>
 #include <netinet/ip6.h>
 #include <netinet/icmp6.h>
+#include <arpa/inet.h>
 
 #include <netdb.h>
 #include <unistd.h>
@@ -662,6 +663,58 @@ print_param_prob (struct icmp6_hdr *icmp6)
   printf ("Unknown code %d\n", icmp6->icmp6_code);
 }
 
+void
+print_ip_data (struct icmp6_hdr *icmp6)
+{
+  size_t j;
+  struct ip6_hdr *ip = (struct ip6_hdr *) ((char *) icmp6 + sizeof (*icmp6));
+  char src[INET6_ADDRSTRLEN], dst[INET6_ADDRSTRLEN];
+
+  (void) inet_ntop (AF_INET6, &ip->ip6_dst, dst, sizeof (dst));
+  (void) inet_ntop (AF_INET6, &ip->ip6_src, src, sizeof (src));
+
+  printf ("IP Header Dump:\n ");
+  for (j = 0; j < sizeof (*ip) - sizeof (ip->ip6_src) - sizeof (ip->ip6_dst); ++j)
+    printf ("%02x%s", *((unsigned char *) ip + j),
+	    (j % 2) ? " " : "");	/* Group bytes two by two.  */
+  printf ("(src) (dst)\n");
+
+  printf ("Vr TC Flow Plen Nxt Hop Src\t\t  Dst\n");
+  printf (" %1x %02x %04x %4hu %3hhu %3hhu %s %s\n",
+	  ntohl (ip->ip6_flow) >> 28,
+	  (ntohl (ip->ip6_flow) & 0x0fffffff) >> 20,
+	  ntohl (ip->ip6_flow) & 0x0fffff,
+	  ntohs (ip->ip6_plen), ip->ip6_nxt, ip->ip6_hlim,
+	  src, dst);
+
+  switch (ip->ip6_nxt)
+    {
+    case IPPROTO_ICMPV6:
+      {
+	struct icmp6_hdr *hdr =
+	  (struct icmp6_hdr *) ((unsigned char *) ip + sizeof (*ip));
+
+	printf ("ICMP: type %hhu, code %hhu, size %hu",
+		hdr->icmp6_type, hdr->icmp6_code, ntohs (ip->ip6_plen));
+	switch (hdr->icmp6_type)
+	  {
+	  case ICMP6_ECHO_REQUEST:
+	  case ICMP6_ECHO_REPLY:
+	    printf (", id 0x%04x, seq 0x%04x",
+		    ntohs (hdr->icmp6_id), ntohs (hdr->icmp6_seq));
+	    break;
+	  default:
+	    break;
+	  }
+      }
+      break;
+    default:
+      break;
+    }
+
+  printf ("\n");
+};
+
 static struct icmp_diag
 {
   int type;
@@ -688,6 +741,9 @@ print_icmp_error (struct sockaddr_in6 *from, struct icmp6_hdr *icmp6, int len)
       if (p->type == icmp6->icmp6_type)
 	{
 	  p->func (icmp6);
+	  if (options & OPT_VERBOSE)
+	    print_ip_data (icmp6);
+
 	  return;
 	}
     }
diff --git a/ping/ping_echo.c b/ping/ping_echo.c
index 70c5b1d..634e178 100644
--- a/ping/ping_echo.c
+++ b/ping/ping_echo.c
@@ -373,7 +373,7 @@ static void
 print_icmp (icmphdr_t * icmp, void *data)
 {
   print_icmp_code (icmp->icmp_type, icmp->icmp_code, data);
-  if (options && OPT_VERBOSE)
+  if (options & OPT_VERBOSE)
     print_ip_data (icmp, NULL);
 }
 

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

Summary of changes:
 ChangeLog        |    9 ++++++++
 NEWS             |    3 +-
 ping/ping6.c     |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ping/ping_echo.c |    2 +-
 4 files changed, 68 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Jan 17 08:47:16 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TvpoK-0004HS-Iu
	for mharc-commit-inetutils@gnu.org; Thu, 17 Jan 2013 08:47:16 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57520)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvpoF-0004Gd-Ve
	for commit-inetutils@gnu.org; Thu, 17 Jan 2013 08:47:14 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvpoD-00060M-Ql
	for commit-inetutils@gnu.org; Thu, 17 Jan 2013 08:47:11 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:45328)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TvpoD-00060I-N0
	for commit-inetutils@gnu.org; Thu, 17 Jan 2013 08:47:09 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TvpoC-0004Qy-Qg
	for commit-inetutils@gnu.org; Thu, 17 Jan 2013 13:47:09 +0000
Date: Thu, 17 Jan 2013 13:47:09 +0000
Message-Id: <E1TvpoC-0004Qy-Qg@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-238-g63f4ad4
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 3853b33cf34fcf0773a861947bfd9b7b7731815f
X-Git-Newrev: 63f4ad499f4a3b90f16995b47e53439adb6f9cd0
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, 17 Jan 2013 13:47:14 -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  63f4ad499f4a3b90f16995b47e53439adb6f9cd0 (commit)
       via  d7ffe9ddf524b0ff13088b2685bd9cfde5e580f5 (commit)
      from  3853b33cf34fcf0773a861947bfd9b7b7731815f (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=63f4ad499f4a3b90f16995b47e53439adb6f9cd0


commit 63f4ad499f4a3b90f16995b47e53439adb6f9cd0
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Jan 17 12:38:46 2013 +0100

    ping6: More options.

diff --git a/ChangeLog b/ChangeLog
index 611a543..da35d5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2013-01-17  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	ping6: Setting of tclass and flowinfo.
+
+	* ping/ping6.c (tclass) [IPV6_TCLASS]: New variable.
+	(flowinfo) [IPV6_FLOWINFO]: New variable.
+	(argp_options): Make `--ttl' a synonym for `--hoplimit'.
+	[IPV6_FLOWINFO]: New option `-F/--flowinfo'.
+	[IPV6_TCLASS]: New option `-T/--tos'.
+	(parse_opt) [IPV6_FLOWINFO]: New case 'F'.
+	[IPV6_TCLASS]: New case 'T'.
+	(main) [IPV6_TCLASS]: Call setsockopt(IPV6_TCLASS).
+	[IPV6_FLOWINFO]: Call setsockopt(IPV6_FLOWINFO).
+	* ping/ping_common.h (OPT_FLOWINFO, OPT_TCLASS): New macros.
+
+2013-01-17  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	CVE-2010-2529: Infinite loop.
 
 	* ping/ping_echo.c (print_ip_opt) <IPOPT_RR>: Break loop
diff --git a/NEWS b/NEWS
index f7b703c..02fccce 100644
--- a/NEWS
+++ b/NEWS
@@ -24,7 +24,7 @@ New switches `--ip-timestamp', `--mask', `-T/--tos' and `--ttl'.
 
 * ping6
 
-New switches `--hoplimit' and `-v/--verbose'.
+New switches `--hoplimit/--ttl', `-T/--tos' and `-v/--verbose'.
 
 * rcp
 
diff --git a/ping/ping6.c b/ping/ping6.c
index 77b4f03..203790c 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -68,6 +68,12 @@ int timeout = -1;
 int hoplimit = 0;
 unsigned int options;
 static unsigned long preload = 0;
+#ifdef IPV6_TCLASS
+int tclass = -1;	/* Kernel sets default: -1, RFC 3542.  */
+#endif
+#ifdef IPV6_FLOWINFO
+int flowinfo;
+#endif
 
 static int ping_echo (char *hostname);
 static void ping_reset (PING * p);
@@ -91,13 +97,20 @@ static struct argp_option argp_options[] = {
   {NULL, 0, NULL, 0, "Options valid for all request types:", GRP},
   {"count", 'c', "NUMBER", 0, "stop after sending NUMBER packets", GRP+1},
   {"debug", 'd', NULL, 0, "set the SO_DEBUG option", GRP+1},
+#ifdef IPV6_FLOWINFO
+  {"flowinfo", 'F', "N", 0, "set N as flow identifier", GRP+1},
+#endif
   {"hoplimit", ARG_HOPLIMIT, "N", 0, "specify N as hop-limit", GRP+1},
   {"interval", 'i', "NUMBER", 0, "wait NUMBER seconds between sending each "
    "packet", GRP+1},
   {"numeric", 'n', NULL, 0, "do not resolve host addresses", GRP+1},
   {"ignore-routing", 'r', NULL, 0, "send directly to a host on an attached "
    "network", GRP+1},
+#ifdef IPV6_TCLASS
+  {"tos", 'T', "N", 0, "set traffic class to N", GRP+1},
+#endif
   {"timeout", 'w', "N", 0, "stop after N seconds", GRP+1},
+  {"ttl", ARG_HOPLIMIT, "N", 0, "synonym for --hoplimit", GRP+1},
   {"verbose", 'v', NULL, 0, "verbose output", GRP+1},
 #undef GRP
 #define GRP 10
@@ -137,6 +150,13 @@ parse_opt (int key, char *arg, struct argp_state *state)
       setbuf (stdout, (char *) NULL);
       break;
 
+#ifdef IPV6_FLOWINFO
+    case 'F':
+      options |= OPT_FLOWINFO;
+      flowinfo = ping_cvt_number (arg, 0, 0) & IPV6_FLOWINFO_FLOWLABEL;
+      break;
+#endif
+
     case 'i':
       options |= OPT_INTERVAL;
       interval = ping_cvt_number (arg, 0, 0);
@@ -173,6 +193,13 @@ parse_opt (int key, char *arg, struct argp_state *state)
       data_length = ping_cvt_number (arg, PING_MAX_DATALEN, 1);
       break;
 
+#ifdef IPV6_TCLASS
+    case 'T':
+      options |= OPT_TCLASS;
+      tclass = ping_cvt_number (arg, 0, 0);
+      break;
+#endif
+
     case 'v':
       options |= OPT_VERBOSE;
       break;
@@ -244,6 +271,20 @@ main (int argc, char **argv)
 		    &hoplimit, sizeof (hoplimit)) < 0)
       error (0, errno, "setsockopt(IPV6_HOPLIMIT)");
 
+#ifdef IPV6_TCLASS
+  if (options & OPT_TCLASS)
+    if (setsockopt (ping->ping_fd, IPPROTO_IPV6, IPV6_TCLASS,
+		    &tclass, sizeof (tclass)) < 0)
+      error (EXIT_FAILURE, errno, "setsockopt(IPV6_TCLASS)");
+#endif
+
+#ifdef IPV6_FLOWINFO
+  if (options & OPT_FLOWINFO)
+    if (setsockopt (ping->ping_fd, IPPROTO_IPV6, IPV6_FLOWINFO,
+		    &flowinfo, sizeof (flowinfo)) < 0)
+      error (EXIT_FAILURE, errno, "setsockopt(IPV6_FLOWINFO)");
+#endif
+
   init_data_buffer (patptr, pattern_len);
 
   while (argc--)
diff --git a/ping/ping_common.h b/ping/ping_common.h
index 0a5c336..6485252 100644
--- a/ping/ping_common.h
+++ b/ping/ping_common.h
@@ -36,6 +36,8 @@
 #define OPT_RROUTE      0x010
 #define OPT_VERBOSE     0x020
 #define OPT_IPTIMESTAMP 0x040
+#define OPT_FLOWINFO    0x080
+#define OPT_TCLASS      0x100
 
 #define SOPT_TSONLY     0x001
 #define SOPT_TSADDR     0x002

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


commit d7ffe9ddf524b0ff13088b2685bd9cfde5e580f5
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Jan 17 10:34:55 2013 +0100

    ping: CVE-2010-2529

diff --git a/ChangeLog b/ChangeLog
index 6afd5d9..611a543 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2013-01-17  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	CVE-2010-2529: Infinite loop.
+
+	* ping/ping_echo.c (print_ip_opt) <IPOPT_RR>: Break loop
+	if option is truncated or exhausted.
+	<IPOPT_TS>: Break loop if option is truncated.
+
+2013-01-17  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	* ping/ping6.c: Include <arpa/inet.h>.
 	(print_ip_data): New function.
 	(print_icmp_error): In verbose mode, let print_ip_data()
diff --git a/ping/ping_echo.c b/ping/ping_echo.c
index 634e178..e83ccff 100644
--- a/ping/ping_echo.c
+++ b/ping/ping_echo.c
@@ -499,7 +499,7 @@ print_ip_opt (struct ip *ip, int hlen)
 	  i = j;
 	i -= IPOPT_MINOFF;
 	if (i <= 0)
-	  continue;
+	  break;
 	if (i == old_rrlen
 	    && cp == (unsigned char *) (ip + 1) + 2
 	    && !memcmp ((char *) cp, old_rr, i) && !(options & OPT_FLOOD))
@@ -561,6 +561,10 @@ print_ip_opt (struct ip *ip, int hlen)
 	if (i > j)
 	  i = j;
 
+	/* Check minimal sizing.  */
+	if (j <= (int) (IPOPT_MINOFF + sizeof (n_time)))
+	  break;
+
 	k = *++cp;	/* OV, FL */
 	++cp;		/* Points at first content.  */
 	hlen -= 2;

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

Summary of changes:
 ChangeLog          |   23 +++++++++++++++++++++++
 NEWS               |    2 +-
 ping/ping6.c       |   41 +++++++++++++++++++++++++++++++++++++++++
 ping/ping_common.h |    2 ++
 ping/ping_echo.c   |    6 +++++-
 5 files changed, 72 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Jan 24 10:50:04 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TyP40-0000lV-7x
	for mharc-commit-inetutils@gnu.org; Thu, 24 Jan 2013 10:50:04 -0500
Received: from eggs.gnu.org ([208.118.235.92]:49508)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TyP3p-0000Ty-J2
	for commit-inetutils@gnu.org; Thu, 24 Jan 2013 10:50:02 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TyP3e-0000Yb-Ld
	for commit-inetutils@gnu.org; Thu, 24 Jan 2013 10:49:53 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:49276)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TyP3e-0000YX-Gh
	for commit-inetutils@gnu.org; Thu, 24 Jan 2013 10:49:42 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TyP3d-0003Qh-D7
	for commit-inetutils@gnu.org; Thu, 24 Jan 2013 15:49:41 +0000
Date: Thu, 24 Jan 2013 15:49:41 +0000
Message-Id: <E1TyP3d-0003Qh-D7@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-241-g03bfa11
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 63f4ad499f4a3b90f16995b47e53439adb6f9cd0
X-Git-Newrev: 03bfa11f0e61d5babc11df6ea2dfa92a0644ec47
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, 24 Jan 2013 15:50:02 -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  03bfa11f0e61d5babc11df6ea2dfa92a0644ec47 (commit)
       via  b1d8390d0a62254943dee1944ba549abba3e376e (commit)
       via  9f586013083f6741fe4b164ea82fc7b658d1cf66 (commit)
      from  63f4ad499f4a3b90f16995b47e53439adb6f9cd0 (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=03bfa11f0e61d5babc11df6ea2dfa92a0644ec47


commit 03bfa11f0e61d5babc11df6ea2dfa92a0644ec47
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Tue Jan 22 23:45:16 2013 +0100

    traceroute: Source routing.

diff --git a/ChangeLog b/ChangeLog
index 4a85108..2dca504 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2013-01-22  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	traceroute: Loose source routing.
+
+	* src/traceroute.c [HAVE_NETINET_IP_VAR_H]:
+	Include <netinet/ip_var.h>.
+	(len_ip_opts, ip_opts, opt_gateways) [IP_OPTIONS]:
+	New variables.
+	(argp_options) [IP_OPTIONS]: New option `-g/--gateways'.
+	(parse_opt) [IP_OPTIONS] <'g'>: New case.
+	(main): Call trace_ip_opts().
+	(trace_init) [IP_OPTIONS]: If `len_ip_opts' is positive,
+	call setsockopt(IP_OPTIONS).
+	(trace_ip_opts): New function.
+
+	traceroute: Settable maximal hop count.
+
+	* src/traceroute.c (argp_options): New option `-m/--max-hop'.
+	(parse_opt) <'m'>: New case.
+	(main): Exit with EXIT_FAILURE if HOP exceeds `opt_max_hops'.
+
 2013-01-21  Guillem Jover  <guillem@hadrons.org>
 
 	Cleanup automake variables.
diff --git a/NEWS b/NEWS
index 02fccce..06a7780 100644
--- a/NEWS
+++ b/NEWS
@@ -46,8 +46,8 @@ New switch `-k/--realm'.
 * traceroute
 
 Default mode is now UDP, for better conformity with Unices.
-New switches `-f/--first-hop', `-I/--icmp', `-t/--tos', and
-`-w/--wait'.
+New switches `-f/--first-hop', `-g/--gateways', `-I/--icmp',
+`-m/--max-hop', `-t/--tos', and `-w/--wait'.
 
 * ftpd
 
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index 954c2b9..aceb33f 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -889,12 +889,32 @@ properties closer to the target host, skipping routers close
 to the local host.  Quicker analysis of problems known to lie
 at some routing distance is the outcome.
 
+@item -g @var{gates}
+@itemx --gateways=@var{gates}
+@opindex -g
+@opindex --gateways
+Set intermediary hosts used in loose source routing.
+The argument @var{gates} is a list of gateways,
+using spaces, commata, or semicola as separators.
+These hosts must be traversed in the given order
+before the intended host receives any datagram.
+At most eight host names or addresses may be specified.
+
 @item -I
 @itemx --icmp
 @opindex -I
 @opindex --icmp
 Use ICMP ECHO datagrams for probing the remote host.
 
+@item -m @var{num}
+@itemx --max-hop=@var{num}
+@opindex -m
+@opindex --max-hop
+Set the maximum time-to-live allowed for probing.
+In other words, stop probing when the hop distance
+is in excess of @var{num}.
+The default limit is 64.
+
 @item -M @var{method}
 @itemx --type=@var{method}
 @opindex -M
diff --git a/src/traceroute.c b/src/traceroute.c
index d6f75f0..63c6474 100644
--- a/src/traceroute.c
+++ b/src/traceroute.c
@@ -31,6 +31,9 @@
 #include <netinet/ip.h>
 /* #include <netinet/ip_icmp.h> -- Deliberately not including this
    since the definitions in use are being pulled in by libicmp. */
+#ifdef HAVE_NETINET_IP_VAR_H
+# include <netinet/ip_var.h>
+#endif
 
 #include <arpa/inet.h>
 #include <netdb.h>
@@ -79,6 +82,7 @@ typedef struct trace
 
 void trace_init (trace_t * t, const struct sockaddr_in to,
 		 const enum trace_type type);
+void trace_ip_opts (struct sockaddr_in *to);
 void trace_inc_ttl (trace_t * t);
 void trace_inc_port (trace_t * t);
 void trace_port (trace_t * t, const unsigned short port);
@@ -101,6 +105,11 @@ static char *hostname = NULL;
 char addrstr[INET6_ADDRSTRLEN];
 struct sockaddr_in dest;
 
+#ifdef IP_OPTIONS
+size_t len_ip_opts = 0;
+char ip_opts[MAX_IPOPTLEN];
+#endif /* IP_OPTIONS */
+
 /* Cause for destination unreachable reply,
  * encoded as a single character.
  */
@@ -114,6 +123,9 @@ int opt_resolve_hostnames = 0;
 int opt_tos = -1;	/* Triggers with non-negative values.  */
 int opt_ttl = TRACE_TTL;
 int opt_wait = TIME_INTERVAL;
+#ifdef IP_OPTIONS
+char *opt_gateways = NULL;
+#endif
 
 const char args_doc[] = "HOST";
 const char doc[] = "Print the route packets trace to network host.";
@@ -131,7 +143,12 @@ static struct argp_option argp_options[] = {
 #define GRP 0
   {"first-hop", 'f', "NUM", 0, "set initial hop distance, i.e., time-to-live",
    GRP+1},
+#ifdef IP_OPTIONS
+  {"gateways", 'g', "GATES", 0, "list of gateways for loose source routing",
+   GRP+1},
+#endif
   {"icmp", 'I', NULL, 0, "use ICMP ECHO as probe", GRP+1},
+  {"max-hop", 'm', "NUM", 0, "set maximal hop count (default: 64)", GRP+1},
   {"port", 'p', "PORT", 0, "use destination PORT port (default: 33434)",
    GRP+1},
   {"resolve-hostnames", OPT_RESOLVE, NULL, 0, "resolve hostnames", GRP+1},
@@ -160,10 +177,22 @@ parse_opt (int key, char *arg, struct argp_state *state)
         error (EXIT_FAILURE, 0, "impossible distance `%s'", arg);
       break;
 
+#ifdef IP_OPTIONS
+    case 'g':
+      opt_gateways = xstrdup (arg);
+      break;
+#endif /* IP_OPTIONS */
+
     case 'I':
       opt_type = TRACE_ICMP;
       break;
 
+    case 'm':
+      opt_max_hops = strtol (arg, &p, 0);
+      if (*p || opt_max_hops <= 0 || opt_max_hops > 255)
+	error (EXIT_FAILURE, 0, "invalid hops value `%s'", arg);
+      break;
+
     case 'p':
       opt_port = strtol (arg, &p, 0);
       if (*p || opt_port <= 0 || opt_port > 65536)
@@ -284,6 +313,8 @@ main (int argc, char **argv)
 
   freeaddrinfo (res);
 
+  trace_ip_opts (&dest);
+
   trace_init (&trace, dest, opt_type);
 
   hop = 1;
@@ -292,7 +323,7 @@ main (int argc, char **argv)
   while (!stop)
     {
       if (hop > opt_max_hops)
-	exit (EXIT_SUCCESS);
+	exit (EXIT_FAILURE);
       do_try (&trace, hop, opt_max_hops, opt_max_tries);
       trace_inc_ttl (&trace);
       trace_inc_port (&trace);
@@ -474,6 +505,13 @@ trace_init (trace_t * t, const struct sockaddr_in to,
     if (setsockopt (fd, IPPROTO_IP, IP_TOS,
 		    &opt_tos, sizeof (opt_tos)) < 0)
       error (0, errno, "setsockopt(IP_TOS)");
+
+#ifdef IP_OPTIONS
+  if (len_ip_opts)
+    if (setsockopt (fd, IPPROTO_IP, IP_OPTIONS,
+		    &ip_opts, len_ip_opts) < 0)
+      error (0, errno, "setsockopt(IPOPT_LSRR)");
+#endif /* IP_OPTIONS */
 }
 
 void
@@ -698,3 +736,80 @@ trace_inc_port (trace_t * t)
   if (t->type == TRACE_UDP)
     t->to.sin_port = htons (ntohs (t->to.sin_port) + 1);
 }
+
+void
+trace_ip_opts (struct sockaddr_in *to)
+{
+#ifdef IP_OPTIONS
+  if (opt_gateways && *opt_gateways)
+    {
+      char *gateway, *optbase;
+      struct addrinfo hints, *res;
+
+      memset (&hints, 0, sizeof (hints));
+      hints.ai_family = AF_INET;
+      hints.ai_socktype = SOCK_DGRAM;
+
+      memset (&ip_opts, 0, sizeof (ip_opts));
+      optbase = ip_opts;
+
+      /* Set up any desired options.  Keep
+       * `optbase' updated, pointing to the
+       * part presently under construction.
+       */
+
+      /* 1. Loose source routing.  */
+      gateway = opt_gateways;
+      optbase[IPOPT_OPTVAL] = IPOPT_LSRR;
+      optbase[IPOPT_OLEN] = IPOPT_MINOFF - 1;	/* No payload yet.  */
+      optbase[IPOPT_OFFSET] = IPOPT_MINOFF;	/* Empty payload.  */
+
+      /* Traverse the gateway list, inserting
+       * addresses in the stated order.  Take
+       * care not to overflow available space.
+       */
+      while (gateway && *gateway
+	     && optbase[IPOPT_OFFSET]
+		< (int) (MAX_IPOPTLEN - sizeof (struct in_addr)))
+	{
+	  int rc;
+	  char *p;
+
+	  p = strpbrk (gateway, " ,;:");
+	  if (p)
+	    *p++ = '\0';
+
+	  rc = getaddrinfo (gateway, NULL, &hints, &res);
+	  if (rc)
+	    error (EXIT_FAILURE, errno, "gateway `%s' %s",
+		   gateway, gai_strerror(rc));
+
+	  /* Put target into next unused slot.  */
+	  memcpy (optbase + optbase[IPOPT_OLEN],
+		  &((struct sockaddr_in *) res->ai_addr)->sin_addr,
+		  sizeof (struct in_addr));
+
+	  freeaddrinfo (res);
+
+	  /* Option gained in length.  */
+	  optbase[IPOPT_OLEN] += sizeof (struct in_addr);
+
+	  gateway = p;
+	}
+
+      if (gateway && *gateway)
+	error (EXIT_FAILURE, 0, "too many gateways specified");
+
+      /* Append the final destination.  */
+      memcpy (optbase + optbase[IPOPT_OLEN],
+	      &to->sin_addr, sizeof (to->sin_addr));
+      optbase[IPOPT_OLEN] += sizeof (to->sin_addr);
+
+      /* 2. There is an implicit IPOPT_EOL after
+       * IPOPT_LSRR, ensured by the call to memset().
+       * Use it!
+       */
+      len_ip_opts = optbase[IPOPT_OLEN] + 1;
+    }
+#endif /* IP_OPTIONS */
+}

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


commit b1d8390d0a62254943dee1944ba549abba3e376e
Author: Guillem Jover <guillem@hadrons.org>
Date:   Mon Jan 21 16:03:05 2013 +0100

    Cleanup automake variables.

diff --git a/ChangeLog b/ChangeLog
index b0a8bac..4a85108 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2013-01-21  Guillem Jover  <guillem@hadrons.org>
+
+	Cleanup automake variables.
+
+	* ftp/Makefile.am (AM_CPPFLAGS): Consume depreciated
+	macro INCLUDES.
+	* ftpd/Makefile.am, ifconfig/Makefile.am,
+	libinetutils/Makefile.am: Likewise.
+	* libls/Makefile.am (AM_CPPFLAGS): Rename INCLUDES.
+	* libtelnet/Makefile.am: Likewise.
+	* ping/Makefile.am (AM_CPPFLAGS): Likewise.
+	(LDADD): New macro.
+	(ping_LDADD): Simplify using LDADD.
+	(ping6_LDADD): Remove.
+	* src/Makefile.am (AM_CPPFLAGS): Consume INCLUDES.
+	* talkd/Makefile.am, telnet/Makefile.am,
+	telnetd/Makefile.am: Likewise.
+	* talk/Makefile.am (AM_CPPFLAGS): Rename INCLUDES.
+	* whois/Makefile.am: Likewise.
+
 2013-01-21  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* configure.ac (AM_C_PROTOTYPES): Remove obsolete macro.
diff --git a/ftp/Makefile.am b/ftp/Makefile.am
index 0d5ec3f..3d134c7 100644
--- a/ftp/Makefile.am
+++ b/ftp/Makefile.am
@@ -18,6 +18,16 @@
 # 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 = \
+	$(iu_INCLUDES) \
+	$(PATHDEF_TMP) $(PATHDEF_BSHELL)
+
+LDADD = \
+	$(iu_LIBRARIES) \
+	$(LIBGLOB) $(LIBREADLINE) $(LIBTERMCAP) $(LIBHISTORY)
+
 bin_PROGRAMS = $(ftp_BUILD)
 
 EXTRA_PROGRAMS = ftp
@@ -25,10 +35,3 @@ EXTRA_PROGRAMS = ftp
 ftp_SOURCES = cmds.c cmdtab.c domacro.c ftp.c main.c ruserpass.c
 
 noinst_HEADERS = extern.h ftp_var.h
-
-@PATHDEFS_MAKE@
-
-INCLUDES = $(iu_INCLUDES)
-AM_CPPFLAGS = $(PATHDEF_TMP) $(PATHDEF_BSHELL)
-
-LDADD = $(iu_LIBRARIES) $(LIBGLOB) $(LIBREADLINE) $(LIBTERMCAP) $(LIBHISTORY)
diff --git a/ftpd/Makefile.am b/ftpd/Makefile.am
index dd54ba7..a6dc2a3 100644
--- a/ftpd/Makefile.am
+++ b/ftpd/Makefile.am
@@ -18,6 +18,19 @@
 # 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 = \
+	$(iu_INCLUDES) \
+	$(PATHDEF_FTPWELCOME) $(PATHDEF_FTPUSERS) \
+	$(PATHDEF_FTPLOGINMESG) $(PATHDEF_FTPCHROOT) $(PATHDEF_FTPDPID) \
+	$(PATHDEF_DEVNULL) $(PATHDEF_NOLOGIN) $(PATHDEF_BSHELL)
+
+LDADD = \
+	$(LIBLS) \
+	$(iu_LIBRARIES) \
+	$(LIBCRYPT) $(LIBWRAP) $(FTPD_LIBPAM) $(LIBDL)
+
 inetdaemondir = @inetdaemondir@
 
 inetdaemon_PROGRAMS = $(ftpd_BUILD)
@@ -29,13 +42,4 @@ ftpd_SOURCES = ftpcmd.y ftpd.c popen.c pam.c auth.c \
 
 noinst_HEADERS = extern.h
 
-@PATHDEFS_MAKE@
-
-INCLUDES = $(iu_INCLUDES)
-AM_CPPFLAGS = $(PATHDEF_FTPWELCOME) $(PATHDEF_FTPUSERS) \
-           $(PATHDEF_FTPLOGINMESG) $(PATHDEF_FTPCHROOT) $(PATHDEF_FTPDPID) \
-           $(PATHDEF_DEVNULL)  $(PATHDEF_NOLOGIN) $(PATHDEF_BSHELL)
-
-LDADD = $(LIBLS) $(LIBCRYPT) $(LIBWRAP) $(FTPD_LIBPAM) $(LIBDL) $(iu_LIBRARIES)
-
 EXTRA_DIST = ftpcmd.c
diff --git a/ifconfig/Makefile.am b/ifconfig/Makefile.am
index 7cd0e16..89dec27 100644
--- a/ifconfig/Makefile.am
+++ b/ifconfig/Makefile.am
@@ -19,6 +19,15 @@
 
 SUBDIRS = system
 
+@PATHDEFS_MAKE@
+
+AM_CPPFLAGS = \
+	$(iu_INCLUDES) \
+	$(PATHDEF_PROCNET_DEV)
+
+LDADD = \
+	$(iu_LIBRARIES)
+
 bin_PROGRAMS = $(ifconfig_BUILD)
 
 EXTRA_PROGRAMS = ifconfig
@@ -26,8 +35,3 @@ EXTRA_PROGRAMS = ifconfig
 ifconfig_SOURCES = ifconfig.c flags.c changeif.c options.c printif.c system.c
 
 noinst_HEADERS = ifconfig.h flags.h options.h printif.h system.h
-
-@PATHDEFS_MAKE@
-AM_CPPFLAGS = $(PATHDEF_PROCNET_DEV)
-INCLUDES = $(iu_INCLUDES)
-LDADD = $(iu_LIBRARIES)
diff --git a/libinetutils/Makefile.am b/libinetutils/Makefile.am
index 7c599bc..db98f38 100644
--- a/libinetutils/Makefile.am
+++ b/libinetutils/Makefile.am
@@ -18,6 +18,13 @@
 # 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 = \
+	$(iu_INCLUDES) $(INCAUTH) \
+	$(PATHDEF_WTMPX) $(PATHDEF_TTY_PFX) $(PATHDEF_DEVNULL) \
+	$(PATHDEF_HEQUIV)
+
 noinst_LIBRARIES = libinetutils.a
 
 noinst_HEADERS = argcv.h libinetutils.h tftpsubs.h shishi_def.h
@@ -41,9 +48,3 @@ libinetutils_a_SOURCES = \
  ttymsg.c\
  utmp_init.c\
  utmp_logout.c
-
-@PATHDEFS_MAKE@
-
-AM_CPPFLAGS = $(PATHDEF_WTMPX) $(PATHDEF_TTY_PFX) $(PATHDEF_DEVNULL) $(PATHDEF_HEQUIV)
-
-INCLUDES = $(iu_INCLUDES) $(INCAUTH)
diff --git a/libls/Makefile.am b/libls/Makefile.am
index 6dedddb..202596d 100644
--- a/libls/Makefile.am
+++ b/libls/Makefile.am
@@ -17,6 +17,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see `http://www.gnu.org/licenses/'.
 
+AM_CPPFLAGS = \
+	$(iu_INCLUDES)
+
 noinst_LIBRARIES = $(libls_BUILD)
 
 EXTRA_LIBRARIES = libls.a
@@ -24,5 +27,3 @@ EXTRA_LIBRARIES = libls.a
 libls_a_SOURCES = cmp.c stat_flags.c ls.c print.c util.c fts.c
 
 noinst_HEADERS = extern.h ls.h fts.h
-
-INCLUDES = $(iu_INCLUDES)
diff --git a/libtelnet/Makefile.am b/libtelnet/Makefile.am
index 87cb583..ba8b28e 100644
--- a/libtelnet/Makefile.am
+++ b/libtelnet/Makefile.am
@@ -18,10 +18,16 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see `http://www.gnu.org/licenses/'.
 
-INCLUDES = $(iu_INCLUDES) $(INCAUTH)
+AM_CPPFLAGS = \
+	$(INCAUTH) \
+	$(iu_INCLUDES)
 
 noinst_LIBRARIES = libtelnet.a
 
-libtelnet_a_SOURCES = auth.c enc_des.c encrypt.c forward.c genget.c kerberos.c kerberos5.c misc.c read_passwd.c shishi.c
+libtelnet_a_SOURCES = \
+	auth.c enc_des.c encrypt.c forward.c genget.c \
+	kerberos.c kerberos5.c misc.c read_passwd.c shishi.c
 
-noinst_HEADERS = auth-proto.h auth.h enc-proto.h encrypt.h genget.h key-proto.h misc-proto.h misc.h
+noinst_HEADERS = \
+	auth-proto.h auth.h enc-proto.h encrypt.h genget.h key-proto.h \
+	misc-proto.h misc.h
diff --git a/ping/Makefile.am b/ping/Makefile.am
index 0b51189..d8d5fc5 100644
--- a/ping/Makefile.am
+++ b/ping/Makefile.am
@@ -18,13 +18,20 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see `http://www.gnu.org/licenses/'.
 
+AM_CPPFLAGS = \
+	$(iu_INCLUDES) \
+	-I$(top_srcdir)/libicmp \
+	$(INCIDN)
+
+LDADD = \
+	$(iu_LIBRARIES) \
+	$(LIBIDN)
+
 bin_PROGRAMS = $(ping_BUILD) $(ping6_BUILD)
 
 EXTRA_PROGRAMS = ping ping6
 
-ping_LDADD = $(iu_LIBRARIES) $(top_builddir)/libicmp/libicmp.a $(LIBIDN)
-ping6_LDADD = $(iu_LIBRARIES) $(LIBIDN)
-INCLUDES = $(iu_INCLUDES) -I$(top_srcdir)/libicmp $(INCIDN)
+ping_LDADD = $(top_builddir)/libicmp/libicmp.a $(LDADD)
 
 ping_SOURCES = ping.c ping_common.c ping_echo.c ping_address.c \
   ping_router.c ping_timestamp.c ping_common.h  ping_impl.h ping.h libping.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 7242eb4..661612c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,16 +18,30 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see `http://www.gnu.org/licenses/'.
 
-inetdaemondir = @inetdaemondir@
+@PATHDEFS_MAKE@
 
 # Initialise variables.
-LDADD = $(iu_LIBRARIES) $(LIBUTIL)
+AM_CPPFLAGS = \
+	$(iu_INCLUDES) $(INCAUTH) $(INCIDN) \
+	-I$(top_srcdir)/libicmp \
+	$(PATHDEF_BSHELL) $(PATHDEF_CONSOLE) $(PATHDEF_CP) \
+	$(PATHDEF_DEFPATH) $(PATHDEF_DEV) $(PATHDEF_INETDCONF) \
+	$(PATHDEF_INETDDIR) $(PATHDEF_INETDPID) $(PATHDEF_KLOG) \
+	$(PATHDEF_LOG) $(PATHDEF_LOGCONF) \
+	$(PATHDEF_LOGIN) $(PATHDEF_LOGPID) $(PATHDEF_NOLOGIN) \
+	$(PATHDEF_RLOGIN) $(PATHDEF_RSH) $(PATHDEF_TTY) $(PATHDEF_TTY_PFX) \
+	$(PATHDEF_UTMP) $(PATHDEF_UTMPX) $(PATHDEF_UUCICO)
+
+LDADD = \
+	$(iu_LIBRARIES) \
+	$(LIBUTIL)
+
+inetdaemondir = @inetdaemondir@
 
 inetdaemon_PROGRAMS =
 bin_PROGRAMS =
 EXTRA_PROGRAMS =
 
-
 bin_PROGRAMS += $(hostname_BUILD)
 hostname_SOURCES = hostname.c
 EXTRA_PROGRAMS += hostname
@@ -100,10 +114,6 @@ uucpd_SOURCES = uucpd.c
 uucpd_LDADD = $(LDADD) $(LIBCRYPT)
 EXTRA_PROGRAMS += uucpd
 
-INCLUDES = $(iu_INCLUDES) $(INCAUTH) -I$(top_srcdir)/libicmp $(INCIDN)
-
-AM_CPPFLAGS = $(PATHDEF_BSHELL) $(PATHDEF_CONSOLE) $(PATHDEF_CP) $(PATHDEF_DEFPATH) $(PATHDEF_DEV) $(PATHDEF_INETDCONF) $(PATHDEF_INETDDIR) $(PATHDEF_INETDPID) $(PATHDEF_KLOG) $(PATHDEF_LOG) $(PATHDEF_LOGCONF) $(PATHDEF_LOGIN) $(PATHDEF_LOGPID) $(PATHDEF_NOLOGIN) $(PATHDEF_RLOGIN) $(PATHDEF_RSH) $(PATHDEF_TTY) $(PATHDEF_TTY_PFX) $(PATHDEF_UTMP) $(PATHDEF_UTMPX) $(PATHDEF_UUCICO)
-
 SUIDMODE = -o root -m 4775
 
 install-exec-hook: $(traceroute_INSTALL_HOOK) $(rsh_INSTALL_HOOK) $(rlogin_INSTALL_HOOK) $(rcp_INSTALL_HOOK)
@@ -135,5 +145,3 @@ install-rcp-hook:
 	  echo "WARNING: insufficient access; not installing rcp"; \
 	  echo "NOTE: To install rcp run 'make install' as root"; \
 	fi
-
-@PATHDEFS_MAKE@
diff --git a/talk/Makefile.am b/talk/Makefile.am
index 77e25e6..ce0f99b 100644
--- a/talk/Makefile.am
+++ b/talk/Makefile.am
@@ -18,6 +18,14 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see `http://www.gnu.org/licenses/'.
 
+AM_CPPFLAGS = \
+	$(iu_INCLUDES) \
+	$(NCURSES_INCLUDE)
+
+LDADD = \
+	$(iu_LIBRARIES) \
+	$(LIBCURSES)
+
 bin_PROGRAMS = $(talk_BUILD)
 
 EXTRA_PROGRAMS = talk
@@ -25,7 +33,3 @@ EXTRA_PROGRAMS = talk
 talk_SOURCES = ctl.c ctl_transact.c display.c get_addrs.c get_names.c init_disp.c invite.c io.c look_up.c msgs.c talk.c
 
 noinst_HEADERS = talk.h talk_ctl.h
-
-INCLUDES = $(iu_INCLUDES) $(NCURSES_INCLUDE)
-
-LDADD = $(iu_LIBRARIES) $(LIBCURSES)
diff --git a/talkd/Makefile.am b/talkd/Makefile.am
index f654a05..e31fbb0 100644
--- a/talkd/Makefile.am
+++ b/talkd/Makefile.am
@@ -18,6 +18,15 @@
 # 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 = \
+	$(iu_INCLUDES) \
+	$(PATHDEF_DEV) \
+	$(PATHDEF_TTY_PFX) $(PATHDEF_UTMP) $(PATHDEF_UTMPX)
+
+LDADD = $(iu_LIBRARIES)
+
 inetdaemondir = @inetdaemondir@
 
 inetdaemon_PROGRAMS = $(talkd_BUILD)
@@ -32,9 +41,3 @@ talkd_SOURCES = \
  table.c\
  talkd.c\
  intalkd.h
-
-@PATHDEFS_MAKE@
-
-AM_CPPFLAGS = $(PATHDEF_DEV) $(PATHDEF_TTY_PFX) $(PATHDEF_UTMP) $(PATHDEF_UTMPX)
-INCLUDES = $(iu_INCLUDES)
-LDADD = $(iu_LIBRARIES)
diff --git a/telnet/Makefile.am b/telnet/Makefile.am
index a18f9a0..29b3bcb 100644
--- a/telnet/Makefile.am
+++ b/telnet/Makefile.am
@@ -18,6 +18,17 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see `http://www.gnu.org/licenses/'.
 
+AM_CPPFLAGS = \
+	-DTERMCAP -DLINEMODE -DKLUDGELINEMODE -DENV_HACK \
+	$(iu_INCLUDES) \
+	-I$(top_srcdir) \
+	$(NCURSES_INCLUDE)
+
+LDADD = \
+	$(top_builddir)/libtelnet/libtelnet.a \
+	$(iu_LIBRARIES) \
+	$(LIBTERMCAP) $(LIBCRYPT) $(LIBAUTH)
+
 bin_PROGRAMS = $(telnet_BUILD)
 
 EXTRA_PROGRAMS = telnet
@@ -26,8 +37,3 @@ telnet_SOURCES = authenc.c commands.c main.c network.c ring.c sys_bsd.c \
 	telnet.c terminal.c tn3270.c utilities.c
 
 noinst_HEADERS = defines.h externs.h general.h ring.h types.h
-
-INCLUDES = $(iu_INCLUDES) -I$(top_srcdir) $(NCURSES_INCLUDE)
-AM_CPPFLAGS = -DTERMCAP -DLINEMODE -DKLUDGELINEMODE -DENV_HACK
-
-LDADD = $(iu_LIBRARIES) $(top_builddir)/libtelnet/libtelnet.a $(LIBTERMCAP) $(LIBCRYPT) $(LIBAUTH)
diff --git a/telnetd/Makefile.am b/telnetd/Makefile.am
index e18943a..4c4ec90 100644
--- a/telnetd/Makefile.am
+++ b/telnetd/Makefile.am
@@ -18,6 +18,19 @@
 # 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 = \
+	$(iu_INCLUDES) \
+	-I$(top_srcdir) \
+	$(INCAUTH) $(NCURSES_INCLUDE) \
+	$(PATHDEF_DEV) $(PATHDEF_TTY) $(PATHDEF_TTY_PFX) $(PATHDEF_LOGIN)
+
+LDADD = \
+	$(top_builddir)/libtelnet/libtelnet.a \
+	$(iu_LIBRARIES) \
+	$(LIBTERMCAP) $(LIBUTIL) $(LIBCRYPT) $(LIBAUTH)
+
 inetdaemondir = @inetdaemondir@
 
 inetdaemon_PROGRAMS = $(telnetd_BUILD)
@@ -25,11 +38,5 @@ inetdaemon_PROGRAMS = $(telnetd_BUILD)
 EXTRA_PROGRAMS = telnetd
 
 telnetd_SOURCES = telnetd.c pty.c term.c utility.c state.c termstat.c slc.c
-noinst_HEADERS = telnetd.h
 
-@PATHDEFS_MAKE@
-
-AM_CPPFLAGS = $(PATHDEF_DEV) $(PATHDEF_TTY) $(PATHDEF_TTY_PFX) $(PATHDEF_LOGIN)
-INCLUDES = $(iu_INCLUDES) -I$(top_srcdir) $(INCAUTH) $(NCURSES_INCLUDE)
-
-LDADD = $(iu_LIBRARIES) $(top_builddir)/libtelnet/libtelnet.a $(LIBTERMCAP) $(LIBUTIL) $(LIBCRYPT) $(LIBAUTH)
+noinst_HEADERS = telnetd.h
diff --git a/whois/Makefile.am b/whois/Makefile.am
index 5d59cf7..f554a21 100644
--- a/whois/Makefile.am
+++ b/whois/Makefile.am
@@ -17,6 +17,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see `http://www.gnu.org/licenses/'.
 
+AM_CPPFLAGS = $(iu_INCLUDES)
+
+LDADD = $(iu_LIBRARIES)
+
 bin_PROGRAMS = $(whois_BUILD)
 
 EXTRA_PROGRAMS = whois
@@ -28,10 +32,8 @@ EXTRA_DIST = as_del_list ip_del_list tld_serv_list \
   as_del.h ip_del.h tld_serv.h
 
 noinst_HEADERS = data.h as_del.h ip_del.h tld_serv.h whois.h
-BUILT_SOURCES = as_del.h ip_del.h tld_serv.h
 
-INCLUDES = $(iu_INCLUDES)
-LDADD = $(iu_LIBRARIES)
+BUILT_SOURCES = as_del.h ip_del.h tld_serv.h
 
 as_del.h: $(srcdir)/as_del_list $(srcdir)/make_as_del.pl
 	LANG=C perl $(srcdir)/make_as_del.pl < $(srcdir)/as_del_list > as_del.h

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


commit 9f586013083f6741fe4b164ea82fc7b658d1cf66
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Mon Jan 21 14:37:52 2013 +0100

    Support recent automake.

diff --git a/ChangeLog b/ChangeLog
index da35d5c..b0a8bac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-21  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* configure.ac (AM_C_PROTOTYPES): Remove obsolete macro.
+	Not supported by automake-1.13.
+
 2013-01-17  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ping6: Setting of tclass and flowinfo.
diff --git a/configure.ac b/configure.ac
index e793c00..28b733b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -718,8 +718,6 @@ IU_CHECK_MEMBERS([struct tftphdr.th_u], , ,
 		  #include <arpa/tftp.h>])
 
 ### Checks for compiler characteristics.
-AM_C_PROTOTYPES # FIXME: Does inetutils even compile on pre-ANSI
-		# compilers?
 AC_C_CONST
 
 # See if `weak refs' are possible; these make it possible (with shared

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

Summary of changes:
 ChangeLog                |   46 ++++++++++++++++++
 NEWS                     |    4 +-
 configure.ac             |    2 -
 doc/inetutils.texi       |   20 ++++++++
 ftp/Makefile.am          |   17 ++++---
 ftpd/Makefile.am         |   22 +++++----
 ifconfig/Makefile.am     |   14 ++++--
 libinetutils/Makefile.am |   13 +++--
 libls/Makefile.am        |    5 +-
 libtelnet/Makefile.am    |   12 ++++-
 ping/Makefile.am         |   13 ++++-
 src/Makefile.am          |   26 +++++++----
 src/traceroute.c         |  117 +++++++++++++++++++++++++++++++++++++++++++++-
 talk/Makefile.am         |   12 +++--
 talkd/Makefile.am        |   15 ++++--
 telnet/Makefile.am       |   16 ++++--
 telnetd/Makefile.am      |   21 ++++++---
 whois/Makefile.am        |    8 ++-
 18 files changed, 309 insertions(+), 74 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Jan 24 11:21:23 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TyPYJ-00026r-OA
	for mharc-commit-inetutils@gnu.org; Thu, 24 Jan 2013 11:21:23 -0500
Received: from eggs.gnu.org ([208.118.235.92]:58973)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TyPYA-0001jy-MZ
	for commit-inetutils@gnu.org; Thu, 24 Jan 2013 11:21:21 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TyPY1-0002Ht-Pl
	for commit-inetutils@gnu.org; Thu, 24 Jan 2013 11:21:13 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:50646)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TyPY1-0002Hn-IN
	for commit-inetutils@gnu.org; Thu, 24 Jan 2013 11:21:05 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TyPY0-0005Gy-VA
	for commit-inetutils@gnu.org; Thu, 24 Jan 2013 16:21:05 +0000
Date: Thu, 24 Jan 2013 16:21:04 +0000
Message-Id: <E1TyPY0-0005Gy-VA@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-242-g4fec11f
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 03bfa11f0e61d5babc11df6ea2dfa92a0644ec47
X-Git-Newrev: 4fec11f030399252802112f1b983cc5596e406d4
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, 24 Jan 2013 16:21:21 -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  4fec11f030399252802112f1b983cc5596e406d4 (commit)
      from  03bfa11f0e61d5babc11df6ea2dfa92a0644ec47 (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=4fec11f030399252802112f1b983cc5596e406d4


commit 4fec11f030399252802112f1b983cc5596e406d4
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Jan 24 17:20:04 2013 +0100

    Documentation (silent change).

diff --git a/NEWS b/NEWS
index 06a7780..abb4c76 100644
--- a/NEWS
+++ b/NEWS
@@ -76,6 +76,11 @@ Now has support for IPv6, PAM, and Shishi.  New switches
 `-k/--kerberos', `-S/--server-principal', `-v/--vacuous',
 and `-x/--encrypt'.
 
+* talkd
+
+Has seen reworked ACL-mechanisms, believed to be functional!
+New switches `-l/--logging', and `-S/--strict-policy'.
+
 * telnetd
 
 New switch `-S/--server-principal'.
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index aceb33f..6cd0731 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -2556,23 +2556,32 @@ Specify the user with whom to log into the server.
 @command{talk} is a visual communication program which copies lines
 from your terminal to that of another user.
 
+@noindent
+Synopsis:
+
+@example
+talk @var{person} [@var{ttyname}]
+@end example
+
 @section Invoking
 
 The command line arguments are as follows:
 
 @table @var
 @item person
-If you wish to talk to someone on your own machine, then person is
-just the person's login name.  If you wish to talk to a user on
-another host, then person is of the form @samp{user@@host}.
+If you wish to talk to someone on your own machine, then @var{person}
+is just the other person's login name.
+If you wish to talk to a user on another host,
+then @var{person} is of the form @samp{user@@host}.
 
 @item ttyname
-If you wish to talk to a user who is logged in more than once, the
-@var{ttyname} argument may be used to indicate the appropriate
+If you wish to talk to a local user who is logged in more than once,
+the argument @var{ttyname} may be used to indicate the appropriate
 terminal name, where @var{ttyname} is of the form @samp{ttyXX}.
 @end table
 
-When first called, talk sends the message:
+When first called, @command{talk} sends a message to
+the addressed user:
 
 @example
 Message from TalkDaemon@@his_machine@dots{}
@@ -2580,8 +2589,9 @@ talk: connection requested by your_name@@your_machine.
 talk: respond with: talk your_name@@your_machine
 @end example
 
-to the user you wish to talk to.  At this point, the recipient of the
-message should reply by typing:
+@noindent
+At this point, the recipient of the message could elect
+to accept the call and to establish a connection by typing:
 
 @example
 talk @var{your_name}@@@var{your_machine}
@@ -2591,19 +2601,16 @@ It doesn't matter from which machine the recipient replies, as long as
 his login-name is the same.  Once communication is established, the
 two parties may type simultaneously, with their output appearing in
 separate windows.  Typing @kbd{C-L} will cause the screen to be
-reprinted, while your erase, kill, and word kill characters will
-behave normally.  To exit, just type your interrupt character; talk
-then moves the cursor to the bottom of the screen and restores the
-terminal to its previous state.
+reprinted, while erase, kill, and word kill characters will
+behave normally.  To exit, just type an interrupt character;
+@command{talk} then moves the cursor to the bottom of the screen
+and restores the terminal to its previous state.
 
-Permission to talk may be denied or granted by use of the
-@command{mesg} command.  At the outset talking is allowed.  Certain
-commands, in particular @command{nroff} and @command{pr}, disallow
-messages in order to prevent messy output.
-
-To exit, just type your interrupt character; talk then moves the
-cursor to the bottom of the screen and restores the terminal to its
-previous state.
+The ability to talk may be enabled or disabled by use of the
+@command{mesg} command.  It is system dependent whether
+this message passing is enabled at the outset of a terminal session.
+Certain commands, in particular @command{nroff} and @command{pr},
+disable messages in order to prevent messy output.
 
 @node telnet invocation
 @chapter @command{telnet}: User interface to TELNET
@@ -2613,7 +2620,7 @@ Login to a remote system HOST, optionally using a (non-standard)
 service port PORT.
 
 @noindent
-Synpsis:
+Synopsis:
 
 @example
 telnet [@var{OPTION}...] [@var{HOST} [@var{PORT}]]
@@ -4315,15 +4322,30 @@ probe a system for users with null passwords.
 @chapter @command{talkd}: a server for communication between users
 @cindex talkd
 
-@command{talkd} is the server that notifies a user that someone else
+@command{talkd} is a server that notifies users that someone else
 wants to initiate a conversation.  It acts as a repository of
 invitations, responding to requests by clients wishing to rendezvous
-in order to hold a conversation.
+for a conversation.
+
+This implementation uses the newer protocol @samp{ntalk/udp},
+and is intended to be invoked by a super-server
+@command{inetd} at that datagram port.
+Bear in mind that this service is usable with IPv4 only,
+since the exchange protocol was conceived to handle only
+one address family.
+This fact is independent of @command{inetd}.
+
+Observe that the server @command{talkd} is dependent
+on the name claimed by @command{hostname}, for establishing
+connections between interested parties.  Multi-homed hosts
+are not well behaved together with @command{talkd}.
+
+The present implementation offers ACL-mechanisms for fine
+grained access control.
 
 @section Invoking
-This implementation uses the newer protocol specification @samp{ntalk},
-and is intended to be invoked by a super-server @command{inetd} at that
-datagram port.  The following switches and options are available.
+
+The following switches and options are available.
 
 @table @option
 @item -a @var{file}

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

Summary of changes:
 NEWS               |    5 +++
 doc/inetutils.texi |   74 +++++++++++++++++++++++++++++++++------------------
 2 files changed, 53 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Jan 25 11:15:21 2013
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Tylw1-0005Hj-NM
	for mharc-commit-inetutils@gnu.org; Fri, 25 Jan 2013 11:15:21 -0500
Received: from eggs.gnu.org ([208.118.235.92]:33483)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Tylvx-0005Ee-KW
	for commit-inetutils@gnu.org; Fri, 25 Jan 2013 11:15:20 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Tylvq-0000aM-6U
	for commit-inetutils@gnu.org; Fri, 25 Jan 2013 11:15:17 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:52281)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Tylvq-0000ZL-3t
	for commit-inetutils@gnu.org; Fri, 25 Jan 2013 11:15:10 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1Tylvm-0001xR-C2
	for commit-inetutils@gnu.org; Fri, 25 Jan 2013 16:15:08 +0000
Date: Fri, 25 Jan 2013 16:15:08 +0000
Message-Id: <E1Tylvm-0001xR-C2@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-243-g895a737
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 4fec11f030399252802112f1b983cc5596e406d4
X-Git-Newrev: 895a737b75e0e43d0cfe64533b5884855f965d5d
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, 25 Jan 2013 16:15:20 -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  895a737b75e0e43d0cfe64533b5884855f965d5d (commit)
      from  4fec11f030399252802112f1b983cc5596e406d4 (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=895a737b75e0e43d0cfe64533b5884855f965d5d


commit 895a737b75e0e43d0cfe64533b5884855f965d5d
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Jan 25 15:06:51 2013 +0100

    libls: Use __opendir2 if present.

diff --git a/ChangeLog b/ChangeLog
index 2dca504..6fbfe0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2013-01-25  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	libls: Use __opendir2() if present.
+
+	* configure.ac: Check for __opendir2, not opendir2.
+
+	* libls/fts.c (fts_build) [HAVE___OPENDIR2]:
+	Change conditional test for declaration of OFLAG.
+	Initialise OFLAG only with DTF_NODUP, and add
+	DTF_REWIND and DTF_HIDEW conditionally.
+	Remove macro opendir2.  Assign DIRP from either
+	__opendir2() or opendir().  Then test DIRP.
+
 2013-01-22  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	traceroute: Loose source routing.
diff --git a/configure.ac b/configure.ac
index 28b733b..176bc93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -743,7 +743,7 @@ AC_CHECK_FUNCS(cfsetspeed cgetent dirfd fchdir flock \
                setsid setregid setreuid setresgid setresuid setutent_r \
                sigaction sigvec strchr setproctitle tcgetattr tzset utimes \
                utime uname \
-               updwtmp updwtmpx vhangup wait3 wait4 opendir2 \
+               updwtmp updwtmpx vhangup wait3 wait4 __opendir2 \
 	       __rcmd_errstr __check_rhosts_file )
 
 # Variant functions for user accounting.
diff --git a/libls/fts.c b/libls/fts.c
index 35d0de4..97447fd 100644
--- a/libls/fts.c
+++ b/libls/fts.c
@@ -619,7 +619,7 @@ fts_build (register FTS *sp, int type)
   void *adjaddr;
   int cderrno, descend, len, level, maxlen, nlinks, saved_errno;
   char *cp = NULL;
-#ifdef DTF_HIDEW
+#ifdef HAVE___OPENDIR2
   int oflag;
 #endif
 
@@ -630,15 +630,24 @@ fts_build (register FTS *sp, int type)
    * Open the directory for reading.  If this fails, we're done.
    * If being called from fts_read, set the fts_info field.
    */
-#if defined HAVE_OPENDIR2 && defined DTF_HIDEW
-  if (ISSET (FTS_WHITEOUT))
-    oflag = DTF_NODUP | DTF_REWIND;
-  else
-    oflag = DTF_HIDEW | DTF_NODUP | DTF_REWIND;
-#else
-# define opendir2(path, flag) opendir(path)
-#endif
-  if ((dirp = opendir2 (cur->fts_accpath, oflag)) == NULL)
+#if defined HAVE___OPENDIR2
+  oflag = DTF_NODUP;
+
+# ifdef DTF_REWIND
+  oflag |= DTF_REWIND;
+# endif
+
+# ifdef DTF_HIDEW
+  if (!ISSET (FTS_WHITEOUT))
+    oflag |= DTF_HIDEW;
+# endif /* DTF_HIDEW */
+
+  dirp = __opendir2 (cur->fts_accpath, oflag);
+#else /* !HAVE___OPENDIR2 */
+  dirp = opendir (cur->fts_accpath);
+#endif /* !HAVE___OPENDIR2 */
+
+  if (dirp == NULL)
     {
       if (type == BREAD)
 	{

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

Summary of changes:
 ChangeLog    |   13 +++++++++++++
 configure.ac |    2 +-
 libls/fts.c  |   29 +++++++++++++++++++----------
 3 files changed, 33 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


