From MAILER-DAEMON Wed Aug 01 09:51:47 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SwZL1-0005mR-EL
	for mharc-commit-inetutils@gnu.org; Wed, 01 Aug 2012 09:51:47 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60261)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SwZKs-0005Q4-KM
	for commit-inetutils@gnu.org; Wed, 01 Aug 2012 09:51:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SwZKk-0000d2-60
	for commit-inetutils@gnu.org; Wed, 01 Aug 2012 09:51:38 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:51109)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SwZKk-0000cy-1N
	for commit-inetutils@gnu.org; Wed, 01 Aug 2012 09:51:30 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1SwZKZ-000796-Mq
	for commit-inetutils@gnu.org; Wed, 01 Aug 2012 13:51:25 +0000
Date: Wed, 01 Aug 2012 13:51:23 +0000
Message-Id: <E1SwZKZ-000796-Mq@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-140-geb139e0
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 4689d41a2a7b7f60aec12e60189ae467169c2bc3
X-Git-Newrev: eb139e0534d61c51226ddd6c436c655f94532b1e
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 01 Aug 2012 13:51:46 -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  eb139e0534d61c51226ddd6c436c655f94532b1e (commit)
       via  5d9c59cbcd0c9967986e1a14907ea1d87e8a5d9c (commit)
      from  4689d41a2a7b7f60aec12e60189ae467169c2bc3 (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=eb139e0534d61c51226ddd6c436c655f94532b1e


commit eb139e0534d61c51226ddd6c436c655f94532b1e
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Aug 1 15:16:47 2012 +0200

    Reworked support for utmpx/utmp.

diff --git a/ChangeLog b/ChangeLog
index 6a409fa..85c70d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,63 @@
+2012-08-01  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	Better adaptions to different UTMP implementations.
+	FreeBSD 9.0 has left most traditions behind.
+
+	* configure.ac: Check for login, loginx, logoutx, logwtmp,
+	and logwtmpx conditioned on libutil.  Ensure `LIBUTIL=-lutil'
+	in cases where `$ac_cv_func_login_tty = yes' or
+	`$ac_cv_have_decl_openpty = yes'.  Check for more fields in
+	`struct utmp': ut_line, ut_session, ut_time, ut_addr_v6,
+	and ut_name.  Check for `struct lastlogx' and field ll_ss.
+	Add checks of `struct utmpx' for fields ut_user, ut_name,
+	ut_id, ut_line, ut_pid, ut_type, ut_exit, ut_tv, ut_session,
+	ut_syslen, ut_host, ut_ss, ut_addr_v6.  Check for pututline
+	and pututxline.
+	(UTMPX): Removed macro.
+
+	* libinetutils/libinetutils.h (utmp_init): Update.
+	* libinetutils/cleansess.c [HAVE_LOGOUT && HAVE_LOGWTMP]:
+	Make the source build conditionally.
+	* libinetutils/logwtmp.c: Prefer utmpx code if available.
+	Conditionally use fields in `struct utmpx' or `struct utmp'.
+	* libinetutils/logwtmpko.c (logwtmp)
+	[HAVE_UPDWTMPX && !HAVE_LOGWTMP]: New condition on build,
+	and migration to `struct utmpx'.
+	* libinetutils/utmp_init.c: Add parameter `char *host'.
+	Guard structure fields with conditionals.  Distinguish
+	access methods on HAVE_PUTUTXLINE, HAVE_LOGINX, and
+	HAVE_UPDWTMPX, HAVE_LOGWTMPX.  Similarly, test
+	HAVE_PUTUTLINE, HAVE_LOGIN, HAVE_UPDWTMP, and HAVE_LOGWTMP.
+	New calls to setutxent() or setutent().
+	* libinetutils/utmp_logout.c: Essentially likewise.  Erase the
+	fields ut_exit, ut_user, ut_name, and ut_host.
+	[HAVE_LOGOUTX]: Protect call to logoutx()/logwtmpx().
+	[HAVE_LOGOUT]: Likewise for logout()/logwtmp().
+
+	* libls/print.c: Do not include <utmp.h>.
+
+	* src/rlogind.c: Remove conditional on UTMPX and local
+	prototypes for utmp_ptsid() and utmp_init().  Always use
+	setup_utmp()
+	(setup_utmp): New argument `host'.
+	[!HAVE_LOGOUT && !HAVE_LOGWTMP]: Call utmp_logout().
+
+	* src/uucpd.c [HAVE_UTMPX_H]: Include <utmpx.h>.
+	(dologout) [HAVE_LOGWTMPX]: Call logwtmpx().
+	[HAVE_LOGWTMP && !HAVE_LOGWTMP]: Call logwtmp().
+	[HAVE_PUTUTXLINE && !HAVE_LOGWTMPX && !HAVE_LOGWTMP]:
+	Manual setup for recent FreeBSD.
+	(dologin): Likewise.
+
+	* telnetd/pty.c: Always use setup_utmp().
+	(setup_utmp): New argument `host'.
+
+	FreeBSD 9.0 uses new paths.
+
+	* paths (PATH_UTMPX): Add `/var/run/utx.active'.
+	(PATH_WTMPX): Add `/var/run/utx.log'.
+	(PATH_LASTLOG): Add `/var/run/utx.lastlogin'.
+
 2012-07-29  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	Out-of-tree build with libshishi.
diff --git a/configure.ac b/configure.ac
index ca9f267..0c41949 100644
--- a/configure.ac
+++ b/configure.ac
@@ -170,9 +170,25 @@ AC_SUBST(LIBCRYPT)
 # libutil is a 4.4BSD library that defines several functions handy for
 # inetutils daemons, doing such things as utmp frobbing, and pty
 # setup.
+AC_CHECK_LIB(util, login, LIBUTIL=-lutil)
+AC_CHECK_LIB(util, loginx, LIBUTIL=-lutil)
 AC_CHECK_LIB(util, logout, LIBUTIL=-lutil)
+AC_CHECK_LIB(util, logoutx, LIBUTIL=-lutil)
+AC_CHECK_LIB(util, logwtmp, LIBUTIL=-lutil)
+AC_CHECK_LIB(util, logwtmpx, LIBUTIL=-lutil)
 AC_SUBST(LIBUTIL)
 
+# FreeBSD 9.0 has changed access to wtmp system, abolishing
+# logout(), logwtmp(), etcetera.  We need to use LIBUTIL
+# for rpl_openpty() and forkpty() in libgnu.a.
+if test "$ac_cv_func_login_tty" = yes \
+   || test "$ac_cv_have_decl_openpty" = yes; then
+  # Make sure that linking contains `-lutil'.
+  if test -z "$LIBUTIL"; then
+    LIBUTIL=-lutil
+  fi
+fi
+
 # Check if they want support for PAM.  Certain daemons like ftpd have
 # support for it.
 
@@ -516,8 +532,8 @@ fi
 # support for it.
 
 if test "$with_wrap" = yes; then
-# See if we have libwrap.a we cannot use AC_CHECK_LIB reliably since
-# for the wrap lib you have to define some global variables
+# See if we have libwrap.a.  We cannot use AC_CHECK_LIB reliably since
+# for the wrap lib you have to define some global variables.
 #AC_CHECK_LIB(wrap, hosts_ctl, LIBWRAP=-lwrap)
   AC_CHECK_HEADERS([tcpd.h])
   AC_MSG_CHECKING(hosts_ctl in -lwrap);
@@ -603,18 +619,33 @@ AC_CHECK_TYPE(sig_atomic_t, , AC_DEFINE([sig_atomic_t], int, [FIXME]),
 IU_CHECK_MEMBERS([struct sockaddr_in.sin_len], , ,
     [ #include <sys/types.h>
       #include <netinet/in.h> ])
+IU_CHECK_MEMBERS([struct sockaddr_storage.ss_len], , ,
+    [ #include <sys/types.h>
+      #include <netinet/in.h> ])
 
 if test "$ac_cv_header_utmp_h" = yes; then
   AC_CHECK_TYPES(struct lastlog, , , [#include <utmp.h>])
   IU_CHECK_MEMBERS([struct utmp.ut_type, struct utmp.ut_pid,
-                    struct utmp.ut_id, struct utmp.ut_user,
-		    struct utmp.ut_host, struct utmp.ut_tv,
-		    struct utmp.ut_exit], , ,
+		    struct utmp.ut_line, struct utmp.ut_id,
+		    struct utmp.ut_user, struct utmp.ut_host,
+		    struct utmp.ut_exit, struct utmp.ut_session,
+		    struct utmp.ut_tv, struct utmp.ut_time,
+		    struct utmp.ut_addr_v6, struct utmp.ut_name], , ,
 		   [#include <sys/types.h>
 		    #include <utmp.h>])
 fi
 if test "$ac_cv_header_utmpx_h" = yes; then
-  IU_CHECK_MEMBERS([struct utmpx.ut_tv], , , [#include <utmpx.h>])
+  AC_CHECK_TYPES(struct lastlogx, , , [#include <utmp.h>])
+  IU_CHECK_MEMBERS([struct lastlogx.ll_ss], , ,
+		   [#include <sys/types.h>
+		    #include <sys/utmpx.h>])
+  IU_CHECK_MEMBERS([struct utmpx.ut_user, struct utmpx.ut_name,
+		    struct utmpx.ut_id, struct utmpx.ut_line,
+		    struct utmpx.ut_pid, struct utmpx.ut_type,
+		    struct utmpx.ut_exit, struct utmpx.ut_tv,
+		    struct utmpx.ut_session, struct utmpx.ut_syslen,
+		    struct utmpx.ut_host, struct utmpx.ut_ss,
+		    struct utmpx.ut_aadr_v6], , , [#include <utmpx.h>])
 fi
 
 IU_CHECK_MEMBERS([struct ifreq.ifr_index,
@@ -663,7 +694,7 @@ AC_CHECK_FUNCS(cfsetspeed cgetent dirfd fchdir flock \
                fork fpathconf ftruncate \
                getcwd getmsg getpwuid_r getspnam \
                initgroups initsetproctitle killpg \
-               ptsname \
+               ptsname pututline pututxline \
                setegid seteuid setpgid \
                setsid setregid setreuid setresgid setresuid setutent_r \
                sigaction sigvec strchr setproctitle tcgetattr tzset utimes \
@@ -671,6 +702,13 @@ AC_CHECK_FUNCS(cfsetspeed cgetent dirfd fchdir flock \
                updwtmp updwtmpx vhangup wait3 wait4 opendir2 \
 	       __rcmd_errstr __check_rhosts_file )
 
+# Variant functions for user accounting.
+# These need $LIBUTIL for linking.
+_SAVE_LIBS="$LIBS"
+LIBS="$LIBS $LIBUTIL"
+AC_CHECK_FUNCS(login loginx logout logoutx logwtmp logwtmpx)
+LIBS="$_SAVE_LIBS"
+
 # Functions that we will define if necessary.
 AC_REPLACE_FUNCS(getpass getusershell memcmp memcpy memmove memset \
 		 strdup poll)
@@ -869,16 +907,15 @@ AH_BOTTOM(
 
 # Ok this is the end of the rope, even autoconf can't help.  For
 # example on certain system login(1) will not work if we don't have an
-# entry in utmpx.  Also for some OS they are better handle with
+# entry in utmpx.  Also for some OS they are better handled with
 # STREAMS.
 case "$host" in
 *olaris*)
   AC_DEFINE([SOLARIS], 1, [FIXME])
-  AC_DEFINE([UTMPX], 1, [FIXME])
   AC_DEFINE([HAVE_STREAMSPTY], 1, [FIXME])
   ;;
-*irix* | *hpux* | *netbsd* | *dragonfly* )
-  AC_DEFINE([UTMPX], 1, [FIXME])
+*irix* | *hpux* )
+  # Known and needed workarounds?
   ;;
 esac
 
diff --git a/libinetutils/cleansess.c b/libinetutils/cleansess.c
index 6efff70..5fa811d 100644
--- a/libinetutils/cleansess.c
+++ b/libinetutils/cleansess.c
@@ -41,6 +41,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#if defined HAVE_LOGOUT && HAVE_LOGWTMP
+
 /* Update umtp & wtmp as necessary, and change tty & pty permissions back to
    what they should be.  */
 void
@@ -48,11 +50,11 @@ cleanup_session (char *tty, int pty_fd)
 {
   char *line;
 
-#ifdef PATH_TTY_PFX
+# ifdef PATH_TTY_PFX
   if (strncmp (tty, PATH_TTY_PFX, sizeof PATH_TTY_PFX - 1) == 0)
     line = tty + sizeof PATH_TTY_PFX - 1;
   else
-#endif
+# endif /* PATH_TTY_PFX */
     line = tty;
 
   if (logout (line))
@@ -63,3 +65,4 @@ cleanup_session (char *tty, int pty_fd)
   fchmod (pty_fd, 0666);
   fchown (pty_fd, 0, 0);
 }
+#endif /* HAVE_LOGOUT && HAVE_LOGWTMP */
diff --git a/libinetutils/libinetutils.h b/libinetutils/libinetutils.h
index 7329eba..9286383 100644
--- a/libinetutils/libinetutils.h
+++ b/libinetutils/libinetutils.h
@@ -23,7 +23,7 @@
 
 #include "argp-version-etc.h"
 
-void utmp_init (char *line, char *user, char *id);
+void utmp_init (char *line, char *user, char *id, char *host);
 char *utmp_ptsid (char *line, char *tag);
 void utmp_logout (char *line);
 char *localhost (void);
diff --git a/libinetutils/logwtmp.c b/libinetutils/logwtmp.c
index 84dc3dc..4f676f9 100644
--- a/libinetutils/logwtmp.c
+++ b/libinetutils/logwtmp.c
@@ -34,13 +34,14 @@
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <errno.h>
-#ifdef HAVE_UTMP_H
-# include <utmp.h>
-#else
-# ifdef  HAVE_UTMPX_H
-#  include <utmpx.h>
-#  define utmp utmpx		/* make utmpx look more like utmp */
+#ifdef HAVE_UTMPX_H
+# ifndef __USE_GNU
+#  define __USE_GNU 1
 # endif
+# include <utmpx.h>
+#elif defined HAVE_UTMP_H
+# include <utmp.h>
+# define PATH_WTMPX PATH_WTMP	/* Simplifies file referencing.  */
 #endif
 #include <string.h>
 
@@ -48,16 +49,21 @@
 extern int errno;
 #endif
 
+#ifdef HAVE_UTMPX_H
+static void
+_logwtmp (struct utmpx *ut)
+#else /* !HAVE_UTMPX_H */
 static void
 _logwtmp (struct utmp *ut)
+#endif /* !HAVE_UTMP_H */
 {
 #ifdef KEEP_OPEN
   static int fd = -1;
 
   if (fd < 0)
-    fd = open (PATH_WTMP, O_WRONLY | O_APPEND, 0);
+    fd = open (PATH_WTMPX, O_WRONLY | O_APPEND, 0);
 #else
-  int fd = open (PATH_WTMP, O_WRONLY | O_APPEND, 0);
+  int fd = open (PATH_WTMPX, O_WRONLY | O_APPEND, 0);
 #endif
 
   if (fd >= 0)
@@ -97,23 +103,43 @@ logwtmp_keep_open (char *line, char *name, char *host)
 logwtmp (char *line, char *name, char *host)
 #endif
 {
+#ifdef HAVE_UTMPX_H
+  struct utmpx ut;
+  struct timeval tv;
+#else /* !HAVE_UTMPX_H */
   struct utmp ut;
-#ifdef HAVE_STRUCT_UTMP_UT_TV
+# ifdef HAVE_STRUCT_UTMP_UT_TV
   struct timeval tv;
+# endif
 #endif
 
   /* Set information in new entry.  */
   memset (&ut, 0, sizeof (ut));
-#ifdef HAVE_STRUCT_UTMP_UT_TYPE
-  ut.ut_type = USER_PROCESS;
-#endif
+#if defined HAVE_STRUCT_UTMP_UT_TYPE || defined HAVE_STRUCT_UTMPX_UT_TYPE
+  if (name && *name)
+    ut.ut_type = USER_PROCESS;
+  else
+    ut.ut_type = DEAD_PROCESS;
+#endif /* UT_TYPE */
+#if defined HAVE_STRUCT_UTMP_UT_PID || defined HAVE_STRUCT_UTMPX_UT_PID
+  ut.ut_pid = getpid ();
+#endif /* UT_PID */
+
   strncpy (ut.ut_line, line, sizeof ut.ut_line);
+#if defined HAVE_STRUCT_UTMP_UT_USER || defined HAVE_STRUCT_UTMPX_UT_USER
+  strncpy (ut.ut_user, name, sizeof ut.ut_user);
+#elif defined HAVE_STRUCT_UTMP_UT_NAME || defined HAVE_STRUCT_UTMPX_UT_NAME
   strncpy (ut.ut_name, name, sizeof ut.ut_name);
-#ifdef HAVE_STRUCT_UTMP_UT_HOST
-  strncpy (ut.ut_host, host, sizeof ut.ut_host);
 #endif
 
-#ifdef HAVE_STRUCT_UTMP_UT_TV
+#if defined HAVE_STRUCT_UTMP_UT_HOST || defined HAVE_STRUCT_UTMPX_UT_HOST
+  strncpy (ut.ut_host, host, sizeof ut.ut_host);
+# ifdef HAVE_STRUCT_UTMPX_UT_SYSLEN	/* Only utmpx.  */
+  ut.ut_syslen = strlen (host) + 1;	/* Including NUL.  */
+# endif /* UT_SYSLEN */
+#endif /* UT_HOST */
+
+#if defined HAVE_STRUCT_UTMP_UT_TV || defined HAVE_STRUCT_UTMPX_UT_TV
   gettimeofday (&tv, NULL);
   ut.ut_tv.tv_sec = tv.tv_sec;
   ut.ut_tv.tv_usec = tv.tv_usec;
diff --git a/libinetutils/logwtmpko.c b/libinetutils/logwtmpko.c
index 2209b15..ec4135a 100644
--- a/libinetutils/logwtmpko.c
+++ b/libinetutils/logwtmpko.c
@@ -20,7 +20,7 @@
 
 #include <config.h>
 
-#if HAVE_UTMPX_H && defined SOLARIS
+#if defined HAVE_UPDWTMPX && !defined HAVE_LOGWTMP
 # include <utmpx.h>	/* updwtmp() */
 #endif
 
@@ -30,33 +30,41 @@
 /* Solaris does not provide logwtmp(3c).
  * It is needed in addition to logwtmp_keep_open().
  */
-#if HAVE_UPDWTMP && defined SOLARIS
+#if defined HAVE_UPDWTMPX && !defined HAVE_LOGWTMP
 void
 logwtmp (char *line, char *name, char *host)
 {
-  struct utmp ut;
-#ifdef HAVE_STRUCT_UTMP_UT_TV
+  struct utmpx ut;
   struct timeval tv;
-#endif
 
   memset (&ut, 0, sizeof (ut));
-#ifdef HAVE_STRUCT_UTMP_UT_TYPE
-  ut.ut_type = USER_PROCESS;
-#endif
+#ifdef HAVE_STRUCT_UTMPX_UT_TYPE
+  if (name && *name)
+    ut.ut_type = USER_PROCESS;
+  else
+    ut.ut_type = DEAD_PROCESS;
+#endif /* UT_TYPE */
+
   strncpy (ut.ut_line, line, sizeof ut.ut_line);
+#ifdef HAVE_STRUCT_UTMPX_UT_USER
+  strncpy (ut.ut_user, name, sizeof ut.ut_user);
+#elif defined HAVE_STRUCT_UTMPX_UT_NAME
   strncpy (ut.ut_name, name, sizeof ut.ut_name);
-#ifdef HAVE_STRUCT_UTMP_UT_HOST
+#endif
+#ifdef HAVE_STRUCT_UTMPX_UT_HOST
   strncpy (ut.ut_host, host, sizeof ut.ut_host);
+# ifdef HAVE_STRUCT_UTMPX_UT_SYSLEN
+  ut.ut_syslen = strlen (host) + 1;	/* Including NUL.  */
+# endif /* UT_SYSLEN */
+#endif
+#ifdef HAVE_STRUCT_UTMPX_UT_PID
+  ut.ut_pid = getpid ();
 #endif
 
-# ifdef HAVE_STRUCT_UTMP_UT_TV
   gettimeofday (&tv, NULL);
   ut.ut_tv.tv_sec = tv.tv_sec;
   ut.ut_tv.tv_usec = tv.tv_usec;
-# else
-  time (&ut.ut_time);
-# endif
 
-  updwtmp (PATH_WTMP, &ut);
+  updwtmpx (PATH_WTMPX, &ut);
 }
-#endif /* HAVE_UPDWTMP && defined SOLARIS */
+#endif /* HAVE_UPDWTMPX && !HAVE_LOGWTMP */
diff --git a/libinetutils/utmp_init.c b/libinetutils/utmp_init.c
index ce30c5f..a15781c 100644
--- a/libinetutils/utmp_init.c
+++ b/libinetutils/utmp_init.c
@@ -38,7 +38,8 @@
  */
 
 /* Written by Wietse Venema.  With port to GNU Inetutils done by Alain
-   Magloire.  */
+   Magloire.  Reorganized to cope with full variation between utmpx
+   and utmp, with different API sets, by Mats Erik Andersson.  */
 
 #include <config.h>
 
@@ -48,10 +49,10 @@
 #include <time.h>
 #ifdef HAVE_UTMPX_H
 # ifndef __USE_GNU
-#  define __USE_GNU
+#  define __USE_GNU 1
 # endif
 # include <utmpx.h>
-#else
+#else /* !HAVE_UTMPX_H */
 # if HAVE_UTIL_H
 #  include <util.h>
 # endif
@@ -63,19 +64,20 @@
 /* utmp_init - update utmp and wtmp before login */
 
 void
-utmp_init (char *line, char *user, char *id)
+utmp_init (char *line, char *user, char *id, char *host)
 {
 #ifdef HAVE_UTMPX_H
   struct utmpx utx;
-#else
+  struct timeval tv;
+#else /* !HAVE_UTMPX_H */
   struct utmp utx;
-#endif
-#if defined HAVE_STRUCT_UTMPX_UT_TV
+# if defined HAVE_STRUCT_UTMP_UT_TV
   struct timeval tv;
+# endif
 #endif
 
   memset ((char *) &utx, 0, sizeof (utx));
-#if defined HAVE_STRUCT_UTMP_UT_ID
+#if defined HAVE_STRUCT_UTMP_UT_ID || defined HAVE_STRUCT_UTMPX_UT_ID
   strncpy (utx.ut_id, id, sizeof (utx.ut_id));
 #endif
 #if defined HAVE_STRUCT_UTMP_UT_USER || defined HAVE_STRUCT_UTMPX_UT_USER
@@ -83,40 +85,72 @@ utmp_init (char *line, char *user, char *id)
 #elif defined HAVE_STRUCT_UTMP_UT_NAME || defined HAVE_STRUCT_UTMPX_UT_NAME
   strncpy (utx.ut_name, user, sizeof (utx.ut_name));
 #endif
-#if defined HAVE_STRUCT_UTMP_UT_HOST
-  strncpy (utx.ut_host, user, sizeof (utx.ut_host));
-#endif
+#if defined HAVE_STRUCT_UTMP_UT_HOST || defined HAVE_STRUCT_UTMPX_UT_HOST
+  strncpy (utx.ut_host, host, sizeof (utx.ut_host));
+# ifdef HAVE_STRUCT_UTMPX_UT_SYSLEN	/* Only utmpx.  */
+  utx.ut_syslen = strlen (host) + 1;
+# endif
+#endif /* UT_HOST */
+#if defined HAVE_STRUCT_UTMP_UT_LINE || defined HAVE_STRUCT_UTMPX_UT_LINE
   strncpy (utx.ut_line, line, sizeof (utx.ut_line));
-#if defined HAVE_STRUCT_UTMP_UT_PID
+#endif
+
+#if defined HAVE_STRUCT_UTMP_UT_PID || defined HAVE_STRUCT_UTMPX_UT_PID
   utx.ut_pid = getpid ();
 #endif
-#if defined HAVE_STRUCT_UTMP_UT_TYPE
+#if defined HAVE_STRUCT_UTMP_UT_TYPE || defined HAVE_STRUCT_UTMPX_UT_TYPE
   utx.ut_type = LOGIN_PROCESS;
 #endif
-#if defined HAVE_STRUCT_UTMPX_UT_TV
+#if defined HAVE_STRUCT_UTMP_UT_TV || defined HAVE_STRUCT_UTMPX_UT_TV
   gettimeofday (&tv, 0);
   utx.ut_tv.tv_sec = tv.tv_sec;
   utx.ut_tv.tv_usec = tv.tv_usec;
 #else
   time (&(utx.ut_time));
 #endif
+
+/* Prefer utmpx over utmp, and attempt to
+ * use pututxline/pututline for writing the
+ * initial entry.  Then apply whatever
+ * wtmp updating that happens to be available.
+ *
+ * That failing, fall back to loginx/login.
+ * This is made in order than we are granted
+ * LOGIN_PROCESS type and stay unbound by
+ * any tty sensing of stdin, stdout, or stderr,
+ * like GNU libc would do in login().
+ */
 #ifdef HAVE_UTMPX_H
+# ifdef HAVE_PUTUTXLINE
+  setutxent ();
   pututxline (&utx);
-# ifdef HAVE_UPDWTMPX
+  /* Some systems perform wtmp updating
+   * already in calling pututxline().
+   */
+#  ifdef HAVE_UPDWTMPX
   updwtmpx (PATH_WTMPX, &utx);
-# endif
+#  elif defined HAVE_LOGWTMPX
+  logwtmpx (line, user, id, 0, LOGIN_PROCESS);
+#  endif /* wtmp updating */
   endutxent ();
-#elif HAVE_DECL_GETUTENT
+# elif defined HAVE_LOGINX /* !HAVE_PUTUTXLINE */
+  loginx (&utx, 0, LOGIN_PROCESS);
+# endif /* HAVE_LOGINX && !HAVE_PUTUTXLINE */
+
+#else /* !HAVE_UTMPX_H */
+# ifdef HAVE_PUTUTLINE
+  setutent ();
   pututline (&utx);
-# ifdef HAVE_UPDWTMP
+#  ifdef HAVE_UPDWTMP
   updwtmp (PATH_WTMP, &utx);
-# else
+#  elif defined HAVE_LOGWTMP /* !HAVE_UPDWTMP */
   logwtmp (line, user, id);
-# endif
+#  endif /* wtmp updating */
   endutent ();
-#else
+# elif defined HAVE_LOGIN /* !HAVE_PUTUTLINE */
   login (&utx);
-#endif
+# endif /* HAVE_LOGIN && !HAVE_PUTUTLINE */
+#endif /* !HAVE_UTMPX_H */
 }
 
 /* utmp_ptsid - generate utmp id for pseudo terminal */
diff --git a/libinetutils/utmp_logout.c b/libinetutils/utmp_logout.c
index 5cc8543..1cab5b8 100644
--- a/libinetutils/utmp_logout.c
+++ b/libinetutils/utmp_logout.c
@@ -38,17 +38,20 @@
  */
 
 /* Written by Wietse Venema.  With port to GNU Inetutils done by Alain
-   Magloire.  */
+   Magloire.  Reorganized to cope with full variation between utmpx
+   and utmp, with different API sets, by Mats Erik Andersson.  */
 
 #include <config.h>
 
 #include <sys/types.h>
 #include <sys/time.h>
 #include <time.h>
-#if defined UTMPX && defined HAVE_UTMPX_H
-# define __USE_GNU
+#ifdef HAVE_UTMPX_H
+# ifndef __USE_GNU
+#  define __USE_GNU 1
+# endif
 # include <utmpx.h>
-#else
+#else /* !HAVE_UTMPX_H */
 # if HAVE_UTIL_H
 #  include <util.h>
 # endif
@@ -61,66 +64,100 @@
 void
 utmp_logout (char *line)
 {
-#ifdef UTMPX
+#ifdef HAVE_UTMPX_H
   struct utmpx utx;
   struct utmpx *ut;
 
   strncpy (utx.ut_line, line, sizeof (utx.ut_line));
 
+# ifdef HAVE_PUTUTXLINE
+  setutxent();
   ut = getutxline (&utx);
   if (ut)
     {
       struct timeval tv;
 
       ut->ut_type = DEAD_PROCESS;
-      ut->ut_exit.e_termination = 0;
-      ut->ut_exit.e_exit = 0;
+#  ifdef HAVE_STRUCT_UTMPX_UT_EXIT
+      memset (&ut->ut_exit, 0, sizeof (ut->ut_exit));
+#  endif
       gettimeofday (&tv, 0);
       ut->ut_tv.tv_sec = tv.tv_sec;
       ut->ut_tv.tv_usec = tv.tv_usec;
+#  ifdef HAVE_STRUCT_UTMPX_UT_USER
+      memset (&ut->ut_user, 0, sizeof (ut->ut_user));
+#  elif defined HAVE_STRUCT_UTMPX_UT_NAME
+      memset (&ut->ut_name, 0, sizeof (ut->ut_name));
+#  endif
+#  ifdef HAVE_STRUCT_UTMPX_UT_HOST
+      memset (ut->ut_host, 0, sizeof (ut->ut_host));
+#   ifdef HAVE_STRUCT_UTMPX_UT_SYSLEN
+      ut->ut_syslen = 1;	/* Counting NUL.  */
+#   endif
+#  endif /* UT_HOST */
       pututxline (ut);
+      /* Some systems perform wtmp updating
+       * already in calling pututxline().
+       */
+#  ifdef HAVE_UPDWTMPX
       updwtmpx (PATH_WTMPX, ut);
+#  elif defined HAVE_LOGWTMPX
+      logwtmpx (ut->ut_line, "", "", 0, DEAD_PROCESS);
+#  endif
     }
   endutxent ();
-#elif HAVE_DECL_GETUTENT
+# elif defined HAVE_LOGOUTX /* !HAVE_PUTUTXLINE */
+  if (logoutx (line, 0, DEAD_PROCESS))
+    logwtmpx (line, "", "", 0, DEAD_PROCESS);
+# endif /* HAVE_LOGOUTX */
+
+#else /* !HAVE_UTMPX_H */
   struct utmp utx;
   struct utmp *ut;
 
   strncpy (utx.ut_line, line, sizeof (utx.ut_line));
 
+# ifdef HAVE_PUTUTLINE
+  setutent();
   ut = getutline (&utx);
   if (ut)
     {
-# ifdef HAVE_STRUCT_UTMP_UT_TV
+#  ifdef HAVE_STRUCT_UTMP_UT_TV
       struct timeval tv;
-# endif
+#  endif
 
-# ifdef HAVE_STRUCT_UTMP_UT_TYPE
+#  ifdef HAVE_STRUCT_UTMP_UT_TYPE
       ut->ut_type = DEAD_PROCESS;
-# endif
-# ifdef HAVE_STRUCT_UTMP_UT_EXIT
-      ut->ut_exit.e_termination = 0;
-      ut->ut_exit.e_exit = 0;
-# endif
-# ifdef HAVE_STRUCT_UTMP_UT_TV
+#  endif
+#  ifdef HAVE_STRUCT_UTMP_UT_EXIT
+      memset (&ut->ut_exit, 0, sizeof (ut->ut_exit));
+#  endif
+#  ifdef HAVE_STRUCT_UTMP_UT_TV
       gettimeofday (&tv, 0);
       ut->ut_tv.tv_sec = tv.tv_sec;
       ut->ut_tv.tv_usec = tv.tv_usec;
-# else
+#  else /* !HAVE_STRUCT_UTMP_UT_TV */
       time (&(ut->ut_time));
-# endif
+#  endif
+#  ifdef HAVE_STRUCT_UTMP_UT_USER
+      memset (&ut->ut_user, 0, sizeof (ut->ut_user));
+#  elif defined HAVE_STRUCT_UTMP_UT_NAME
+      memset (&ut->ut_name, 0, sizeof (ut->ut_name));
+#  endif
+#  ifdef HAVE_STRUCT_UTMP_UT_HOST
+      memset (ut->ut_host, 0, sizeof (ut->ut_host));
+#  endif
       pututline (ut);
-# ifdef HAVE_UPDWTMP
-      ut->ut_name[0] = 0;
-      ut->ut_host[0] = 0;
+#  ifdef HAVE_UPDWTMP
       updwtmp (WTMP_FILE, ut);
-# else
+#  elif defined HAVE_LOGWTMP /* !HAVE_UPDWTMP */
       logwtmp (ut->ut_line, "", "");
-# endif
+#  endif
     }
   endutent ();
-#else
+# elif defined HAVE_LOGOUT /* !HAVE_PUTUTLINE */
   if (logout (line))
     logwtmp (line, "", "");
+# endif /* HAVE_LOGOUT */
 #endif
 }
diff --git a/libls/print.c b/libls/print.c
index 9537652..062aca6 100644
--- a/libls/print.c
+++ b/libls/print.c
@@ -63,7 +63,6 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
-#include <utmp.h>
 #include <filemode.h>
 
 #ifdef HAVE_SYS_MKDEV_H
diff --git a/paths b/paths
index 8cd8096..7e6a24f 100644
--- a/paths
+++ b/paths
@@ -84,10 +84,10 @@ PATH_INETDCONF	$(sysconfdir)/inetd.conf
 PATH_INETDDIR	$(sysconfdir)/inetd.d
 PATH_INETDPID	$(localstatedir)/run/inetd.pid
 PATH_UTMP	<utmp.h> <utmp.h>:UTMP_FILE $(localstatedir)/run/utmp search:utmp:/var/run:/var/adm:/etc
-PATH_UTMPX	<utmpx.h> <utmpx.h>:UTMPX_FILE $(localstatedir)/run/utmpx search:utmpx:/var/run:/var/adm:/etc
+PATH_UTMPX	<utmpx.h> <utmpx.h>:UTMPX_FILE $(localstatedir)/run/utmpx search:utmpx:/var/run:/var/adm:/etc "/var/run/utx.active"
 PATH_WTMP	<utmp.h> <utmp.h>:WTMP_FILE $(localstatedir)/log/wtmp search:wtmp:/var/log:/var/adm:/etc
-PATH_WTMPX	<utmpx.h> <utmpx.h>:WTMPX_FILE $(localstatedir)/log/wtmpx search:wtmpx:/var/log:/var/adm:/etc
-PATH_LASTLOG	<utmp.h> $(localstatedir)/log/lastlog search:lastlog:/var/log:/var/adm:/etc
+PATH_WTMPX	<utmpx.h> <utmpx.h>:WTMPX_FILE $(localstatedir)/log/wtmpx search:wtmpx:/var/log:/var/adm:/etc "/var/log/utx.log"
+PATH_LASTLOG	<utmp.h> $(localstatedir)/log/lastlog search:lastlog:/var/log:/var/adm:/etc "/var/log/utx.lastlogin"
 PATH_LOG	<syslog.h> /dev/log
 PATH_KLOG	<syslog.h> /dev/klog no
 PATH_LOGCONF	$(sysconfdir)/syslog.conf
diff --git a/src/rlogind.c b/src/rlogind.c
index cd021da..4af17cd 100644
--- a/src/rlogind.c
+++ b/src/rlogind.c
@@ -781,20 +781,13 @@ setup_tty (int fd, struct auth_data *ap)
   ap->env[1] = 0;
 }
 
-#ifdef UTMPX
-char *utmp_ptsid ();
- /*FIXME*/ void utmp_init ();
-
 void
-setup_utmp (char *line)
+setup_utmp (char *line, char *host)
 {
   char *ut_id = utmp_ptsid (line, "rl");
 
-  utmp_init (line + sizeof ("/dev/") - 1, ".rlogin", ut_id);
+  utmp_init (line + sizeof ("/dev/") - 1, ".rlogin", ut_id, host);
 }
-#else
-# define setup_utmp(line)
-#endif
 
 void
 exec_login (int authenticated, struct auth_data *ap)
@@ -911,7 +904,7 @@ rlogind_mainloop (int infd, int outfd)
 	close (infd);
 
       setup_tty (0, &auth_data);
-      setup_utmp (line);
+      setup_utmp (line, auth_data.hostname);
 
       exec_login (authenticated, &auth_data);
       fatal (infd, "can't execute login", 1);
@@ -1668,7 +1661,7 @@ cleanup (int signo _GL_UNUSED_PARAMETER)
   char *p;
 
   p = line + sizeof (PATH_DEV) - 1;
-#ifdef UTMPX
+#if !defined HAVE_LOGOUT || !defined HAVE_LOGWTMP
   utmp_logout (p);
   chmod (line, 0644);
   chown (line, 0, 0);
diff --git a/src/uucpd.c b/src/uucpd.c
index e16b995..0699420 100644
--- a/src/uucpd.c
+++ b/src/uucpd.c
@@ -77,6 +77,9 @@
 # include <crypt.h>
 #endif
 #include <termios.h>
+#ifdef HAVE_UTMPX_H
+# include <utmpx.h>
+#endif
 #ifdef HAVE_UTMP_H
 # include <utmp.h>
 #endif
@@ -228,7 +231,30 @@ dologout (void)
     {
       char line[100];
       sprintf (line, "uucp%.4d", pid);
+#ifdef HAVE_LOGWTMPX
+      logwtmpx (line, "", "", 0, DEAD_PROCESS);
+#elif defined HAVE_LOGWTMP
       logwtmp (line, "", "");
+#elif defined HAVE_PUTUTXLINE
+      {
+	/* Novelty in FreeBSD 9.0.  */
+	struct utmpx ut;
+	struct timeval now;
+
+	ut.ut_type = DEAD_PROCESS;
+	ut.ut_pid = pid;
+	strncpy (ut.ut_line, line, sizeof (ut.ut_line));
+	memset (ut.ut_user, 0, sizeof (ut.ut_user));
+	memset (ut.ut_host, 0, sizeof (ut.ut_host));
+# ifdef HAVE_STRUCT_UTMPX_UT_SYSLEN
+	ut.ut_syslen = 1;
+# endif
+	gettimeofday (&now, NULL);
+	ut.ut_tv.tv_sec = now.tv_sec;
+	ut.ut_tv.tv_usec = now.tv_usec;
+	pututxline (&ut);
+      }
+#endif /* HAVE_PUTUTXLINE && !HAVE_LOGWTMPX && !HAVE_LOGWTMP */
     }
 }
 
@@ -254,7 +280,30 @@ dologin (struct passwd *pw, struct sockaddr_in *sin)
 
   sprintf (line, "uucp%.4d", getpid ());
 
+#ifdef HAVE_LOGWTMPX
+  logwtmpx (line, pw->pw_name, remotehost, 0, USER_PROCESS);
+#elif defined HAVE_LOGWTMP
   logwtmp (line, pw->pw_name, remotehost);
+#elif defined HAVE_PUTUTXLINE
+  {
+    /* Novelty in FreeBSD 9.0.  */
+    struct utmpx ut;
+    struct timeval now;
+
+    ut.ut_type = USER_PROCESS;
+    ut.ut_pid = getpid();
+    strncpy (ut.ut_line, line, sizeof (ut.ut_line));
+    strncpy (ut.ut_user, pw->pw_name, sizeof (ut.ut_user));
+    strncpy (ut.ut_host, remotehost, sizeof (ut.ut_host));
+# ifdef HAVE_STRUCT_UTMPX_UT_SYSLEN
+	ut.ut_syslen = strlen (remotehost) + 1;
+# endif
+    gettimeofday (&now, NULL);
+    ut.ut_tv.tv_sec = now.tv_sec;
+    ut.ut_tv.tv_usec = now.tv_usec;
+    pututxline (&ut);
+  }
+#endif /* HAVE_PUTUTXLINE && !HAVE_LOGWTMPX && !HAVE_LOGWTMP */
 
 #if defined PATH_LASTLOG && defined HAVE_STRUCT_LASTLOG
 # define SCPYN(a, b)	strncpy(a, b, sizeof (a))
diff --git a/telnetd/pty.c b/telnetd/pty.c
index 2ec2dac..d333a88 100644
--- a/telnetd/pty.c
+++ b/telnetd/pty.c
@@ -29,10 +29,10 @@
 #include <libinetutils.h>
 
 void
-setup_utmp (char *line)
+setup_utmp (char *line, char *host)
 {
   char *ut_id = utmp_ptsid (line, "tn");
-  utmp_init (line + sizeof ("/dev/") - 1, ".telnet", ut_id);
+  utmp_init (line + sizeof ("/dev/") - 1, ".telnet", ut_id, host);
 }
 
 
@@ -73,9 +73,7 @@ startslave (char *host, int autologin, char *autoname)
       if (net > 2)
 	close (net);
 
-#ifdef UTMPX
-      setup_utmp (line);
-#endif
+      setup_utmp (line, host);
       start_login (host, autologin, line);
     }
 

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


commit 5d9c59cbcd0c9967986e1a14907ea1d87e8a5d9c
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sun Jul 29 22:51:18 2012 +0200

    Out-of-tree binary build.

diff --git a/ChangeLog b/ChangeLog
index 6a7a022..6a409fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-07-29  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	Out-of-tree build with libshishi.
+
+	* telnet/Makefile.am (INCLUDES): Add `-I$(top_srcdir)'.
+
+	Obsolete source file.
+
+	* libtelnet/Makefile.am (libtelnet_a_SOURCES): Remove
+	reference to `getent.c'.
+
 2012-07-27  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	rlogin, rshd: Protocol coherence.
diff --git a/libtelnet/Makefile.am b/libtelnet/Makefile.am
index fe88c68..87cb583 100644
--- a/libtelnet/Makefile.am
+++ b/libtelnet/Makefile.am
@@ -22,6 +22,6 @@ INCLUDES = $(iu_INCLUDES) $(INCAUTH)
 
 noinst_LIBRARIES = libtelnet.a
 
-libtelnet_a_SOURCES = auth.c enc_des.c encrypt.c forward.c genget.c getent.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
diff --git a/telnet/Makefile.am b/telnet/Makefile.am
index b37ed35..a18f9a0 100644
--- a/telnet/Makefile.am
+++ b/telnet/Makefile.am
@@ -27,7 +27,7 @@ telnet_SOURCES = authenc.c commands.c main.c network.c ring.c sys_bsd.c \
 
 noinst_HEADERS = defines.h externs.h general.h ring.h types.h
 
-INCLUDES = $(iu_INCLUDES) $(NCURSES_INCLUDE)
+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)

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

Summary of changes:
 ChangeLog                   |   71 +++++++++++++++++++++++++++++++++++
 configure.ac                |   59 +++++++++++++++++++++++-----
 libinetutils/cleansess.c    |    7 ++-
 libinetutils/libinetutils.h |    2 +-
 libinetutils/logwtmp.c      |   56 ++++++++++++++++++++-------
 libinetutils/logwtmpko.c    |   38 +++++++++++-------
 libinetutils/utmp_init.c    |   78 +++++++++++++++++++++++++++-----------
 libinetutils/utmp_logout.c  |   87 ++++++++++++++++++++++++++++++------------
 libls/print.c               |    1 -
 libtelnet/Makefile.am       |    2 +-
 paths                       |    6 +-
 src/rlogind.c               |   15 ++-----
 src/uucpd.c                 |   49 ++++++++++++++++++++++++
 telnet/Makefile.am          |    2 +-
 telnetd/pty.c               |    8 +--
 15 files changed, 368 insertions(+), 113 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Aug 02 21:37:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sx6pK-0004dq-A9
	for mharc-commit-inetutils@gnu.org; Thu, 02 Aug 2012 21:37:18 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48552)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Sx6pG-0004dH-N2
	for commit-inetutils@gnu.org; Thu, 02 Aug 2012 21:37:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Sx6pF-0007sC-6o
	for commit-inetutils@gnu.org; Thu, 02 Aug 2012 21:37:14 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:60630)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Sx6pF-0007s8-2q
	for commit-inetutils@gnu.org; Thu, 02 Aug 2012 21:37:13 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1Sx6pD-0000Ol-Tv
	for commit-inetutils@gnu.org; Fri, 03 Aug 2012 01:37:13 +0000
Date: Fri, 03 Aug 2012 01:37:12 +0000
Message-Id: <E1Sx6pD-0000Ol-Tv@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-141-ga1df58a
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: eb139e0534d61c51226ddd6c436c655f94532b1e
X-Git-Newrev: a1df58afcb9f63e97ec6b944432a09ae52ed51a4
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 03 Aug 2012 01:37: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  a1df58afcb9f63e97ec6b944432a09ae52ed51a4 (commit)
      from  eb139e0534d61c51226ddd6c436c655f94532b1e (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=a1df58afcb9f63e97ec6b944432a09ae52ed51a4


commit a1df58afcb9f63e97ec6b944432a09ae52ed51a4
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Aug 3 03:34:38 2012 +0200

    Macro usage for socket lengths.

diff --git a/ChangeLog b/ChangeLog
index 85c70d8..4ac4f42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2012-08-03  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* configure.ac: Check whether `struct sockaddr_in6'
+	contains sin6_len.  Correctly check for ut_addr_v6
+	inside `struct utmpx'.
+	* libinetutils/kcmd.c (kcmd) [SHISHI]: Condition on
+	HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN for access to ss_len.
+	(getport): Likewise.
+	* ping/libping.c (ping_set_dest): Access sin_len
+	conditioned on HAVE_STRUCT_SOCKADDR_IN_SIN_LEN.
+	* src/rexec.c (do_rexec): Build INET6 structure
+	guided by HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN.
+	* src/tftp.c (resolve_name): Access ss_len based on
+	HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN.
+	* src/tftpd.c (main): Likewise.
+
 2012-08-01  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	Better adaptions to different UTMP implementations.
diff --git a/configure.ac b/configure.ac
index 0c41949..a32dc9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -619,6 +619,9 @@ AC_CHECK_TYPE(sig_atomic_t, , AC_DEFINE([sig_atomic_t], int, [FIXME]),
 IU_CHECK_MEMBERS([struct sockaddr_in.sin_len], , ,
     [ #include <sys/types.h>
       #include <netinet/in.h> ])
+IU_CHECK_MEMBERS([struct sockaddr_in6.sin6_len], , ,
+    [ #include <sys/types.h>
+      #include <netinet/in.h> ])
 IU_CHECK_MEMBERS([struct sockaddr_storage.ss_len], , ,
     [ #include <sys/types.h>
       #include <netinet/in.h> ])
@@ -645,7 +648,7 @@ if test "$ac_cv_header_utmpx_h" = yes; then
 		    struct utmpx.ut_exit, struct utmpx.ut_tv,
 		    struct utmpx.ut_session, struct utmpx.ut_syslen,
 		    struct utmpx.ut_host, struct utmpx.ut_ss,
-		    struct utmpx.ut_aadr_v6], , , [#include <utmpx.h>])
+		    struct utmpx.ut_addr_v6], , , [#include <utmpx.h>])
 fi
 
 IU_CHECK_MEMBERS([struct ifreq.ifr_index,
diff --git a/libinetutils/kcmd.c b/libinetutils/kcmd.c
index 6a43882..1d1858b 100644
--- a/libinetutils/kcmd.c
+++ b/libinetutils/kcmd.c
@@ -232,7 +232,7 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short rport, char *locuser,
 	{
 	case AF_INET6:
 	  len = sizeof (struct sockaddr_in6);
-#  ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+#  ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN
 	  sin.ss_len = len;
 #  endif
 	  memcpy (&((struct sockaddr_in6 *) &sin)->sin6_addr,
@@ -242,7 +242,7 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short rport, char *locuser,
 	case AF_INET:
 	default:
 	  len = sizeof (struct sockaddr_in);
-#  ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+#  ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN
 	  sin.ss_len = len;
 #  endif
 	  memcpy (&((struct sockaddr_in *) &sin)->sin_addr,
@@ -500,7 +500,7 @@ getport (int *alport, int af)
   sin.ss_family = af;
   len = (af == AF_INET6) ? sizeof (struct sockaddr_in6)
 	: sizeof (struct sockaddr_in);
-# ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
+# ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN
   sin.ss_len = len;
 # endif
 
diff --git a/ping/libping.c b/ping/libping.c
index b847958..41d3f92 100644
--- a/ping/libping.c
+++ b/ping/libping.c
@@ -266,7 +266,7 @@ ping_set_dest (PING * ping, char *host)
 {
   struct sockaddr_in *s_in = &ping->ping_dest.ping_sockaddr;
   s_in->sin_family = AF_INET;
-#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
   s_in->sin_len = sizeof (*s_in);
 #endif
   if (inet_aton (host, &s_in->sin_addr))
diff --git a/src/rexec.c b/src/rexec.c
index cee880f..ebba784 100644
--- a/src/rexec.c
+++ b/src/rexec.c
@@ -295,7 +295,7 @@ do_rexec (struct arguments *arguments)
 	  ((struct sockaddr_in *) &serv_addr)->sin_port = arguments->err_port;
 	  break;
 	case AF_INET6:
-#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
 	  ((struct sockaddr_in6 *) &serv_addr)->sin6_len = addrlen;
 #endif
 	  ((struct sockaddr_in6 *) &serv_addr)->sin6_family = addr.ss_family;
diff --git a/src/tftp.c b/src/tftp.c
index d85c14a..144d67a 100644
--- a/src/tftp.c
+++ b/src/tftp.c
@@ -328,7 +328,7 @@ resolve_name (char *name)
 
       memset (&ss, 0, sizeof (ss));
       ss.ss_family = ai->ai_family;
-#if HAVE_STRUCT_SOCKADDR_SA_LEN
+#if HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN
       ss.ss_len = ai->ai_addrlen;
 #endif
       if (bind (f, (struct sockaddr *) &ss, ai->ai_addrlen))
diff --git a/src/tftpd.c b/src/tftpd.c
index 1112c78..f8f4cff 100644
--- a/src/tftpd.c
+++ b/src/tftpd.c
@@ -288,7 +288,7 @@ main (int argc, char *argv[])
     }
   memset (&sin, 0, sizeof (sin));
   sin.ss_family = from.ss_family;
-#if HAVE_STRUCT_SOCKADDR_SA_LEN
+#if HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN
   sin.ss_len = from.ss_len;
 #endif
   if (bind (peer, (struct sockaddr *) &sin, fromlen) < 0)

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

Summary of changes:
 ChangeLog           |   16 ++++++++++++++++
 configure.ac        |    5 ++++-
 libinetutils/kcmd.c |    6 +++---
 ping/libping.c      |    2 +-
 src/rexec.c         |    2 +-
 src/tftp.c          |    2 +-
 src/tftpd.c         |    2 +-
 7 files changed, 27 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Aug 03 09:35:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SxI2P-0008JC-Ml
	for mharc-commit-inetutils@gnu.org; Fri, 03 Aug 2012 09:35:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37514)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SxI2H-0008Ii-Q1
	for commit-inetutils@gnu.org; Fri, 03 Aug 2012 09:35:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SxI25-0003nu-Hx
	for commit-inetutils@gnu.org; Fri, 03 Aug 2012 09:35:25 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:51297)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SxI25-0003nk-EI
	for commit-inetutils@gnu.org; Fri, 03 Aug 2012 09:35:13 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1SxI25-0002eh-2m
	for commit-inetutils@gnu.org; Fri, 03 Aug 2012 13:35:13 +0000
Date: Fri, 03 Aug 2012 13:35:13 +0000
Message-Id: <E1SxI25-0002eh-2m@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-142-g3054a34
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: a1df58afcb9f63e97ec6b944432a09ae52ed51a4
X-Git-Newrev: 3054a34cda7ced89f28fcaf3401097ee0b83cebc
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 03 Aug 2012 13:35:32 -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  3054a34cda7ced89f28fcaf3401097ee0b83cebc (commit)
      from  a1df58afcb9f63e97ec6b944432a09ae52ed51a4 (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=3054a34cda7ced89f28fcaf3401097ee0b83cebc


commit 3054a34cda7ced89f28fcaf3401097ee0b83cebc
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Aug 3 15:19:06 2012 +0200

    rlogind, rshd: Exchange protocol audit.
    
    Make sure they follow identical protocols.

diff --git a/ChangeLog b/ChangeLog
index 4ac4f42..6ed2ba5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
 2012-08-03  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	rlogind, rshd: Protocol exchange adherence.
+	The implementations in both, with and without
+	Kerberization, did not follow identical protocols.
+
+	* libinetutils/kcmd.c (kcmd) [SHISHI]: Write remote user name
+	first, then the local user name, falling back to remote name.
+	* src/rlogind.c (do_shishi_login) [SHISHI]: Read local user
+	name first, then remote name.
+	* src/rshd.c (doit): Read `locuser' immediately before `command'.
+	[!KERBEROS && !SHISHI]: Read `remuser' first.
+	[KERBEROS || SHISHI]: Read `remuser' last.
+	[SHISHI]: Insert `Kerberized' into syslog message only for active
+	Kerberized connection.
+
+	* src/rsh.c (options) [WITH_ORCMD_AF || WITH_RCMD_AF || SHISHI]:
+	Add SHISHI as provider of `--ipv4' and `--ipv6'.
+
+	* doc/inetutils.text: Updated.
+
+2012-08-03  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	* configure.ac: Check whether `struct sockaddr_in6'
 	contains sin6_len.  Correctly check for ut_addr_v6
 	inside `struct utmpx'.
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index 002c903..c1b67c8 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -1715,11 +1715,17 @@ Reference Manual}.
 The options are as follows :
 
 @table @option
-@item -K
-@itemx --kerberos
-@opindex -K
-@opindex --kerberos
-Turns off all Kerberos authentication.
+@item -4
+@itemx --ipv4
+@opindex -4
+@opindex --ipv4
+Use only IPv4.
+
+@item -6
+@itemx --ipv6
+@opindex -6
+@opindex --ipv6
+Use only IPv6.
 
 @item -d
 @itemx --debug
@@ -1732,26 +1738,38 @@ Turns on socket debugging used for communication with the remote host.
 @opindex -k
 @opindex --realm
 The option requests rsh to obtain tickets for the remote host in
-@var{realm} realm instead of the remote host's realm.
+realm @var{realm} instead of the remote host's realm.
+
+@item -K
+@itemx --kerberos
+@opindex -K
+@opindex --kerberos
+Turns off all Kerberos authentication.
+
+@item -l @var{user}
+@itemx --user=@var{user}
+@opindex -l
+@opindex --user
+By default, the remote username is the same as the local username.
+The @option{-l} option and the @samp{username@@host} format allow the
+remote user name to be specified.  Kerberos authentication is used,
+whenever available, and authorization is determined as in @command{rlogin}
+(@pxref{rlogin invocation}).
+
+@item -n
+@itemx --no-input
+@opindex -n
+@opindex --no-input
+Use @file{/dev/null} for all input, and use no separate @samp{stderr}
+at remote end.  This option is void together with encryption.
 
 @item -x
 @itemx --encrypt
 @opindex -x
 @opindex --encrypt
-Turns on DES encryption for all data passed via the rsh session.  This
+Turns on encryption for all data passed via the rsh session.  This
 may impact response time and CPU utilization, but provides increased
 security.
-
-@item -l
-@itemx --user
-@opindex -l
-@opindex --user
-By default, the remote username is the same as the local username.
-The @option{-l} option or the @samp{username@@host} format allow the
-remote name to be specified.  Kerberos authentication is used, and
-authorization is determined as in @command{rlogin} (@pxref{rlogin
-invocation}).
-
 @end table
 
 If no command is specified, you will be logged in on the remote host
@@ -1802,6 +1820,18 @@ Reference Manual}.
 The options are as follows :
 
 @table @option
+@item -4
+@itemx --ipv4
+@opindex -4
+@opindex --ipv4
+Use only IPv4.
+
+@item -6
+@itemx --ipv6
+@opindex -6
+@opindex --ipv6
+Use only IPv6.
+
 @item -8
 @itemx --8-bit
 @opindex -8
@@ -1810,21 +1840,6 @@ Allows an eight-bit input data path at all times; otherwise parity
 bits are stripped except when the remote side's stop and start
 characters are other than @kbd{C-S}/@kbd{C-Q}.
 
-@item -E
-@item --no-escape
-@itemx --no-escape
-@opindex -E
-@opindex --no-escape
-Stops any character from being recognized as an escape character.
-When used with the @option{-8} option, this provides a completely
-transparent connection.
-
-@item -K
-@itemx --kerberos
-@opindex -K
-@opindex --kerberos
-Turns off all Kerberos authentication.
-
 @item -d
 @itemx --debug
 @opindex -d
@@ -1832,7 +1847,7 @@ Turns off all Kerberos authentication.
 Turns on socket debugging on the TCP sockets used for communication
 with the remote host.
 
-@item -e
+@item -e @var{char}
 @itemx --escape=@var{char}
 @opindex -e
 @opindex --escape
@@ -1840,18 +1855,40 @@ Allows user specification of the escape character, which is @samp{~}
 by default.  This specification may be as a literal character, or as
 an octal value in the form @samp{\nnn}.
 
-@item -k
+@item -E
+@itemx --no-escape
+@opindex -E
+@opindex --no-escape
+Stops any character from being recognized as an escape character.
+When used with the @option{-8} option, this provides a completely
+transparent connection.
+
+@item -k @var{realm}
 @itemx --realm=@var{realm}
 @opindex -k
 @opindex --realm
 The option requests rlogin to obtain tickets for the remote host in
-@var{realm} realm instead of the remote host's realm.
+realm @var{realm} instead of the remote host's realm.
+
+@item -K
+@itemx --kerberos
+@opindex -K
+@opindex --kerberos
+Turns off all Kerberos authentication.
+
+@item -l @var{user}
+@itemx --user=@var{user}
+@opindex -l
+@opindex --user
+By default, the remote username is the same as the local username.
+This option, and the @samp{user@@host} format, allow the remote
+user name to be made explicit, or changed.
 
 @item -x
 @itemx --encrypt
 @opindex -x
 @opindex --encrypt
-Turns on DES encryption for all data passed via the rlogin session.
+Turns on encryption for all data passed via the rlogin session.
 This may impact response time and CPU utilization, but provides
 increased security.
 @end table
@@ -1906,18 +1943,42 @@ rcp [@var{option}]@dots{} @var{files}@dots{} @var{directory}
 @end example
 
 @table @option
-@item -K
-@itemx --kerberos
-@opindex -K
-@opindex --kerberos
-Turns off all Kerberos authentication.
+@item -4
+@itemx --ipv4
+@opindex -4
+@opindex --ipv4
+Use only IPv4.
 
-@item -k
+@item -6
+@itemx --ipv6
+@opindex -6
+@opindex --ipv6
+Use only IPv6.
+
+@item -d @var{directory}
+@itemx --target-directory=@var{directory}
+@opindex -d
+@opindex --target-directory
+Copy all source arguments into @var{directory}.
+
+@item -f
+@itemx --from
+@opindex -f
+@opindex --from
+(Server mode only.) Copying from remote host.
+
+@item -k @var{realm}
 @itemx --realm=@var{realm}
 @opindex -k
 @opindex --realm
 The option requests rcp to obtain tickets for the remote host in
-@var{realm} realm instead of the remote host's realm.
+realm @var{realm} instead of the remote host's realm.
+
+@item -K
+@itemx --kerberos
+@opindex -K
+@opindex --kerberos
+Turns off all Kerberos authentication.
 
 @item -p
 @itemx --preserve
@@ -1925,9 +1986,9 @@ The option requests rcp to obtain tickets for the remote host in
 @opindex --preserve
 Causes @code{rcp} to attempt to preserve (duplicate) in its copies the
 modification times and modes of the source files, ignoring the umask.
-By default, the mode and owner of file are preserved if it already
-existed; otherwise the mode of the source file modified by the
-@code{umask} function on the destination host is used.
+By default, the mode and owner of the target file are preserved
+if the target itself already exists; otherwise the mode of the source
+file is modified by the @code{umask} setting on the destination host.
 
 @item -r
 @itemx --recursive
@@ -1937,12 +1998,18 @@ If any of the source files are directories, @command{rcp} copies each
 subtree rooted at that name; in this case the destination must be a
 directory.
 
+@item -t
+@itemx --to
+@opindex -t
+@opindex --to
+(Server mode only.) Copying to remote host.
+
 @item -x
 @itemx --encrypt
 @opindex -x
 @opindex --encrypt
-Turns on DES encryption for all data passed via the rcp session.  This
-may impact response time and CPU utilization, but provides increased
+Turns on encryption for all data passed via the @command{rcp} session.
+This may impact response time and CPU utilization, but provides increased
 security.
 
 @end table
@@ -3064,7 +3131,8 @@ request is received the following protocol is initiated:
 @enumerate
 @item
 The server checks the client's source port.  If the port is not in the
-range 512--1023, the server aborts the connection.
+range 512--1023, the server aborts the connection.  However, this
+condition is not applied for Kerberized service.
 
 @item
 The server reads characters from the socket up to a NUL (@samp{\0})
@@ -3150,17 +3218,23 @@ Ask hostname for verification.
 @c @opindex --daemon
 @c Daemon mode.
 
+@item -k
+@itemx --kerberos
+@opindex -k
+@opindex --kerberos
+Use Kerberos authentication.
+
 @item -l
 @itemx --no-rhosts
 @opindex -l
 @opindex --no-rhosts
 Ignore @file{.rhosts} file.
 
-@item -L @var{name}
-@itemx --local-domain=@var{name}
+@item -L
+@itemx --log-sessions
 @opindex -L
-@opindex --local-domain
-Set local domain name.
+@opindex --log-sessions
+Log successful logins.
 
 @item -n
 @itemx --no-keepalive
@@ -3168,25 +3242,32 @@ Set local domain name.
 @opindex --no-keepalive
 Do not set SO_KEEPALIVE.
 
-@item -k
-@itemx --kerberos
-@opindex -k
-@opindex --kerberos
-Use kerberos IV authentication.
-
-@item -x
-@itemx --encrypt
-@opindex -x
-@opindex --encrypt
-Turns on DES encryption for all data passed via the @command{rshd}
-session.  This may impact response time and CPU utilization, but
-provides increased security.
-
-@item -D[@var{level}]
-@itemx --debug[=@var{level}]
-@opindex -D
-@opindex -debug
-Set debug level, not implemented.
+@item -S @var{name}
+@itemx --servername=@var{name}
+@opindex -S
+@opindex --servername
+Set Kerberos server name, overriding canonical hostname.
+
+@item -v
+@itemx --vacuous
+@opindex -v
+@opindex --vacuous
+Fail any call asking for non-Kerberos authentication.
+
+@c OBSOLETE?
+@c @item -x
+@c @itemx --encrypt
+@c @opindex -x
+@c @opindex --encrypt
+@c Turns on DES encryption for all data passed via the @command{rshd}
+@c session.  This may impact response time and CPU utilization, but
+@c provides increased security.
+
+@c @item -D[@var{level}]
+@c @itemx --debug[=@var{level}]
+@c @opindex -D
+@c @opindex -debug
+@c Set debug level, not implemented.
 
 @c @item -o
 @c @itemx --allow-root
@@ -3327,6 +3408,18 @@ Ask hostname for verification.
 @opindex --daemon
 Daemon mode.
 
+@item -D[@var{level}]
+@itemx --debug[=@var{level}]
+@opindex -D
+@opindex -debug
+Set debug level, not implemented.
+
+@item -k
+@itemx --kerberos
+@opindex -k
+@opindex --kerberos
+Use Kerberos authentication.
+
 @item -l
 @itemx --no-rhosts
 @opindex -l
@@ -3345,43 +3438,37 @@ Set local domain name.
 @opindex --no-keepalive
 Do not set SO_KEEPALIVE.
 
-@item -k
-@itemx --kerberos
-@opindex -k
-@opindex --kerberos
-Use kerberos IV authentication.
-
-@item -x
-@itemx --encrypt
-@opindex -x
-@opindex --encrypt
-Turns on DES encryption for all data passed via the rlogind session.
-This may impact response time and CPU utilization, but provides
-increased security.
-
-@item -D[@var{level}]
-@itemx --debug[=@var{level}]
-@opindex -D
-@opindex -debug
-Set debug level, not implemented.
-
 @item -o
 @itemx --allow-root
 @opindex -o
 @opindex --allow-root
-Allow the root user to login, disabled by default.
+Allow the root user to login. This is disallowed by default.
 
 @item -p @var{port}
 @itemx --port=@var{port}
 @opindex -p
 @opindex --port
-Listen on given port (valid only in daemon mode).
+Listen on given port. (Applicable only in daemon mode.)
 
 @item -r
 @itemx --reverse-required
 @opindex -r
 @opindex --reverse-required
-Require reverse resolving of a remote host IP.
+Require reverse resolving of remote host's numerical IP.
+
+@item -S @var{name}
+@itemx --servername=@var{name}
+@opindex -S
+@opindex --servername
+Set Kerberos server name, overriding canonical hostname.
+
+@item -x
+@itemx --encrypt
+@opindex -x
+@opindex --encrypt
+Turns on encryption for all data passed via the @command{rlogind} session.
+This may impact response time and CPU utilization, but provides
+increased security.
 
 @end table
 
diff --git a/libinetutils/kcmd.c b/libinetutils/kcmd.c
index 1d1858b..5266b15 100644
--- a/libinetutils/kcmd.c
+++ b/libinetutils/kcmd.c
@@ -431,16 +431,16 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short rport, char *locuser,
 		    realm)) != SHISHI_OK)
     goto bad2;
 
-  if (locuser && locuser[0])
-    write (s, locuser, strlen (locuser) + 1);
-  else
-    write (s, *remuser, strlen (*remuser) + 1);
+  write (s, *remuser, strlen (*remuser) + 1);
 # endif	/* SHISHI */
 
   write (s, cmd, strlen (cmd) + 1);
 
 # ifdef SHISHI
-  write (s, *remuser, strlen (*remuser) + 1);
+  if (locuser && locuser[0])
+    write (s, locuser, strlen (locuser) + 1);
+  else
+    write (s, *remuser, strlen (*remuser) + 1);
   write (s, &zero, sizeof (int));	/* XXX: not protocol */
 # endif
 
diff --git a/src/rlogind.c b/src/rlogind.c
index 4af17cd..76e2a27 100644
--- a/src/rlogind.c
+++ b/src/rlogind.c
@@ -964,8 +964,8 @@ do_rlogin (int infd, struct auth_data *ap)
     }
 #endif /* WITH_IRUSEROK_AF || WITH_IRUSEROK */
 
-  getstr (infd, &ap->rusername, NULL);
-  getstr (infd, &ap->lusername, NULL);
+  getstr (infd, &ap->rusername, NULL);		/* Requesting user.  */
+  getstr (infd, &ap->lusername, NULL);		/* Acting user.  */
   getstr (infd, &ap->term, "TERM=");
 
   pwd = getpwnam (ap->lusername);
@@ -1293,9 +1293,9 @@ do_shishi_login (int infd, struct auth_data *ad, const char **err_msg)
     }
 #  endif
 
-  getstr (infd, &ad->rusername, NULL);
+  getstr (infd, &ad->lusername, NULL);		/* Acting user.  */
   getstr (infd, &ad->term, "TERM=");
-  getstr (infd, &ad->lusername, NULL);
+  getstr (infd, &ad->rusername, NULL);		/* Requesting user.  */
 
   rc = read (infd, &error, sizeof (int));	/* XXX: not protocol */
   if ((rc != sizeof (int)) || error)
diff --git a/src/rsh.c b/src/rsh.c
index d2dbe99..e01d662 100644
--- a/src/rsh.c
+++ b/src/rsh.c
@@ -156,7 +156,7 @@ static struct argp_option options[] = {
   { "encrypt", 'x', NULL, 0,
     "encrypt all data transfer" },
 #endif
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
   { "ipv4", '4', NULL, 0, "use only IPv4" },
   { "ipv6", '6', NULL, 0, "use only IPv6" },
 #endif
diff --git a/src/rshd.c b/src/rshd.c
index 30b87f6..3805d9a 100644
--- a/src/rshd.c
+++ b/src/rshd.c
@@ -86,7 +86,7 @@
  */
 
 /*
- * remote shell server exchange protocol (client view!):
+ * remote shell server exchange protocol (server view!):
  *	[port]\0
  *	remuser\0
  *	locuser\0
@@ -216,7 +216,7 @@ static struct argp_option options[] = {
   { "no-keepalive", 'n', NULL, 0,
     "do not set SO_KEEPALIVE" },
   { "log-sessions", 'L', NULL, 0,
-    "log successfull logins" },
+    "log successful logins" },
 #if defined KERBEROS || defined SHISHI
   /* FIXME: The option semantics does not match that of others r* utilities */
   { "kerberos", 'k', NULL, 0,
@@ -838,10 +838,10 @@ doit (int sockfd, struct sockaddr *fromp, socklen_t fromlen)
     }
   else
 #endif /* KERBEROS || SHISHI */
-    locuser = getstr ("locuser");
+    remuser = getstr ("remuser");	/* The requesting user!  */
 
   /* Read three strings from the client. */
-  remuser = getstr ("remuser");		/* The acting client!  */
+  locuser = getstr ("locuser");		/* The acting user!  */
   cmdbuf = getstr ("command");
 
 #ifdef SHISHI
@@ -916,7 +916,7 @@ doit (int sockfd, struct sockaddr *fromp, socklen_t fromlen)
 	  }
 # endif /* ENCRYPTION */
 
-    locuser = getstr ("locuser");	/* The agent here!  */
+    remuser = getstr ("remuser");	/* The requesting user!  */
 
     rc = read (STDIN_FILENO, &error, sizeof (int)); /* XXX: not protocol */
     if ((rc != sizeof (int)) || error)
@@ -1608,10 +1608,12 @@ doit (int sockfd, struct sockaddr *fromp, socklen_t fromlen)
       else
 #endif /* KERBEROS */
 	syslog (LOG_INFO | LOG_AUTH,
+		"%s%s@%s as %s: cmd='%.80s'",
 #ifdef SHISHI
-		"Kerberized "
+		use_kerberos ? "Kerberized " : "",
+#else
+		"",
 #endif
-		"%s@%s as %s: cmd='%.80s'",
 		remuser, hostname, locuser, cmdbuf);
     }
 #ifdef SHISHI

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

Summary of changes:
 ChangeLog           |   21 ++++
 doc/inetutils.texi  |  279 +++++++++++++++++++++++++++++++++------------------
 libinetutils/kcmd.c |   10 +-
 src/rlogind.c       |    8 +-
 src/rsh.c           |    2 +-
 src/rshd.c          |   16 ++--
 6 files changed, 223 insertions(+), 113 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Aug 08 06:20:17 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sz3NB-0005hO-Rl
	for mharc-commit-inetutils@gnu.org; Wed, 08 Aug 2012 06:20:17 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33917)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Sz3N5-0005gr-LC
	for commit-inetutils@gnu.org; Wed, 08 Aug 2012 06:20:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Sz3Mz-0005Q1-KC
	for commit-inetutils@gnu.org; Wed, 08 Aug 2012 06:20:11 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:36112)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Sz3Mz-0005PO-Fu
	for commit-inetutils@gnu.org; Wed, 08 Aug 2012 06:20:05 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1Sz3My-0002R1-6m
	for commit-inetutils@gnu.org; Wed, 08 Aug 2012 10:20:05 +0000
Date: Wed, 08 Aug 2012 10:20:04 +0000
Message-Id: <E1Sz3My-0002R1-6m@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-143-g7439cb7
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 3054a34cda7ced89f28fcaf3401097ee0b83cebc
X-Git-Newrev: 7439cb7c3df2b76759dd3ad65bcdf2ef99c799d4
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 08 Aug 2012 10:20: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  7439cb7c3df2b76759dd3ad65bcdf2ef99c799d4 (commit)
      from  3054a34cda7ced89f28fcaf3401097ee0b83cebc (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=7439cb7c3df2b76759dd3ad65bcdf2ef99c799d4


commit 7439cb7c3df2b76759dd3ad65bcdf2ef99c799d4
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Aug 8 11:49:48 2012 +0200

    Authorization type k5login.
    
    Enable k5login authorization in telnetd and
    rlogind/rshd for future versions of libshishi.

diff --git a/ChangeLog b/ChangeLog
index 6ed2ba5..897434f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2012-08-08  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	telnet: Support k5login authorization.
+
+	* libtelnet/misc.c (UserNameRequested): Assign
+	NULL, not naught.
+	* libtelnet/auth.c (authenticated): Likewise.
+	(authenticators) [SHISHI]: Remove two references
+	to krb5shishi_cleanup.
+	* libtelnet/shishi.c (krb5shishi_send): Check for
+	non-empty UserNameRequested as the very first action.
+	Add UserNameRequested to `HINT.client'.
+	(krb5shishi_reply): Call shishi_done(), and assign NULL
+	to `shishi_handle'.
+	(krb5shishi_status): Remove variables CNAME, CNAMELEN.
+	Replace call to shishi_encticketpart_client() with a call
+	to shishi_authorized_p().
+	(krb5shishi_is_auth): Check version of libshishi and call
+	shishi_cfg_authorizationtype_set() "k5login basic".
+	Replace a call to shishi_encticketpart_crealm() with a
+	call to shishi_encticketpart_clientrealm().
+	(krb5shishi_is): Remove debug print using puts().
+	(krb5shishi_printsub): Likewise.
+
+	rlogind, rshd: Support k5login authorization.
+
+	* libinetutils/shishi.c (get_auth): Check version
+	of libshishi and call shishi_cfg_authorizationtype_set()
+	with "k5login basic".
+
 2012-08-03  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	rlogind, rshd: Protocol exchange adherence.
diff --git a/TODO b/TODO
index 5ee5012..757daae 100644
--- a/TODO
+++ b/TODO
@@ -154,15 +154,9 @@ Ability to ping multiple host in one go.
   For example, if a system specific option shadows a normal option?
   Allow this?
 
-* ftpd
+* ftp, ftpd
 
-Complete the initiated rewrite for supporting IPv6.
-
-* tftpd
-
-OpenSolaris is only able to transmit a single package of
-size at most PKTSIZE. Debug libinetutils/tftpsubs.c on this.
-No issue with other systems.
+Implement libshishi support?
 
 * whois
 
diff --git a/libinetutils/shishi.c b/libinetutils/shishi.c
index 27c72f0..28996b1 100644
--- a/libinetutils/shishi.c
+++ b/libinetutils/shishi.c
@@ -293,6 +293,17 @@ get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
   else
     servername = shishi_server_for_local_service (*handle, SERVICE);
 
+  /* Enable use of `~/.k5login'.  */
+  if (shishi_check_version ("1.0.2"))	/* Faulty in version 1.0.1.  */
+    {
+      rc = shishi_cfg_authorizationtype_set (*handle, "k5login basic");
+      if (rc != SHISHI_OK)
+	{
+	  *err_msg = shishi_error (*handle);
+	  return rc;
+	}
+    }
+
   key = shishi_hostkeys_for_server (*handle, servername);
   free (servername);
   if (!key)
diff --git a/libtelnet/auth.c b/libtelnet/auth.c
index 886b0ef..753377d 100644
--- a/libtelnet/auth.c
+++ b/libtelnet/auth.c
@@ -118,7 +118,7 @@ extern rsaencpwd_printsub ();
 int auth_debug_mode = 0;
 static char *Name = "Noname";
 static int Server = 0;
-static TN_Authenticator *authenticated = 0;
+static TN_Authenticator *authenticated = NULL;
 static int authenticating = 0;
 static int validuser = 0;
 static unsigned char _auth_send_data[256];
@@ -154,7 +154,7 @@ TN_Authenticator authenticators[] = {
    krb5shishi_reply,
    krb5shishi_status,
    krb5shishi_printsub,
-   krb5shishi_cleanup},
+  },
   {AUTHTYPE_KERBEROS_V5, AUTH_WHO_CLIENT | AUTH_HOW_ONE_WAY,
    krb5shishi_init,
    krb5shishi_send,
@@ -162,7 +162,7 @@ TN_Authenticator authenticators[] = {
    krb5shishi_reply,
    krb5shishi_status,
    krb5shishi_printsub,
-   krb5shishi_cleanup},
+  },
 # endif
 # ifdef	KRB5
 #  ifdef	ENCRYPTION
@@ -245,7 +245,7 @@ auth_init (char *name, int server)
   Name = name;
 
   i_support = 0;
-  authenticated = 0;
+  authenticated = NULL;
   authenticating = 0;
   while (ap->type)
     {
diff --git a/libtelnet/misc.c b/libtelnet/misc.c
index 4708302..0385040 100644
--- a/libtelnet/misc.c
+++ b/libtelnet/misc.c
@@ -58,7 +58,7 @@
 
 char *RemoteHostName;
 char *LocalHostName;
-char *UserNameRequested = 0;
+char *UserNameRequested = NULL;
 
 void
 auth_encrypt_init (char *local, char *remote, char *name, int server)
@@ -66,7 +66,7 @@ auth_encrypt_init (char *local, char *remote, char *name, int server)
   RemoteHostName = remote;
   LocalHostName = local;
   (void) name;
-  (void) server;		/* shutup gcc */
+  (void) server;		/* silence gcc */
 #if defined AUTHENTICATION
   auth_init (name, server);
 #endif
@@ -74,7 +74,7 @@ auth_encrypt_init (char *local, char *remote, char *name, int server)
   encrypt_init (name, server);
 #endif /* ENCRYPTION */
   free (UserNameRequested);
-  UserNameRequested = 0;
+  UserNameRequested = NULL;
 }
 
 void
@@ -83,13 +83,13 @@ auth_encrypt_user (char *name)
   extern char *strdup (const char *);
 
   free (UserNameRequested);
-  UserNameRequested = name ? strdup (name) : 0;
+  UserNameRequested = name ? strdup (name) : NULL;
 }
 
 void
 auth_encrypt_connect (int cnt)
 {
-  (void) cnt;			/*shutup gcc */
+  (void) cnt;			/* silence gcc */
 }
 
 void
diff --git a/libtelnet/shishi.c b/libtelnet/shishi.c
index 17c9c3e..a90e40e 100644
--- a/libtelnet/shishi.c
+++ b/libtelnet/shishi.c
@@ -155,6 +155,12 @@ krb5shishi_send (TN_Authenticator * ap)
   char *apreq;
   size_t apreq_len;
 
+  if (!UserNameRequested)
+    {
+      DEBUG (("telnet: Kerberos V5: no user name supplied\r\n"));
+      return 0;
+    }
+
   if (!delayed_shishi_init ())
     {
       DEBUG (("telnet: Kerberos V5: shishi initialization failed\r\n"));
@@ -170,6 +176,7 @@ krb5shishi_send (TN_Authenticator * ap)
   sprintf (tmp, "host/%s", RemoteHostName);
   memset (&hint, 0, sizeof (hint));
   hint.server = tmp;
+  hint.client = UserNameRequested;
 
   if (dest_realm && *dest_realm)
     shishi_realm_default_set (shishi_handle, dest_realm);
@@ -185,12 +192,6 @@ krb5shishi_send (TN_Authenticator * ap)
   if (auth_debug_mode)
     shishi_tkt_pretty_print (tkt, stdout);
 
-  if (!UserNameRequested)
-    {
-      DEBUG (("telnet: Kerberos V5: no user name supplied\r\n"));
-      return 0;
-    }
-
   if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL)
     ap_opts = SHISHI_APOPTIONS_MUTUAL_REQUIRED;
   else
@@ -333,7 +334,11 @@ krb5shishi_reply (TN_Authenticator * ap, unsigned char *data, int cnt)
 		" (server authenticated)" : " (server NOT authenticated)");
       else
 	printf ("[ Kerberos V5 accepts you ]\r\n");
+
       auth_finished (ap, AUTH_USER);
+      /* This was last access to handle on behalf of the client.  */
+      shishi_done (shishi_handle);
+      shishi_handle = NULL;
       break;
 
     case KRB_RESPONSE:
@@ -370,23 +375,16 @@ krb5shishi_reply (TN_Authenticator * ap, unsigned char *data, int cnt)
 int
 krb5shishi_status (TN_Authenticator * ap, char *name, int level)
 {
-  char *cname;
-  int cnamelen;
   int rc;
   int status;
 
   if (level < AUTH_USER)
     return level;
 
-  rc = shishi_encticketpart_client
-    (shishi_handle,
-     shishi_tkt_encticketpart (shishi_ap_tkt (auth_handle)),
-     &cname, &cnamelen);
-
   if (UserNameRequested
-      && rc == SHISHI_OK
-      && cnamelen == strlen (UserNameRequested)
-      && memcmp (UserNameRequested, cname, cnamelen) == 0)
+      && shishi_authorized_p (shishi_handle,
+			      shishi_ap_tkt (auth_handle),
+			      UserNameRequested))
     {
       /* FIXME: Check buffer length */
       strcpy (name, UserNameRequested);
@@ -394,7 +392,7 @@ krb5shishi_status (TN_Authenticator * ap, char *name, int level)
     }
   else
     status = AUTH_USER;
-  free (cname);
+
   return status;
 }
 
@@ -416,6 +414,19 @@ krb5shishi_is_auth (TN_Authenticator * a, unsigned char *data, int cnt,
       return 0;
     }
 
+  /* Enable use of `~/.k5login'.  */
+  if (shishi_check_version ("1.0.2"))	/* Faulty in version 1.0.1.  */
+    {
+      rc = shishi_cfg_authorizationtype_set (shishi_handle, "k5login basic");
+      if (rc != SHISHI_OK)
+	{
+	  snprintf (errbuf, errbuflen,
+		    "Cannot initiate authorization types: %s",
+		    shishi_error (shishi_handle));
+	  return rc;
+	}
+    }
+
   rc = shishi_ap (shishi_handle, &auth_handle);
   if (rc != SHISHI_OK)
     {
@@ -477,10 +488,10 @@ krb5shishi_is_auth (TN_Authenticator * a, unsigned char *data, int cnt,
       free (der);
     }
 
-  rc = shishi_encticketpart_crealm (shishi_handle,
-				    shishi_tkt_encticketpart (shishi_ap_tkt
-							      (auth_handle)),
-				    &cnamerealm, &cnamerealmlen);
+  rc = shishi_encticketpart_clientrealm (
+		shishi_handle,
+		shishi_tkt_encticketpart (shishi_ap_tkt (auth_handle)),
+		&cnamerealm, &cnamerealmlen);
   if (rc != SHISHI_OK)
     {
       snprintf (errbuf, errbuflen, "Error getting authenticator name: %s\n",
@@ -493,6 +504,11 @@ krb5shishi_is_auth (TN_Authenticator * a, unsigned char *data, int cnt,
   free (cnamerealm);
   auth_finished (a, AUTH_USER);
 
+  /* Make sure that shishi_handle is still valid,
+   * it must not be released in auth_finish()!
+   * The server side will make reference to it
+   * later on.  */
+
 # ifdef ENCRYPTION
   if (enckey)
     {
@@ -540,8 +556,6 @@ krb5shishi_is (TN_Authenticator * ap, unsigned char *data, int cnt)
   int r = 0;
   char errbuf[512];
 
-  puts ("krb5shishi_is");
-
   if (cnt-- < 1)
     return;
   errbuf[0] = 0;
@@ -597,8 +611,6 @@ krb5shishi_printsub (unsigned char *data, int cnt,
   char *p;
   int i;
 
-  puts ("krb5shishi_printsub");
-
   buf[buflen - 1] = '\0';	/* make sure its NULL terminated */
   buflen -= 1;
 

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

Summary of changes:
 ChangeLog             |   30 +++++++++++++++++++++++
 TODO                  |   10 +------
 libinetutils/shishi.c |   11 ++++++++
 libtelnet/auth.c      |    8 +++---
 libtelnet/misc.c      |   10 ++++----
 libtelnet/shishi.c    |   62 +++++++++++++++++++++++++++++-------------------
 6 files changed, 89 insertions(+), 42 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Aug 08 11:51:32 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sz8Xk-0006xs-NZ
	for mharc-commit-inetutils@gnu.org; Wed, 08 Aug 2012 11:51:32 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35574)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Sz8Xi-0006xO-HD
	for commit-inetutils@gnu.org; Wed, 08 Aug 2012 11:51:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Sz8Xd-00058L-GV
	for commit-inetutils@gnu.org; Wed, 08 Aug 2012 11:51:30 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:39272)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1Sz8Xd-00057f-CI
	for commit-inetutils@gnu.org; Wed, 08 Aug 2012 11:51:25 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1Sz8Xc-0002LW-P3
	for commit-inetutils@gnu.org; Wed, 08 Aug 2012 15:51:24 +0000
Date: Wed, 08 Aug 2012 15:51:24 +0000
Message-Id: <E1Sz8Xc-0002LW-P3@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-144-g4d2aaa9
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 7439cb7c3df2b76759dd3ad65bcdf2ef99c799d4
X-Git-Newrev: 4d2aaa93c549f6f8951cfea2ec0f2ac347e8f77d
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 08 Aug 2012 15:51:31 -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  4d2aaa93c549f6f8951cfea2ec0f2ac347e8f77d (commit)
      from  7439cb7c3df2b76759dd3ad65bcdf2ef99c799d4 (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=4d2aaa93c549f6f8951cfea2ec0f2ac347e8f77d


commit 4d2aaa93c549f6f8951cfea2ec0f2ac347e8f77d
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Aug 8 17:49:11 2012 +0200

    Documentation (silent change)

diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index c1b67c8..7601ebd 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -2172,63 +2172,100 @@ telnet [@var{OPTION}...] [@var{HOST} [@var{PORT}]]
 @table @option
 @item -4
 @itemx --ipv4
+@opindex -4
+@opindex --ipv4
 Use only IPv4.
 
 @item -6
 @itemx --ipv6
+@opindex -6
+@opindex --ipv6
 Use only IPv6.
 
 @item -8
 @itemx --binary
+@opindex -8
+@opindex --binary
 Use an 8-bit data path.
 
 @item -a
 @itemx --login
+@opindex -a
+@opindex --login
 Attempt automatic login.
 
 @item -c
 @itemx --no-rc
+@opindex -c
+@opindex --no-rc
 Do not read the user's file @file{$HOME/.telnetrc}.
 
 @item -d
 @itemx --debug
-Turn on debugging.
+@opindex -d
+@opindex --debug
+Turn on socket level debugging.
 
-@item -e CHAR
-@itemx --escape=CHAR
-Use CHAR as escape character.
+@item -e @var{char}
+@itemx --escape=@var{char}
+@opindex -e
+@opindex --escape
+Use @var{char} as escape character.
 
 @item -E
 @itemx --no-escape
-Use no escape character.
+@opindex -E
+@opindex --no-escape
+Do not use an escape character.
+
+@item -k @var{realm}
+@itemx --realm=@var{realm}
+@opindex -k
+@opindex --realm
+Request Kerberos realm @var{realm} instead of whatever is
+declared as default realm in the system's or user's settings.
 
 @item -K
 @itemx --no-login
+@opindex -K
+@opindex --no-login
 Do not automatically login to the remote system.
 
-@item -l USER
-@itemx --user=USER
-Attempt automatic login as USER.
+@item -l @var{user}
+@itemx --user=@var{user}
+@opindex -l
+@opindex --user
+Attempt automatic login as @var{user}.
 
 @item -L
 @itemx --binary-output
+@opindex -L
+@opindex --binary-output
 Use an 8-bit data path for output only.
 
-@item -n FILE
-@itemx --trace=FILE
-Record trace information into FILE.
+@item -n @var{file}
+@itemx --trace=@var{file}
+@opindex -n
+@opindex --trace
+Record trace information into @var{file}.
 
 @item -r
 @itemx --rlogin
+@opindex -r
+@opindex --rlogin
 Display a user-interface similar to that of @command{rlogin}.
 
 @item -x
 @itemx --encrypt
+@opindex -x
+@opindex --encrypt
 If possible, encrypt the data stream.
 
-@item -X ATYPE
-@itemx --disable-auth=ATYPE
-Disable authentication of type ATYPE.
+@item -X @var{atype}
+@itemx --disable-auth=@var{atype}
+@opindex -X
+@opindex --disable-auth
+Disable authentication of type @var{atype}.
 Use this option multiple times if more than one type
 is to be disabled.  Standard choices are @samp{null},
 @samp{kerberos_v4}, and @samp{kerberos_v5}.
@@ -3668,15 +3705,19 @@ telnetd [@var{option}]@dots{}
 @end example
 
 @table @option
-@item -a AUTHMODE
-@itemx --authmode=AUTHMODE
+@item -a @var{authmode}
+@itemx --authmode=@var{authmode}
+@opindex -a
+@opindex --authmode
 Specify what mode to use for authentication.  Allowed values are:
 @samp{none}, @samp{other}, @samp{user}, @samp{valid}, and @samp{off}.
 
-@item -D[LEVEL]
-@itemx --debug=[LEVEL]
+@item -D[@var{list}]
+@itemx --debug=[@var{list}]
+@opindex -D
+@opindex --debug
 Set the debugging level.  The argument is a comma separated list of
-the categories: @samp{options}, @samp{report}, @samp{netdata},
+these categories: @samp{options}, @samp{report}, @samp{netdata},
 @samp{ptydata}, and @samp{auth}.  All these may be used in the form
 @samp{name[=level]}.  Omission of @samp{level} implies the maximal
 possible debugging for that particular category.
@@ -3689,30 +3730,42 @@ complete traffic.
 The outcome is the file @file{/tmp/telnet.debug}, to which
 data is incrementally added as time passes.
 
-@item -E STRING
-@itemx --exec-login=STRING
+@item -E @var{string}
+@itemx --exec-login=@var{string}
+@opindex -E
+@opindex --exec-login
 Set program to be executed instead of @command{/bin/login}.
 
 @item -h
 @itemx --no-hostinfo
+@opindex -h
+@opindex --no-hostinfo
 Do not print host information before login has been completed.
 
-@item -l[MODE]
-@itemx --linemode=[MODE]
-Set line mode.  An empty argument will force line mode at all times.
+@item -l[@var{mode}]
+@itemx --linemode=[@var{mode}]
+@opindex -l
+@opindex --linemode
+Set line mode.  An empty argument will force line read mode at all times.
 The only recognised value is otherwise @samp{nokludge}.
 
 @item -n
 @itemx --no-keepalive
+@opindex -n
+@opindex --no-keepalive
 Disable TCP keep-alives.
 
 @item -U
 @itemx --reverse-lookup
+@opindex -U
+@opindex --reverse-lookup
 Refuse connections from addresses that cannot be mapped back into a
 symbolic name.
 
-@item -X AUTHTYPE
-@itemx --disable-auth-type=AUTHTYPE
+@item -X @var{authtype}
+@itemx --disable-auth-type=@var{authtype}
+@opindex -X
+@opindex --disable-auth-type
 Disable the use of the given authentication type.
 Use this option multiple times if more than one type
 is to be disabled.  Standard choices are @samp{null},

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

Summary of changes:
 doc/inetutils.texi |  105 +++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 79 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Aug 09 05:50:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SzPNe-0003CC-8x
	for mharc-commit-inetutils@gnu.org; Thu, 09 Aug 2012 05:50:14 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48409)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SzPNc-0003C4-1y
	for commit-inetutils@gnu.org; Thu, 09 Aug 2012 05:50:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SzPNa-0000kU-K6
	for commit-inetutils@gnu.org; Thu, 09 Aug 2012 05:50:11 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:44020)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SzPNa-0000kO-GJ
	for commit-inetutils@gnu.org; Thu, 09 Aug 2012 05:50:10 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1SzPNZ-00018o-Oi
	for commit-inetutils@gnu.org; Thu, 09 Aug 2012 09:50:09 +0000
Date: Thu, 09 Aug 2012 09:50:09 +0000
Message-Id: <E1SzPNZ-00018o-Oi@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-145-g0b06c88
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 4d2aaa93c549f6f8951cfea2ec0f2ac347e8f77d
X-Git-Newrev: 0b06c88a50954e0671f834985a38bbe2a53881f4
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 09 Aug 2012 09:50:13 -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  0b06c88a50954e0671f834985a38bbe2a53881f4 (commit)
      from  4d2aaa93c549f6f8951cfea2ec0f2ac347e8f77d (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=0b06c88a50954e0671f834985a38bbe2a53881f4


commit 0b06c88a50954e0671f834985a38bbe2a53881f4
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Aug 9 09:41:16 2012 +0200

    Update makefile templates.

diff --git a/ChangeLog b/ChangeLog
index 897434f..a06663d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-08-09  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	Make building successful on FreeBSD 9.0.
+
+	* paths (PATH_UTMP): Add `/var/run/utx.active'.
+	(PATH_WTMP): Add `/var/log/utx.log'.
+	* src/Makefile.am (AM_CPPFLAGS): Add $(PATHDEF_UTMPX).
+	* talkd/Makefile.am (AM_CPPFLAGS): Add $(PATHDEF_UTMP)
+	and $(PATHDEF_UTMPX).
+
 2012-08-08  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	telnet: Support k5login authorization.
diff --git a/paths b/paths
index 7e6a24f..6afb639 100644
--- a/paths
+++ b/paths
@@ -83,9 +83,9 @@ PATH_FTPDPID	$(localstatedir)/run/ftpd.pid
 PATH_INETDCONF	$(sysconfdir)/inetd.conf
 PATH_INETDDIR	$(sysconfdir)/inetd.d
 PATH_INETDPID	$(localstatedir)/run/inetd.pid
-PATH_UTMP	<utmp.h> <utmp.h>:UTMP_FILE $(localstatedir)/run/utmp search:utmp:/var/run:/var/adm:/etc
+PATH_UTMP	<utmp.h> <utmp.h>:UTMP_FILE $(localstatedir)/run/utmp search:utmp:/var/run:/var/adm:/etc "/var/run/utx.active"
 PATH_UTMPX	<utmpx.h> <utmpx.h>:UTMPX_FILE $(localstatedir)/run/utmpx search:utmpx:/var/run:/var/adm:/etc "/var/run/utx.active"
-PATH_WTMP	<utmp.h> <utmp.h>:WTMP_FILE $(localstatedir)/log/wtmp search:wtmp:/var/log:/var/adm:/etc
+PATH_WTMP	<utmp.h> <utmp.h>:WTMP_FILE $(localstatedir)/log/wtmp search:wtmp:/var/log:/var/adm:/etc "/var/log/utx.log"
 PATH_WTMPX	<utmpx.h> <utmpx.h>:WTMPX_FILE $(localstatedir)/log/wtmpx search:wtmpx:/var/log:/var/adm:/etc "/var/log/utx.log"
 PATH_LASTLOG	<utmp.h> $(localstatedir)/log/lastlog search:lastlog:/var/log:/var/adm:/etc "/var/log/utx.lastlogin"
 PATH_LOG	<syslog.h> /dev/log
diff --git a/src/Makefile.am b/src/Makefile.am
index c108668..718c75e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -102,7 +102,7 @@ EXTRA_PROGRAMS += uucpd
 
 INCLUDES = $(iu_INCLUDES) $(INCAUTH) -I$(top_srcdir)/libicmp
 
-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_UTMP) $(PATHDEF_UUCICO)
+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_UTMP) $(PATHDEF_UTMPX) $(PATHDEF_UUCICO)
 
 SUIDMODE = -o root -m 4775
 
diff --git a/talkd/Makefile.am b/talkd/Makefile.am
index 33372ec..320f52c 100644
--- a/talkd/Makefile.am
+++ b/talkd/Makefile.am
@@ -35,6 +35,6 @@ talkd_SOURCES = \
 
 @PATHDEFS_MAKE@
 
-AM_CPPFLAGS = $(PATHDEF_DEV)
+AM_CPPFLAGS = $(PATHDEF_DEV) $(PATHDEF_UTMP) $(PATHDEF_UTMPX)
 INCLUDES = $(iu_INCLUDES)
 LDADD = $(iu_LIBRARIES)

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

Summary of changes:
 ChangeLog         |   10 ++++++++++
 paths             |    4 ++--
 src/Makefile.am   |    2 +-
 talkd/Makefile.am |    2 +-
 4 files changed, 14 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Aug 09 08:22:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SzRlT-000509-Md
	for mharc-commit-inetutils@gnu.org; Thu, 09 Aug 2012 08:22:59 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47993)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SzRlR-000503-CF
	for commit-inetutils@gnu.org; Thu, 09 Aug 2012 08:22:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SzRlL-0001Ii-DP
	for commit-inetutils@gnu.org; Thu, 09 Aug 2012 08:22:57 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:60639)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1SzRlL-0001IC-9l
	for commit-inetutils@gnu.org; Thu, 09 Aug 2012 08:22:51 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1SzRlK-0007zp-Tc
	for commit-inetutils@gnu.org; Thu, 09 Aug 2012 12:22:51 +0000
Date: Thu, 09 Aug 2012 12:22:50 +0000
Message-Id: <E1SzRlK-0007zp-Tc@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-146-g2a1bd6e
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 0b06c88a50954e0671f834985a38bbe2a53881f4
X-Git-Newrev: 2a1bd6e98f4bbc401ea792b2158df4a17e23616b
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 09 Aug 2012 12:22:58 -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  2a1bd6e98f4bbc401ea792b2158df4a17e23616b (commit)
      from  0b06c88a50954e0671f834985a38bbe2a53881f4 (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=2a1bd6e98f4bbc401ea792b2158df4a17e23616b


commit 2a1bd6e98f4bbc401ea792b2158df4a17e23616b
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Aug 9 14:21:55 2012 +0200

    Test script update.

diff --git a/ChangeLog b/ChangeLog
index a06663d..f6b7fa8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-08-09  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	* tests/tftp.sh: Use evaluation `${VERBOSE:+-v}'
+	to handle empty string uniformly.
+
+2012-08-09  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	Make building successful on FreeBSD 9.0.
 
 	* paths (PATH_UTMP): Add `/var/run/utx.active'.
diff --git a/tests/tftp.sh b/tests/tftp.sh
index 88bd164..c9c66dc 100755
--- a/tests/tftp.sh
+++ b/tests/tftp.sh
@@ -303,7 +303,7 @@ for addr in $ADDRESSES; do
     for name in $FILELIST; do
 	EFFORTS=`expr $EFFORTS + 1`
 	rm -f $name
-	echo "get $name" | "$TFTP" ${VERBOSE+-v} "$addr" $PORT
+	echo "get $name" | "$TFTP" ${VERBOSE:+-v} "$addr" $PORT
 
 	cmp "$TMPDIR/tftp-test/$name" "$name" 2>/dev/null
 	result=$?
@@ -350,7 +350,7 @@ if $do_conf_reload; then
     for addr in $ADDRESSES; do
 	EFFORTS=`expr $EFFORTS + 1`
 	test -f "$name" && rm "$name"
-	echo "get $name" | "$TFTP" ${VERBOSE+-v} "$addr" $PORT
+	echo "get $name" | "$TFTP" ${VERBOSE:+-v} "$addr" $PORT
 	cmp "$TMPDIR/tftp-test/$name" "$name" 2>/dev/null
 	result=$?
 	if test $result -ne 0; then

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

Summary of changes:
 ChangeLog     |    5 +++++
 tests/tftp.sh |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Tue Aug 14 20:47:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T1RlM-0004a0-Mr
	for mharc-commit-inetutils@gnu.org; Tue, 14 Aug 2012 20:47:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50715)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T1RlJ-0004ZV-AF
	for commit-inetutils@gnu.org; Tue, 14 Aug 2012 20:47:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T1RlG-0004y5-FN
	for commit-inetutils@gnu.org; Tue, 14 Aug 2012 20:47:05 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:46148)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T1RlG-0004y0-BD
	for commit-inetutils@gnu.org; Tue, 14 Aug 2012 20:47:02 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1T1RlF-0008PK-Ki
	for commit-inetutils@gnu.org; Wed, 15 Aug 2012 00:47:01 +0000
Date: Wed, 15 Aug 2012 00:47:01 +0000
Message-Id: <E1T1RlF-0008PK-Ki@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-147-ga7a5c3e
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 2a1bd6e98f4bbc401ea792b2158df4a17e23616b
X-Git-Newrev: a7a5c3ec659145ff8f31798f351fcd180cbc36c0
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 15 Aug 2012 00:47:07 -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  a7a5c3ec659145ff8f31798f351fcd180cbc36c0 (commit)
      from  2a1bd6e98f4bbc401ea792b2158df4a17e23616b (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=a7a5c3ec659145ff8f31798f351fcd180cbc36c0


commit a7a5c3ec659145ff8f31798f351fcd180cbc36c0
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Aug 15 02:44:41 2012 +0200

    Refine r-commands with libshishi.

diff --git a/ChangeLog b/ChangeLog
index f6b7fa8..d330172 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,63 @@
+2012-08-15  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	rcp, rlogin, rsh: Host names with instances.
+
+	* libinetutils/kcmd.c (kcmd) [SHISHI]: New variable HOST.
+	Whenever `*ahost' contains a slash, separate the true host
+	name into HOST.  Use HOST in resolver, and reconstruct
+	Kerberos principal as `*ahost' afterwards.
+	* libinetutils/shishi.c (shishi_auth): New variable P.
+	Check `sname' for a slash in principal name, and construct
+	TMPSERVER with prefix "host/" if needed.
+	* src/rcp.c (kerberos) <no Kerberos service>: New variable P.
+	Strip prefix like `host/' from HOST.
+	* src/rlogin.c (main): Likewise.
+	* src/rsh.c (main): Likewise.
+
+	rlogind, rshd: Qualified Kerberos server names.
+
+	* libinetutils/shishi.c (get_auth): New variables SERVER
+	and REALM.  Decompose `srvname' using shishi_parse_name().
+	Construct SERVERNAME with prefix "host/" if needed.  Use
+	shishi_realm_default_set() to set realm if present.
+	* src/rlogind.c (options) [KERBEROS || SHISHI]: Rename
+	long option name `--servername' as `--server-principal'.
+	* src/rshd.c (options) [KERBEROS || SHISHI]: Likewise.
+
+	* src/rlogin.c (main) <try_connect> [KERBEROS]: Declare HP
+	and use gethostbyname() only for KERBEROS.
+	* src/rsh.c (main) [KERBEROS]: Likewise.
+
+	rcp, rlogin, rsh: Aborting Kerberized services.
+
+	* src/rcp.c (kerberos) [KERBEROS || SHISHI]: Fail with error
+	if Kerberos authentication fails.  Degrade to plain service
+	only on ECONNREFUSED.  Resolve service `shell/tcp' only in
+	this latter case.
+	* src/rlogin.c (main) [KERBEROS || SHISHI]: Likewise.
+	* src/rsh.c (main) [KERBEROS || SHISHI]: Likewise.
+
+	Error message handling.
+
+	* libinetutils/krcmd.c (krcmd_mutual) [SHISHI]: Report
+	errors using shishi_strerror().
+	* libinetutils/shishi.c (shishi_auth) <failed verification>:
+	Write a null character at the end of the received error
+	message, not at buffer end.
+	* src/rshd.c (doit) [SHISHI] <authentication failure>:
+	Check `err_msg && *err_msg' before use in rshd_error().
+
+	Conditionals for extra features.
+
+	* src/rcp.c (family) [WITH_ORCMD_AF || WITH_RCMD_AF || SHISHI]:
+	Add SHISHI to conditional.
+	(options, parse_opt) [WITH_ORCMD_AF || WITH_RCMD_AF || SHISHI]:
+	Add SHISHI as provider of `--ipv4' and `--ipv6'.
+	* src/rlogin.c: Likewise.
+	* src/rsh.c: Likewise.
+	(options) [(KERBEROS || SHISHI) && ENCRYPTION]: Condition
+	`-x/--encrypt' on ENCRYPTION.
+
 2012-08-09  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* tests/tftp.sh: Use evaluation `${VERBOSE:+-v}'
diff --git a/libinetutils/kcmd.c b/libinetutils/kcmd.c
index 5266b15..7edca38 100644
--- a/libinetutils/kcmd.c
+++ b/libinetutils/kcmd.c
@@ -127,7 +127,7 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short rport, char *locuser,
   struct hostent *hp;
 # endif
   int rc;
-  char *host_save;
+  char *host_save, *host;
   int status;
 
 # if defined SHISHI
@@ -136,6 +136,13 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short rport, char *locuser,
 
   pid = getpid ();
 
+  /* Extract Kerberos instance name.  */
+  host = strchr (*ahost, '/');
+  if (host)
+    ++host;
+  else
+    host = *ahost;
+
 # ifdef HAVE_DECL_GETADDRINFO
   memset (&hints, 0, sizeof (hints));
   hints.ai_family = af;
@@ -143,10 +150,10 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short rport, char *locuser,
   hints.ai_flags = AI_CANONNAME;
   snprintf (portstr, sizeof (portstr), "%hu", ntohs (rport));
 
-  rc = getaddrinfo (*ahost, portstr, &hints, &res);
+  rc = getaddrinfo (host, portstr, &hints, &res);
   if (rc)
     {
-      fprintf (stderr, "kcmd: host %s: %s\n", *ahost, gai_strerror (rc));
+      fprintf (stderr, "kcmd: host %s: %s\n", host, gai_strerror (rc));
       return (-1);
     }
 
@@ -173,10 +180,10 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short rport, char *locuser,
 # else /* !HAVE_DECL_GETADDRINFO */
   /* Often the following rejects non-IPv4.
    * This is dependent on system implementation.  */
-  hp = gethostbyname (*ahost);
+  hp = gethostbyname (host);
   if (hp == NULL)
     {
-      /* fprintf(stderr, "%s: unknown host\n", *ahost); */
+      /* fprintf(stderr, "%s: unknown host\n", host); */
       return (-1);
     }
 
@@ -186,7 +193,24 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short rport, char *locuser,
   strcpy (host_save, hp->h_name);
 # endif /* !HAVE_DECL_GETADDRINFO */
 
-  *ahost = host_save;
+  if (host == *ahost)
+    *ahost = host_save;		/* Simple host name string.  */
+  else
+    {
+      /* Server name `*ahost' is a Kerberized name.  */
+      char *p;
+
+      p = malloc ((host - *ahost) + strlen (host_save) + 1);
+      if (p == NULL)
+	return (-1);
+
+      /* Extract prefix from `*ahost', excluding slash,
+       * and concatenate the host's canonical name, but
+       * preceeded by a slash.
+       */
+      sprintf (p, "%.*s/%s", host - *ahost - 1, *ahost, host_save);
+      *ahost = p;
+    }
 
 # ifdef KERBEROS
   /* If realm is null, look up from table */
diff --git a/libinetutils/krcmd.c b/libinetutils/krcmd.c
index 6e8ee35..4611273 100644
--- a/libinetutils/krcmd.c
+++ b/libinetutils/krcmd.c
@@ -213,7 +213,8 @@ krcmd_mutual (Shishi ** h, char **ahost, unsigned short rport, char **remuser,
 
   if (err > SHISHI_OK)
     {
-      fprintf (stderr, "krcmd_mutual: %s\n", "error");
+      fprintf (stderr, "krcmd_mutual: error %d, %s\n",
+	       err, shishi_strerror (err));
       return (-1);
     }
 
diff --git a/libinetutils/shishi.c b/libinetutils/shishi.c
index 28996b1..d023081 100644
--- a/libinetutils/shishi.c
+++ b/libinetutils/shishi.c
@@ -40,7 +40,7 @@ shishi_auth (Shishi ** handle, int verbose, char **cname,
   Shishi *h;
 
   int rc;
-  char *out;
+  char *out, *p;
   size_t outlen;
   int krb5len, msglen;
   char *tmpserver;
@@ -93,8 +93,15 @@ shishi_auth (Shishi ** handle, int verbose, char **cname,
   read (sock, &auth, 1);
   if (auth)
     {
-      read (sock, errormsg, 100);
-      errormsg[100] = '\0';
+      ssize_t n;
+
+      errormsg[0] = '\0';
+      n = read (sock, errormsg, sizeof (errormsg) - 1);
+
+      if (n >= 0 && n < sizeof (errormsg))
+	errormsg[n] = '\0';
+      else
+	errormsg[sizeof (errormsg) -1] = '\0';
 
       fprintf (stderr, "Error during server authentication : %s\n", errormsg);
       return SHISHI_VERIFY_FAILED;
@@ -116,9 +123,12 @@ shishi_auth (Shishi ** handle, int verbose, char **cname,
       perror ("shishi_auth()");
       return SHISHI_TOO_SMALL_BUFFER;
     }
-  strcpy (tmpserver, SERVICE);
-  strcat (tmpserver, "/");
-  strcat (tmpserver, sname);
+
+  p = strchr (sname, '/');
+  if (p && (p != sname))
+    strcpy (tmpserver, sname);	/* Non-empty prefix.  */
+  else
+    sprintf (tmpserver, "%s/%s", SERVICE, sname + (p ? 1 : 0));
 
   hint.client = (char *) *cname;
   hint.server = (char *) tmpserver;
@@ -264,7 +274,7 @@ get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
   char krb5kcmd1[] = "KCMDV0.1";
   char krb5kcmd2[] = "KCMDV0.2";
   int auth_correct = 0;
-  char *servername;
+  char *servername, *server, *realm;
 
   *err_msg = NULL;
   /* Get key for the server. */
@@ -280,19 +290,40 @@ get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
   if (rc != SHISHI_OK)
     return rc;
 
-  if (srvname && *srvname)
+  rc = shishi_parse_name (*handle, srvname, &server, &realm);
+  if (rc != SHISHI_OK)
     {
-      servername = malloc (sizeof (SERVICE) + strlen (srvname) + 2);
+      *err_msg = shishi_strerror (rc);
+      return rc;
+    }
+
+  if (server && *server)
+    {
+      char *p;
+
+      servername = malloc (sizeof (SERVICE) + strlen (server) + 2);
       if (!servername)
 	{
 	  *err_msg = "Not enough memory";
 	  return SHISHI_TOO_SMALL_BUFFER;
 	}
-      sprintf (servername, "%s/%s", SERVICE, srvname);
+
+      p = strchr (server, '/');
+      if (p && (p != server))
+	sprintf (servername, "%s", server);	/* Non-empty prefix.  */
+      else
+	sprintf (servername, "%s/%s", SERVICE,
+		 server + (p ? 1 : 0));	/* Remove initial slash.  */
     }
   else
     servername = shishi_server_for_local_service (*handle, SERVICE);
 
+  if (realm && *realm)
+    shishi_realm_default_set (*handle, realm);
+
+  free (server);
+  free (realm);
+
   /* Enable use of `~/.k5login'.  */
   if (shishi_check_version ("1.0.2"))	/* Faulty in version 1.0.1.  */
     {
diff --git a/src/rcp.c b/src/rcp.c
index c0460a2..3518a71 100644
--- a/src/rcp.c
+++ b/src/rcp.c
@@ -146,7 +146,7 @@ const char arg_doc[] = "SOURCE DEST\n"
 int preserve_option;
 int from_option, to_option;
 int iamremote, iamrecursive, targetshouldbedirectory;
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
 sa_family_t family = AF_UNSPEC;
 #endif
 
@@ -166,7 +166,7 @@ static struct argp_option options[] = {
     "turns off all Kerberos authentication",
     GRID+1 },
   { "realm", 'k', "REALM", 0,
-    "obtain tickets for the remote host in REALM instead of the remote host's realm",
+    "obtain tickets for a remote host in REALM instead of the remote host's realm",
     GRID+1 },
 #endif
 #ifdef ENCRYPTION
@@ -183,14 +183,14 @@ static struct argp_option options[] = {
   { "to", 't', NULL, 0,
     "copying to remote host (server use only)",
     GRID+1 },
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
   { "ipv4", '4', NULL, 0,
     "use only IPv4",
     GRID+1 },
   { "ipv6", '6', NULL, 0,
     "use only IPv6",
     GRID+1 },
-#endif /* WITH_ORCMD_AF || WITH_RCMD_AF */
+#endif /* WITH_ORCMD_AF || WITH_RCMD_AF || SHISHI */
   { NULL }
 };
 
@@ -199,14 +199,14 @@ parse_opt (int key, char *arg, struct argp_state *state)
 {
   switch (key)
     {
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
     case '4':
       family = AF_INET;
       break;
     case '6':
       family = AF_INET6;
       break;
-#endif /* WITH_ORCMD_AF || WITH_RCMD_AF */
+#endif /* WITH_ORCMD_AF || WITH_RCMD_AF || SHISHI */
 
 #if defined KERBEROS || defined SHISHI
     case 'K':
@@ -1139,22 +1139,30 @@ again:
       if (rem < 0)
 	{
 	  use_kerberos = 0;
-	  if ((sp = getservbyname ("shell", "tcp")) == NULL)
-	    error (EXIT_FAILURE, 0, "unknown service shell/tcp");
 	  if (krb_errno == ECONNREFUSED)
 	    oldw ("remote host doesn't support Kerberos");
 	  else if (krb_errno == ENOENT)
-	    oldw ("can't provide Kerberos authentication data");
+	    error (EXIT_FAILURE, 0, "Can't provide Kerberos authentication data.");
+	  else
+	    error (EXIT_FAILURE, 0, "Kerberos authentication failed.");
+
+	  sp = getservbyname ("shell", "tcp");
+	  if (sp == NULL)
+	    error (EXIT_FAILURE, 0, "unknown service shell/tcp");
 	  port = sp->s_port;
 	  goto again;
 	}
     }
   else
     {
+      char *p = strchr (*host, '/');
+
 # ifdef ENCRYPTION
       if (doencrypt)
 	error (EXIT_FAILURE, 0, "the -x option requires Kerberos authentication");
 # endif
+      if (p)
+	*host = ++p;	/* Skip prefix like `host/'.  */
 # ifdef WITH_ORCMD_AF
       rem = orcmd_af (host, port, locuser, user, bp, 0, family);
 # elif defined WITH_RCMD_AF
diff --git a/src/rlogin.c b/src/rlogin.c
index a42f27a..038d76a 100644
--- a/src/rlogin.c
+++ b/src/rlogin.c
@@ -178,7 +178,7 @@ int noescape;
 char * host = NULL;
 char * user = NULL;
 unsigned char escapechar = '~';
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
 sa_family_t family = AF_UNSPEC;
 #endif
 
@@ -238,14 +238,14 @@ static struct argp_option argp_options[] = {
   {"user", 'l', "USER", 0, "run as USER on the remote system", GRP+1},
 #if defined KERBEROS || defined SHISHI
 # ifdef ENCRYPTION
-  {"encrypt", 'x', NULL, 0, "turns on DES encryption for all data passed via "
+  {"encrypt", 'x', NULL, 0, "turns on encryption for all data passed via "
    "the rlogin session", GRP+1},
 # endif
   {"kerberos", 'K', NULL, 0, "turns off all Kerberos authentication", GRP+1},
   {"realm", 'k', "REALM", 0, "obtain tickets for the remote host in REALM "
    "realm instead of the remote's realm", GRP+1},
-#endif
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#endif /* KERBEROS || SHISHI */
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
   { "ipv4", '4', NULL, 0, "use only IPv4" },
   { "ipv6", '6', NULL, 0, "use only IPv6" },
 #endif
@@ -258,7 +258,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
 {
   switch (key)
     {
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
     case '4':
       family = AF_INET;
       break;
@@ -449,6 +449,7 @@ try_connect:
   if (use_kerberos)
     {
       int krb_errno = 0;
+# if defined KERBEROS
       struct hostent *hp;
 
       /* Fully qualified hostname (needed for krb_realmofhost).  */
@@ -456,7 +457,6 @@ try_connect:
       if (hp != NULL && !(host = strdup (hp->h_name)))
 	error (EXIT_FAILURE, errno, "strdup");
 
-# if defined KERBEROS
       rem = KSUCCESS;
       errno = 0;
       if (dest_realm == NULL)
@@ -546,25 +546,32 @@ try_connect:
       if (rem < 0)
 	{
 	  use_kerberos = 0;
+	  if (krb_errno == ECONNREFUSED)
+	    warning ("remote host doesn't support Kerberos");
+	  else if (krb_errno == ENOENT)
+	    error (EXIT_FAILURE, 0, "Can't provide Kerberos auth data.");
+	  else
+	    error (EXIT_FAILURE, 0, "Kerberos authentication failed.");
+
 	  sp = getservbyname ("login", "tcp");
 	  if (sp == NULL)
 	    error (EXIT_FAILURE, 0, "unknown service login/tcp.");
-	  if (krb_errno == ECONNREFUSED)
-	    warning ("remote host doesn't support Kerberos");
-	  if (krb_errno == ENOENT)
-	    warning ("can't provide Kerberos auth data");
 	  goto try_connect;
 	}
     }
 
   else
     {
+      char *p = strchr (host, '/');
+
 # ifdef ENCRYPTION
       if (doencrypt)
 	error (EXIT_FAILURE, 0, "the -x flag requires Kerberos authentication.");
-# endif	/* CRYPT */
+# endif	/* ENCRYPTION */
       if (!user)
 	user = pw->pw_name;
+      if (p)
+	host = ++p;	/* Skip prefix like `host/'.  */
 
 # ifdef WITH_ORCMD_AF
       rem = orcmd_af (&host, sp->s_port, pw->pw_name, user, term, 0, family);
diff --git a/src/rlogind.c b/src/rlogind.c
index 76e2a27..3d2f987 100644
--- a/src/rlogind.c
+++ b/src/rlogind.c
@@ -294,7 +294,7 @@ static struct argp_option options[] = {
 #if defined KERBEROS || defined SHISHI
   { "kerberos", 'k', NULL, 0,
     "use kerberos IV/V authentication" },
-  { "servername", 'S', "NAME", 0,
+  { "server-principal", 'S', "NAME", 0,
     "set Kerberos server name, overriding canonical hostname" },
 #endif
 #if defined ENCRYPTION
diff --git a/src/rsh.c b/src/rsh.c
index e01d662..153ca33 100644
--- a/src/rsh.c
+++ b/src/rsh.c
@@ -96,7 +96,7 @@
 int debug_option = 0;
 int null_input_option = 0;
 char *user = NULL;
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
 sa_family_t family = AF_UNSPEC;
 #endif
 
@@ -151,11 +151,13 @@ static struct argp_option options[] = {
   { "kerberos", 'K', NULL, 0,
     "turns off all Kerberos authentication" },
   { "realm", 'k', "REALM", 0,
-    "obtain tickets for the remote host in REALM "
-    "instead of the remote host's realm" },
+    "obtain tickets for a remote host in REALM, "
+    "instead of the remote host's default realm" },
+# ifdef ENCRYPTION
   { "encrypt", 'x', NULL, 0,
     "encrypt all data transfer" },
-#endif
+# endif /* ENCRYPTION */
+#endif /* KERBEROS || SHISHI */
 #if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
   { "ipv4", '4', NULL, 0, "use only IPv4" },
   { "ipv6", '6', NULL, 0, "use only IPv6" },
@@ -168,7 +170,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
 {
   switch (key)
     {
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
     case '4':
       family = AF_INET;
       break;
@@ -345,6 +347,7 @@ main (int argc, char **argv)
 try_connect:
   if (use_kerberos)
     {
+# if defined KERBEROS
       struct hostent *hp;
 
       /* fully qualify hostname (needed for krb_realmofhost) */
@@ -352,7 +355,6 @@ try_connect:
       if (hp != NULL && !(host = strdup (hp->h_name)))
 	error (EXIT_FAILURE, errno, "strdup");
 
-# if defined KERBEROS
       rem = KSUCCESS;
       krb_errno = 0;
       if (dest_realm == NULL)
@@ -438,7 +440,7 @@ try_connect:
 	}
       else
 #  endif
-# endif
+# endif /* ENCRYPTION */
 	{
 # if defined SHISHI
 	  rem = krcmd (&h, &host, sp->s_port, &user, args, &rfd2,
@@ -451,22 +453,30 @@ try_connect:
       if (rem < 0)
 	{
 	  use_kerberos = 0;
+	  if (krb_errno == ECONNREFUSED)
+	    warning ("remote host doesn't support Kerberos");
+	  else if (krb_errno == ENOENT)
+	    error (EXIT_FAILURE, 0, "Can't provide Kerberos auth data.");
+	  else
+	    error (EXIT_FAILURE, 0, "Kerberos authentication failed.");
+
 	  sp = getservbyname ("shell", "tcp");
 	  if (sp == NULL)
 	    error (EXIT_FAILURE, 0, "shell/tcp: unknown service");
-	  if (krb_errno == ECONNREFUSED)
-	    warning ("remote host doesn't support Kerberos");
-	  if (krb_errno == ENOENT)
-	    warning ("can't provide Kerberos auth data");
 	  goto try_connect;
 	}
     }
   else
     {
+      char *p = strchr (host, '/');
+
       if (!user)
 	user = pw->pw_name;
       if (doencrypt)
 	error (EXIT_FAILURE, 0, "the -x flag requires Kerberos authentication");
+      if (p)
+	host = ++p;	/* Skip prefix like `host/'.  */
+
 # ifdef WITH_ORCMD_AF
       rem = orcmd_af (&host, sp->s_port, pw->pw_name, user, args, &rfd2, family);
 # elif defined WITH_RCMD_AF
diff --git a/src/rshd.c b/src/rshd.c
index 3805d9a..03965eb 100644
--- a/src/rshd.c
+++ b/src/rshd.c
@@ -218,13 +218,13 @@ static struct argp_option options[] = {
   { "log-sessions", 'L', NULL, 0,
     "log successful logins" },
 #if defined KERBEROS || defined SHISHI
-  /* FIXME: The option semantics does not match that of others r* utilities */
+  /* FIXME: The option semantics does not match that of other r* utilities */
   { "kerberos", 'k', NULL, 0,
     "use kerberos authentication" },
   /* FIXME: Option name is misleading */
   { "vacuous", 'v', NULL, 0,
     "fail for non-Kerberos authentication" },
-  { "servername", 'S', "NAME", 0,
+  { "server-principal", 'S', "NAME", 0,
     "set Kerberos server name, overriding canonical hostname" },
 #endif /* KERBEROS */
   { NULL }
@@ -832,7 +832,7 @@ doit (int sockfd, struct sockaddr *fromp, socklen_t fromlen)
       if (rc != SHISHI_OK)
 	{
 	  rshd_error ("Kerberos authentication failure: %s\n",
-		      err_msg ? err_msg : shishi_strerror (rc));
+		      (err_msg && *err_msg) ? err_msg : shishi_strerror (rc));
 	  exit (EXIT_FAILURE);
 	}
     }

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

Summary of changes:
 ChangeLog             |   60 +++++++++++++++++++++++++++++++++++++++++++++++++
 libinetutils/kcmd.c   |   36 ++++++++++++++++++++++++-----
 libinetutils/krcmd.c  |    3 +-
 libinetutils/shishi.c |   51 +++++++++++++++++++++++++++++++++--------
 src/rcp.c             |   26 ++++++++++++++-------
 src/rlogin.c          |   29 ++++++++++++++---------
 src/rlogind.c         |    2 +-
 src/rsh.c             |   32 +++++++++++++++++---------
 src/rshd.c            |    6 ++--
 9 files changed, 193 insertions(+), 52 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Aug 15 09:21:13 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T1dX7-0000GA-Jv
	for mharc-commit-inetutils@gnu.org; Wed, 15 Aug 2012 09:21:13 -0400
Received: from eggs.gnu.org ([208.118.235.92]:49849)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T1dX2-0000Fr-3S
	for commit-inetutils@gnu.org; Wed, 15 Aug 2012 09:21:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T1dX0-0007Mh-L3
	for commit-inetutils@gnu.org; Wed, 15 Aug 2012 09:21:08 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:35596)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T1dX0-0007Md-HO
	for commit-inetutils@gnu.org; Wed, 15 Aug 2012 09:21:06 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1T1dWz-0006Qu-UA
	for commit-inetutils@gnu.org; Wed, 15 Aug 2012 13:21:06 +0000
Date: Wed, 15 Aug 2012 13:21:05 +0000
Message-Id: <E1T1dWz-0006Qu-UA@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-148-g4d1fc9a
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: a7a5c3ec659145ff8f31798f351fcd180cbc36c0
X-Git-Newrev: 4d1fc9ac2cc7e4aef00884370d2383bc0eb1b87a
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 15 Aug 2012 13:21:12 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  4d1fc9ac2cc7e4aef00884370d2383bc0eb1b87a (commit)
      from  a7a5c3ec659145ff8f31798f351fcd180cbc36c0 (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=4d1fc9ac2cc7e4aef00884370d2383bc0eb1b87a


commit 4d1fc9ac2cc7e4aef00884370d2383bc0eb1b87a
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Aug 15 14:51:40 2012 +0200

    rcp, rlogin, rsh: Better setuid checking.

diff --git a/ChangeLog b/ChangeLog
index d330172..6e6a625 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-08-15  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	* src/rcp.c (main) [KERBEROS || SHISHI]: Add `!use_kerberos'
+	when checking for effective root UID.
+	* src/rlogin.c (main): Likewise.
+	* src/rsh.c (main): Likewise.
+
+2012-08-15  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	rcp, rlogin, rsh: Host names with instances.
 
 	* libinetutils/kcmd.c (kcmd) [SHISHI]: New variable HOST.
diff --git a/src/rcp.c b/src/rcp.c
index 3518a71..823638b 100644
--- a/src/rcp.c
+++ b/src/rcp.c
@@ -357,11 +357,13 @@ main (int argc, char *argv[])
     error (EXIT_FAILURE, 0, "encryption must use Kerberos");
 #endif
 
-#if !defined KERBEROS && !defined SHISHI
+#if defined KERBEROS || defined SHISHI
+  if (!use_kerberos && geteuid ())
+#else
   /* We must be setuid root.  */
   if (geteuid ())
-    error (EXIT_FAILURE, 0, "must be setuid root.");
 #endif
+    error (EXIT_FAILURE, 0, "must be setuid root.");
 
   /* Command to be executed on remote system using "rsh". */
 #if defined KERBEROS || defined SHISHI
diff --git a/src/rlogin.c b/src/rlogin.c
index 038d76a..12d3eae 100644
--- a/src/rlogin.c
+++ b/src/rlogin.c
@@ -363,9 +363,13 @@ main (int argc, char *argv[])
 
   argc -= index;
 
+#if defined KERBEROS || defined SHISHI
+  if (!use_kerberos && geteuid ())
+#else
   /* We must be uid root to access rcmd().  */
   if (geteuid ())
-    error (EXIT_FAILURE, 0, "must be setuid root.\n");
+#endif
+    error (EXIT_FAILURE, 0, "must be setuid root.");
 
   /* Get the name of the user invoking us: the client-user-name.  */
   if (!(pw = getpwuid (uid = getuid ())))
diff --git a/src/rsh.c b/src/rsh.c
index 153ca33..5875dd1 100644
--- a/src/rsh.c
+++ b/src/rsh.c
@@ -283,9 +283,13 @@ main (int argc, char **argv)
   argc -= index;
   argv += index;
 
+#if defined KERBEROS || defined SHISHI
+  if (!use_kerberos && geteuid ())
+#else
   /* We must be setuid root.  */
   if (geteuid ())
-    error (EXIT_FAILURE, 0, "must be setuid root.\n");
+#endif
+    error (EXIT_FAILURE, 0, "must be setuid root.");
 
   if (!(pw = getpwuid (uid = getuid ())))
     error (EXIT_FAILURE, 0, "unknown user id");

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

Summary of changes:
 ChangeLog    |    7 +++++++
 src/rcp.c    |    6 ++++--
 src/rlogin.c |    6 +++++-
 src/rsh.c    |    6 +++++-
 4 files changed, 21 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Aug 16 12:46:05 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T23Cv-0005qI-Ux
	for mharc-commit-inetutils@gnu.org; Thu, 16 Aug 2012 12:46:05 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50070)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T23Cr-0005pi-AR
	for commit-inetutils@gnu.org; Thu, 16 Aug 2012 12:46:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T23Cp-0007uz-3a
	for commit-inetutils@gnu.org; Thu, 16 Aug 2012 12:46:01 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:59897)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T23Co-0007uv-Vx
	for commit-inetutils@gnu.org; Thu, 16 Aug 2012 12:45:59 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1T23Co-0003O2-Gf
	for commit-inetutils@gnu.org; Thu, 16 Aug 2012 16:45:58 +0000
Date: Thu, 16 Aug 2012 16:45:58 +0000
Message-Id: <E1T23Co-0003O2-Gf@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-149-g32746bf
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 4d1fc9ac2cc7e4aef00884370d2383bc0eb1b87a
X-Git-Newrev: 32746bf6648bdad78000ae5b39d4841d36a334a4
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 16 Aug 2012 16:46:03 -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  32746bf6648bdad78000ae5b39d4841d36a334a4 (commit)
      from  4d1fc9ac2cc7e4aef00884370d2383bc0eb1b87a (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=32746bf6648bdad78000ae5b39d4841d36a334a4


commit 32746bf6648bdad78000ae5b39d4841d36a334a4
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Aug 16 18:11:19 2012 +0200

    telnetd: Server principal naming.

diff --git a/ChangeLog b/ChangeLog
index 6e6a625..356d739 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2012-08-16  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	telnetd: Configurable principal name.
+
+	* libtelnet/misc.c (ServerPrincipal): New variable.
+	(auth_encrypt_init): Add `char *principal' to signature.
+	Assign value to ServerPrincipal.
+	* libtelnet/misc.h (ServerPrincipal): New external variable.
+	* libtelnet/misc-proto.h (auth_encrypt_init): Updated.
+	* libtelnet/shishi.c: Prune newlines in error messages.
+	(krb5shishi_is_auth): New variable REALM.  Delay shishi_ap()
+	and shishi_ap_req_der_set() until after complete setup.
+	Extract server name and realm from ServerPrincipal and
+	override defaults accordingly.  Use variant calls to access
+	realm also, shishi_hostkeys_for_serverrealm() and
+	shishi_hostkeys_for_localservicerealm().
+
+	* telnet/telnet.c (telnet): Call auth_encrypt_init()
+	with `principal = NULL'.
+	* telnetd/telnetd.c (principal) [AUTHENTICATION || ENCRYPTION]:
+	New variable.
+	(argp_options) [AUTHENTICATION || ENCRYPTION]: New option
+	`-S/--server-principal'.
+	(parse_opt) [AUTHENTICATION || ENCRYPTION] <'S'>: New case.
+	(telnetd_setup) [AUTHENTICATION || ENCRYPTION]: Pass
+	`principal' in call to auth_encrypt_init().
+
 2012-08-15  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* src/rcp.c (main) [KERBEROS || SHISHI]: Add `!use_kerberos'
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index 7601ebd..bce878d 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -3755,6 +3755,18 @@ The only recognised value is otherwise @samp{nokludge}.
 @opindex --no-keepalive
 Disable TCP keep-alives.
 
+@item -S @var{principal}
+@itemx --server-principal=@var{principal}
+@opindex -S
+@opindex --server-principal
+Set principal name for the server, to be used in Kerberos
+authentication.  The value @var{principal} can be set
+to provide full specification like @samp{srv.local@@REALM}
+and @samp{tnt/localhost@@REALM}, where the first uses the
+standard prefix `host/'. Or @var{principal} can override
+default settings in part only, like @samp{srv.local},
+@samp{tnt/srv.local}, or @samp{@@REALM}.
+
 @item -U
 @itemx --reverse-lookup
 @opindex -U
diff --git a/libtelnet/misc-proto.h b/libtelnet/misc-proto.h
index 009d9b2..e2cbef9 100644
--- a/libtelnet/misc-proto.h
+++ b/libtelnet/misc-proto.h
@@ -70,7 +70,7 @@
 #ifndef __MISC_PROTO__
 # define __MISC_PROTO__
 
-void auth_encrypt_init (char *, char *, char *, int);
+void auth_encrypt_init (char *, char *, char *, char *, int);
 void auth_encrypt_user (char *);
 void auth_encrypt_connect (int);
 void printd (unsigned char *, int);
diff --git a/libtelnet/misc.c b/libtelnet/misc.c
index 0385040..45cf3b9 100644
--- a/libtelnet/misc.c
+++ b/libtelnet/misc.c
@@ -59,12 +59,15 @@
 char *RemoteHostName;
 char *LocalHostName;
 char *UserNameRequested = NULL;
+char *ServerPrincipal;
 
 void
-auth_encrypt_init (char *local, char *remote, char *name, int server)
+auth_encrypt_init (char *local, char *remote, char *principal,
+		   char *name, int server)
 {
   RemoteHostName = remote;
   LocalHostName = local;
+  ServerPrincipal = principal;
   (void) name;
   (void) server;		/* silence gcc */
 #if defined AUTHENTICATION
diff --git a/libtelnet/misc.h b/libtelnet/misc.h
index a463d50..ec18a3f 100644
--- a/libtelnet/misc.h
+++ b/libtelnet/misc.h
@@ -50,6 +50,7 @@
 extern char *UserNameRequested;
 extern char *LocalHostName;
 extern char *RemoteHostName;
+extern char *ServerPrincipal;
 extern int ConnectedCount;
 extern int ReservedPort;
 
diff --git a/libtelnet/shishi.c b/libtelnet/shishi.c
index a90e40e..1a21624 100644
--- a/libtelnet/shishi.c
+++ b/libtelnet/shishi.c
@@ -306,7 +306,7 @@ krb5shishi_reply (TN_Authenticator * ap, unsigned char *data, int cnt)
     {
     case KRB_REJECT:
       if (cnt > 0)
-	printf ("[ Kerberos V5 refuses authentication because %.*s ]\r\n",
+	printf ("[ Kerberos V5 rejects authentication: %.*s ]\r\n",
 		cnt, data);
       else
 	printf ("[ Kerberos V5 refuses authentication ]\r\n");
@@ -402,7 +402,7 @@ krb5shishi_is_auth (TN_Authenticator * a, unsigned char *data, int cnt,
 {
   Shishi_key *key, *key2;
   int rc;
-  char *cnamerealm, *server;
+  char *cnamerealm, *server = NULL, *realm = NULL;
   int cnamerealmlen;
 # ifdef ENCRYPTION
   Session_Key skey;
@@ -427,45 +427,100 @@ krb5shishi_is_auth (TN_Authenticator * a, unsigned char *data, int cnt,
 	}
     }
 
-  rc = shishi_ap (shishi_handle, &auth_handle);
-  if (rc != SHISHI_OK)
+  if (ServerPrincipal && *ServerPrincipal)
     {
-      snprintf (errbuf, errbuflen,
-		"Cannot allocate authentication structures: %s",
-		shishi_strerror (rc));
-      return 1;
+      rc = shishi_parse_name (shishi_handle, ServerPrincipal,
+			      &server, &realm);
+      if (rc != SHISHI_OK)
+	{
+	  snprintf (errbuf, errbuflen,
+		    "Cannot parse server principal name: %s",
+		    shishi_strerror (rc));
+	  return 1;
+	}
+      if (realm)
+	shishi_realm_default_set (shishi_handle, realm);
+
+      /* Reclaim an empty server part.  */
+      if (server && !*server)
+	{
+	  free (server);
+	  server = NULL;
+	}
     }
 
-  rc = shishi_ap_req_der_set (auth_handle, data, cnt);
-  if (rc != SHISHI_OK)
+  if (!server)
     {
-      snprintf (errbuf, errbuflen,
-		"Cannot parse authentication information: %s",
-		shishi_strerror (rc));
-      return 1;
+      server = malloc (strlen ("host/") + strlen (LocalHostName) + 1);
+      if (server)
+	sprintf (server, "host/%s", LocalHostName);
     }
 
-  server = malloc (strlen ("host/") + strlen (LocalHostName) + 1);
   if (server)
     {
-      sprintf (server, "host/%s", LocalHostName);
-      key = shishi_hostkeys_for_server (shishi_handle, server);
+      /* Two possible action on `server':
+       *   "srv.local"    :  rewrite as "host/srv.local"
+       *   "tn/srv.local" :  accept as is
+       */
+      char *p = strchr (server, '/');
+
+      if (!p)
+	{
+	  p = server;
+	  server = malloc (strlen ("host/") + strlen (p) + 1);
+	  if (!server)
+	    {
+	      free (p);		/* This old `server'.  */
+	      snprintf (errbuf, errbuflen,
+			"Cannot allocate memory for server name");
+	      return 1;
+	    }
+	  sprintf (server, "host/%s", p);
+	}
+
+      if (realm)
+	key = shishi_hostkeys_for_serverrealm (shishi_handle,
+					       server, realm);
+      else
+	key = shishi_hostkeys_for_server (shishi_handle, server);
+
       free (server);
     }
   else
-    key = shishi_hostkeys_for_localservice (shishi_handle, "host");
+    key = shishi_hostkeys_for_localservicerealm (shishi_handle,
+						 "host", realm);
+
+  free (realm);
 
   if (key == NULL)
     {
-      snprintf (errbuf, errbuflen, "Could not find key:\n%s\n",
+      snprintf (errbuf, errbuflen, "Could not find key: %s",
 		shishi_error (shishi_handle));
       return 1;
     }
 
+  rc = shishi_ap (shishi_handle, &auth_handle);
+  if (rc != SHISHI_OK)
+    {
+      snprintf (errbuf, errbuflen,
+		"Cannot allocate authentication structures: %s",
+		shishi_strerror (rc));
+      return 1;
+    }
+
+  rc = shishi_ap_req_der_set (auth_handle, data, cnt);
+  if (rc != SHISHI_OK)
+    {
+      snprintf (errbuf, errbuflen,
+		"Cannot parse authentication information: %s",
+		shishi_strerror (rc));
+      return 1;
+    }
+
   rc = shishi_ap_req_process (auth_handle, key);
   if (rc != SHISHI_OK)
     {
-      snprintf (errbuf, errbuflen, "Could not process AP-REQ: %s\n",
+      snprintf (errbuf, errbuflen, "Could not process AP-REQ: %s",
 		shishi_strerror (rc));
       return 1;
     }
@@ -479,7 +534,7 @@ krb5shishi_is_auth (TN_Authenticator * a, unsigned char *data, int cnt,
       rc = shishi_ap_rep_der (auth_handle, &der, &derlen);
       if (rc != SHISHI_OK)
 	{
-	  snprintf (errbuf, errbuflen, "Error DER encoding aprep: %s\n",
+	  snprintf (errbuf, errbuflen, "Error DER encoding aprep: %s",
 		    shishi_strerror (rc));
 	  return 1;
 	}
@@ -494,7 +549,7 @@ krb5shishi_is_auth (TN_Authenticator * a, unsigned char *data, int cnt,
 		&cnamerealm, &cnamerealmlen);
   if (rc != SHISHI_OK)
     {
-      snprintf (errbuf, errbuflen, "Error getting authenticator name: %s\n",
+      snprintf (errbuf, errbuflen, "Error getting authenticator name: %s",
 		shishi_strerror (rc));
       return 1;
     }
diff --git a/telnet/telnet.c b/telnet/telnet.c
index 70f24ca..a7f43f0 100644
--- a/telnet/telnet.c
+++ b/telnet/telnet.c
@@ -2413,7 +2413,7 @@ telnet (char *user)
     if (!local_host)
       local_host = localhost ();
 
-    auth_encrypt_init (local_host, hostname, "TELNET", 0);
+    auth_encrypt_init (local_host, hostname, NULL, "TELNET", 0);
     auth_encrypt_user (user);
   }
 #endif /* defined(AUTHENTICATION) || defined(ENCRYPTION)  */
diff --git a/telnetd/telnetd.c b/telnetd/telnetd.c
index cd57cf8..064d6cd 100644
--- a/telnetd/telnetd.c
+++ b/telnetd/telnetd.c
@@ -65,6 +65,9 @@ int debug_tcp = 0;		/* Should the SO_DEBUG be set? */
 
 int net;			/* Network connection socket */
 int pty;			/* PTY master descriptor */
+#if defined AUTHENTICATION || defined ENCRYPTION
+char *principal = NULL;
+#endif
 char *remote_hostname;
 char *local_hostname;
 char *user_name;
@@ -110,6 +113,11 @@ static struct argp_option argp_options[] = {
     "set line mode" },
   { "no-keepalive", 'n', NULL, 0,
     "disable TCP keep-alives" },
+#if defined AUTHENTICATION || defined ENCRYPTION
+  { "server-principal", 'S', "NAME", 0,
+    "set Kerberos principal name for this server instance, "
+    "with or without explicit realm" },
+#endif
   { "reverse-lookup", 'U', NULL, 0,
     "refuse connections from addresses that "
     "cannot be mapped back into a symbolic name" },
@@ -151,6 +159,12 @@ parse_opt (int key, char *arg, struct argp_state *state)
       keepalive = 0;
       break;
 
+#if defined AUTHENTICATION || defined ENCRYPTION
+    case 'S':
+      principal = arg;
+      break;
+#endif
+
     case 'U':
       reverse_lookup = 1;
       break;
@@ -448,7 +462,8 @@ telnetd_setup (int fd)
 
   local_hostname = localhost ();
 #if defined AUTHENTICATION || defined ENCRYPTION
-  auth_encrypt_init (remote_hostname, local_hostname, "TELNETD", 1);
+  auth_encrypt_init (remote_hostname, local_hostname, principal,
+		     "TELNETD", 1);
 #endif
 
   io_setup ();

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

Summary of changes:
 ChangeLog              |   27 +++++++++++++
 doc/inetutils.texi     |   12 ++++++
 libtelnet/misc-proto.h |    2 +-
 libtelnet/misc.c       |    5 ++-
 libtelnet/misc.h       |    1 +
 libtelnet/shishi.c     |   99 +++++++++++++++++++++++++++++++++++++-----------
 telnet/telnet.c        |    2 +-
 telnetd/telnetd.c      |   17 ++++++++-
 8 files changed, 139 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Aug 16 21:31:04 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T2BOy-0004nX-1y
	for mharc-commit-inetutils@gnu.org; Thu, 16 Aug 2012 21:31:04 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54652)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T2BOv-0004mt-8Y
	for commit-inetutils@gnu.org; Thu, 16 Aug 2012 21:31:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T2BOt-0004Mf-Mn
	for commit-inetutils@gnu.org; Thu, 16 Aug 2012 21:31:01 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:33309)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T2BOt-0004MY-JF
	for commit-inetutils@gnu.org; Thu, 16 Aug 2012 21:30:59 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1T2BOt-0004WM-1N
	for commit-inetutils@gnu.org; Fri, 17 Aug 2012 01:30:59 +0000
Date: Fri, 17 Aug 2012 01:30:59 +0000
Message-Id: <E1T2BOt-0004WM-1N@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-150-g4168cfe
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 32746bf6648bdad78000ae5b39d4841d36a334a4
X-Git-Newrev: 4168cfe85d2a99c4b0f3eeef889f3bef637cd5e2
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 17 Aug 2012 01:31: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  4168cfe85d2a99c4b0f3eeef889f3bef637cd5e2 (commit)
      from  32746bf6648bdad78000ae5b39d4841d36a334a4 (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=4168cfe85d2a99c4b0f3eeef889f3bef637cd5e2


commit 4168cfe85d2a99c4b0f3eeef889f3bef637cd5e2
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Aug 17 03:29:15 2012 +0200

    telnet: Activate principal naming.

diff --git a/ChangeLog b/ChangeLog
index 356d739..d25bdb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-08-17  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	telnet: Selectable principal name.
+
+	* libtelnet/shishi.c (krb5shishi_send): Add a prefix
+	`host/' to RemoteHostName only if a prefix is missing.
+	* telnet/commands.c (tn) [AUTHENTICATION || ENCRYPTION]:
+	Strip off any prefix from HOSTP before resolving address.
+	[IPV6]: Improve error message at failed resolution.
+
 2012-08-16  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	telnetd: Configurable principal name.
diff --git a/libtelnet/shishi.c b/libtelnet/shishi.c
index 1a21624..0ffd6a9 100644
--- a/libtelnet/shishi.c
+++ b/libtelnet/shishi.c
@@ -173,7 +173,13 @@ krb5shishi_send (TN_Authenticator * ap)
       DEBUG (("telnet: Kerberos V5: shishi memory allocation failed\r\n"));
       return 0;
     }
-  sprintf (tmp, "host/%s", RemoteHostName);
+
+  /* Check for Kerberos prefix in principal name.  */
+  if (strchr (RemoteHostName, '/'))
+    strcpy (tmp, RemoteHostName);
+  else
+    sprintf (tmp, "host/%s", RemoteHostName);
+
   memset (&hint, 0, sizeof (hint));
   hint.server = tmp;
   hint.client = UserNameRequested;
diff --git a/telnet/commands.c b/telnet/commands.c
index 6a1be36..b511e4c 100644
--- a/telnet/commands.c
+++ b/telnet/commands.c
@@ -2555,6 +2555,18 @@ tn (int argc, char *argv[])
       return 0;
     }
 
+#if defined AUTHENTICATION || defined ENCRYPTION
+  {
+    /* Extract instance name of server, eliminating
+     * the Kerberos principal prefix.
+     */
+    char *p = strchr (hostp, '/');
+
+    if (p)
+      hostp = ++p;
+  }
+#endif /* AUTHENTICATION || ENCRYPTION */
+
 #ifdef IPV6
   hints.ai_socktype = SOCK_STREAM;
 
@@ -2568,7 +2580,7 @@ tn (int argc, char *argv[])
       else
 	errmsg = gai_strerror (err);
 
-      printf ("%s/%s: lookup failure: %s\n", hostp, portp, errmsg);
+      printf ("Server lookup failure:  %s:%s, %s\n", hostp, portp, errmsg);
       return 0;
     }
 

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

Summary of changes:
 ChangeLog          |   10 ++++++++++
 libtelnet/shishi.c |    8 +++++++-
 telnet/commands.c  |   14 +++++++++++++-
 3 files changed, 30 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Tue Aug 21 17:37:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T3w8O-0004BK-Dk
	for mharc-commit-inetutils@gnu.org; Tue, 21 Aug 2012 17:37:12 -0400
Received: from eggs.gnu.org ([208.118.235.92]:57538)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T3w8H-0004Ai-C0
	for commit-inetutils@gnu.org; Tue, 21 Aug 2012 17:37:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T3w8G-0006LX-2m
	for commit-inetutils@gnu.org; Tue, 21 Aug 2012 17:37:05 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:46171)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T3w8F-0006LT-VI
	for commit-inetutils@gnu.org; Tue, 21 Aug 2012 17:37:03 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1T3w8F-0003Mz-9x
	for commit-inetutils@gnu.org; Tue, 21 Aug 2012 21:37:03 +0000
Date: Tue, 21 Aug 2012 21:37:03 +0000
Message-Id: <E1T3w8F-0003Mz-9x@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-151-gdf22b0e
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 4168cfe85d2a99c4b0f3eeef889f3bef637cd5e2
X-Git-Newrev: df22b0e7de1a35caad2cce9733d015c877486d0c
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 21 Aug 2012 21:37:11 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  df22b0e7de1a35caad2cce9733d015c877486d0c (commit)
      from  4168cfe85d2a99c4b0f3eeef889f3bef637cd5e2 (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=df22b0e7de1a35caad2cce9733d015c877486d0c


commit df22b0e7de1a35caad2cce9733d015c877486d0c
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Mon Aug 20 23:08:20 2012 +0200

    Realm for server lookup.

diff --git a/ChangeLog b/ChangeLog
index d25bdb4..ae1adff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-08-20  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	Server realm pairing: Let server name determine
+	realm to be contacted, as per library configuration.
+
+	* libinetutils/shishi.c (shishi_auth): Whenever realm
+	is not explicit, call shishi_realm_for_server() to get
+	a usable realm; pass on to shishi_realm_default_set().
+	* libtelnet/shishi.c (krb5shishi_send): Likewise.
+
 2012-08-17  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	telnet: Selectable principal name.
diff --git a/libinetutils/shishi.c b/libinetutils/shishi.c
index d023081..98f3662 100644
--- a/libinetutils/shishi.c
+++ b/libinetutils/shishi.c
@@ -28,7 +28,7 @@
 # include <unistd.h>
 # include <shishi_def.h>
 
-/* shishi authentication */
+/* shishi authentication, client side */
 int
 shishi_auth (Shishi ** handle, int verbose, char **cname,
 	     const char *sname, int sock, char *cmd,
@@ -130,6 +130,19 @@ shishi_auth (Shishi ** handle, int verbose, char **cname,
   else
     sprintf (tmpserver, "%s/%s", SERVICE, sname + (p ? 1 : 0));
 
+  /* Retrieve realm assigned to this server as per configuration,
+   * unless an explicit domain was passed in the call.
+   */
+  if (!realm)
+    {
+      if (!p)
+	p = sname;
+      else if (*p == '/')
+	++p;
+
+      shishi_realm_default_set (h, shishi_realm_for_server (h, p));
+    }
+
   hint.client = (char *) *cname;
   hint.server = (char *) tmpserver;
 
@@ -254,6 +267,7 @@ senderror (int s, char type, char *buf)
   write (s, buf, strlen (buf));
 }
 
+/* shishi authentication, server side */
 int
 get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
 	  Shishi_key ** enckey, const char **err_msg, int *protoversion,
diff --git a/libtelnet/shishi.c b/libtelnet/shishi.c
index 0ffd6a9..32a59e6 100644
--- a/libtelnet/shishi.c
+++ b/libtelnet/shishi.c
@@ -186,6 +186,19 @@ krb5shishi_send (TN_Authenticator * ap)
 
   if (dest_realm && *dest_realm)
     shishi_realm_default_set (shishi_handle, dest_realm);
+  else
+    {
+      /* Retrieve realm assigned to this server as per configuration.  */
+      char *p = strchr (RemoteHostName, '/');
+
+      if (p)
+	++p;
+      else
+	p = RemoteHostName;
+
+      shishi_realm_default_set (shishi_handle,
+				shishi_realm_for_server (shishi_handle, p));
+    }
 
   tkt = shishi_tkts_get (shishi_tkts_default (shishi_handle), &hint);
   free (tmp);

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

Summary of changes:
 ChangeLog             |   10 ++++++++++
 libinetutils/shishi.c |   16 +++++++++++++++-
 libtelnet/shishi.c    |   13 +++++++++++++
 3 files changed, 38 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Aug 22 04:42:35 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T46WJ-0000YS-HD
	for mharc-commit-inetutils@gnu.org; Wed, 22 Aug 2012 04:42:35 -0400
Received: from eggs.gnu.org ([208.118.235.92]:36162)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T46WC-0000Xr-MM
	for commit-inetutils@gnu.org; Wed, 22 Aug 2012 04:42:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T46W6-0003WM-W7
	for commit-inetutils@gnu.org; Wed, 22 Aug 2012 04:42:28 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:39909)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T46W6-0003WI-Rr
	for commit-inetutils@gnu.org; Wed, 22 Aug 2012 04:42:22 -0400
Received: from jas by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <simon@josefsson.org>) id 1T46W5-00069o-TF
	for commit-inetutils@gnu.org; Wed, 22 Aug 2012 08:42:22 +0000
Date: Wed, 22 Aug 2012 08:42:22 +0000
Message-Id: <E1T46W5-00069o-TF@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-152-gd5021bb
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: df22b0e7de1a35caad2cce9733d015c877486d0c
X-Git-Newrev: d5021bb3ec84525f0ded3e5ae3a3c6e1aafee443
From: Simon Josefsson <simon@josefsson.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 22 Aug 2012 08:42:34 -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  d5021bb3ec84525f0ded3e5ae3a3c6e1aafee443 (commit)
      from  df22b0e7de1a35caad2cce9733d015c877486d0c (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=d5021bb3ec84525f0ded3e5ae3a3c6e1aafee443


commit d5021bb3ec84525f0ded3e5ae3a3c6e1aafee443
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Aug 22 10:42:11 2012 +0200

    bootstrap: Updated from gnulib.

diff --git a/ChangeLog b/ChangeLog
index ae1adff..5c0a7ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-22  Simon Josefsson  <simon@josefsson.org>
+
+	* bootstrap: Updated from gnulib.
+
 2012-08-20  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	Server realm pairing: Let server name determine
diff --git a/bootstrap b/bootstrap
index ce37a2c..e3e270b 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2012-05-15.06; # UTC
+scriptversion=2012-07-19.14; # UTC
 
 # Bootstrap this package from checked-out sources.
 
@@ -77,6 +77,33 @@ Running without arguments will suffice in most cases.
 EOF
 }
 
+# warnf_ FORMAT-STRING ARG1...
+warnf_ ()
+{
+  warnf_format_=$1
+  shift
+  nl='
+'
+  case $* in
+    *$nl*) me_=$(printf "$me"|tr "$nl|" '??')
+       printf "$warnf_format_" "$@" | sed "s|^|$me_: |" ;;
+    *) printf "$me: $warnf_format_" "$@" ;;
+  esac >&2
+}
+
+# warn_ WORD1...
+warn_ ()
+{
+  # If IFS does not start with ' ', set it and emit the warning in a subshell.
+  case $IFS in
+    ' '*) warnf_ '%s\n' "$*";;
+    *)    (IFS=' '; warn_ "$@");;
+  esac
+}
+
+# die WORD1...
+die() { warn_ "$@"; exit 1; }
+
 # Configuration.
 
 # Name of the Makefile.am
@@ -130,7 +157,8 @@ extract_package_name='
      p
   }
 '
-package=$(sed -n "$extract_package_name" configure.ac) || exit
+package=$(sed -n "$extract_package_name" configure.ac) \
+  || die 'cannot find package name in configure.ac'
 gnulib_name=lib$package
 
 build_aux=build-aux
@@ -186,6 +214,8 @@ use_git=true
 # otherwise find the first of the NAMES that can be run (i.e.,
 # supports --version).  If found, set ENVVAR to the program name,
 # die otherwise.
+#
+# FIXME: code duplication, see also gnu-web-doc-update.
 find_tool ()
 {
   find_tool_envvar=$1
@@ -203,19 +233,15 @@ find_tool ()
   else
     find_tool_error_prefix="\$$find_tool_envvar: "
   fi
-  if test x"$find_tool_res" = x; then
-    echo >&2 "$me: one of these is required: $find_tool_names"
-    exit 1
-  fi
-  ($find_tool_res --version </dev/null) >/dev/null 2>&1 || {
-    echo >&2 "$me: ${find_tool_error_prefix}cannot run $find_tool_res --version"
-    exit 1
-  }
+  test x"$find_tool_res" != x \
+    || die "one of these is required: $find_tool_names"
+  ($find_tool_res --version </dev/null) >/dev/null 2>&1 \
+    || die "${find_tool_error_prefix}cannot run $find_tool_res --version"
   eval "$find_tool_envvar=\$find_tool_res"
   eval "export $find_tool_envvar"
 }
 
-# Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6.
+# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6.
 find_tool SHA1SUM sha1sum gsha1sum shasum
 
 # Override the default configuration, if necessary.
@@ -230,7 +256,6 @@ esac
 test -z "${gnulib_extra_files}" && \
   gnulib_extra_files="
         $build_aux/install-sh
-        $build_aux/missing
         $build_aux/mdate-sh
         $build_aux/texinfo.tex
         $build_aux/depcomp
@@ -270,21 +295,15 @@ do
   --no-git)
     use_git=false;;
   *)
-    echo >&2 "$0: $option: unknown option"
-    exit 1;;
+    die "$option: unknown option";;
   esac
 done
 
-if $use_git || test -d "$GNULIB_SRCDIR"; then
-  :
-else
-  echo "$0: Error: --no-git requires --gnulib-srcdir" >&2
-  exit 1
-fi
+$use_git || test -d "$GNULIB_SRCDIR" \
+  || die "Error: --no-git requires --gnulib-srcdir"
 
 if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
-  echo "$0: Bootstrapping from a non-checked-out distribution is risky." >&2
-  exit 1
+  die "Bootstrapping from a non-checked-out distribution is risky."
 fi
 
 # Ensure that lines starting with ! sort last, per gitignore conventions
@@ -310,7 +329,7 @@ insert_sorted_if_absent() {
   echo "$str" | sort_patterns - $file | cmp -s - $file > /dev/null \
     || { echo "$str" | sort_patterns - $file > $file.bak \
       && mv $file.bak $file; } \
-    || exit 1
+    || die "insert_sorted_if_absent $file $str: failed"
 }
 
 # Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
@@ -334,11 +353,8 @@ grep '^[	 ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
     >/dev/null && found_aux_dir=yes
 grep '^[	 ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
     >/dev/null && found_aux_dir=yes
-if test $found_aux_dir = no; then
-  echo "$0: expected line not found in configure.ac. Add the following:" >&2
-  echo "  AC_CONFIG_AUX_DIR([$build_aux])" >&2
-  exit 1
-fi
+test $found_aux_dir = yes \
+  || die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it"
 
 # If $build_aux doesn't exist, create it now, otherwise some bits
 # below will malfunction.  If creating it, also mark it as ignored.
@@ -444,7 +460,7 @@ check_versions() {
       automake-ng|aclocal-ng)
         app=${app%-ng}
         ($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || {
-          echo "$me: Error: '$app' not found or not from Automake-NG" >&2
+          warn_ "Error: '$app' not found or not from Automake-NG"
           ret=1
           continue
         } ;;
@@ -454,20 +470,21 @@ check_versions() {
       # so we have to rely on $? rather than get_version.
       $app --version >/dev/null 2>&1
       if [ 126 -le $? ]; then
-        echo "$me: Error: '$app' not found" >&2
+        warn_ "Error: '$app' not found"
         ret=1
       fi
     else
       # Require app to produce a new enough version string.
       inst_ver=$(get_version $app)
       if [ ! "$inst_ver" ]; then
-        echo "$me: Error: '$app' not found" >&2
+        warn_ "Error: '$app' not found"
         ret=1
       else
         latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
         if [ ! "$latest_ver" = "$inst_ver" ]; then
-          echo "$me: Error: '$app' version == $inst_ver is too old" >&2
-          echo "       '$app' version >= $req_ver is required" >&2
+          warnf_ '%s\n'                                        \
+              "Error: '$app' version == $inst_ver is too old"  \
+              "       '$app' version >= $req_ver is required"
           ret=1
         fi
       fi
@@ -524,11 +541,10 @@ fi
 if ! printf "$buildreq" | check_versions; then
   echo >&2
   if test -f README-prereq; then
-    echo "$0: See README-prereq for how to get the prerequisite programs" >&2
+    die "See README-prereq for how to get the prerequisite programs"
   else
-    echo "$0: Please install the prerequisite programs" >&2
+    die "Please install the prerequisite programs"
   fi
-  exit 1
 fi
 
 echo "$0: Bootstrapping from checked-out $package sources..."
@@ -739,11 +755,10 @@ symlink_to_dir()
         *)
           case /$dst/ in
           *//* | */../* | */./* | /*/*/*/*/*/)
-             echo >&2 "$me: invalid symlink calculation: $src -> $dst"
-             exit 1;;
-          /*/*/*/*/)	dot_dots=../../../;;
-          /*/*/*/)	dot_dots=../../;;
-          /*/*/)	dot_dots=../;;
+             die "invalid symlink calculation: $src -> $dst";;
+          /*/*/*/*/)    dot_dots=../../../;;
+          /*/*/*/)      dot_dots=../../;;
+          /*/*/)        dot_dots=../;;
           esac;;
         esac
 
@@ -765,7 +780,7 @@ version_controlled_file() {
     grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null |
              grep '^/[^/]*/[0-9]' > /dev/null
   else
-    echo "$me: no version control for $file?" >&2
+    warn_ "no version control for $file?"
     false
   fi
 }
@@ -855,11 +870,12 @@ echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
 $gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
 
 for file in $gnulib_files; do
-  symlink_to_dir "$GNULIB_SRCDIR" $file || exit
+  symlink_to_dir "$GNULIB_SRCDIR" $file \
+    || die "failed to symlink $file"
 done
 
 bootstrap_post_import_hook \
-  || { echo >&2 "$me: bootstrap_post_import_hook failed"; exit 1; }
+  || die "bootstrap_post_import_hook failed"
 
 # Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
 # gnulib-populated directories.  Such .m4 files would cause aclocal to fail.
@@ -887,7 +903,7 @@ echo "running: AUTOPOINT=true LIBTOOLIZE=true " \
     "$AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS"
 AUTOPOINT=true LIBTOOLIZE=true \
     $AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS \
-  || exit 1
+  || die "autoreconf failed"
 
 # Get some extra files from gnulib, overriding existing files.
 for file in $gnulib_extra_files; do
@@ -896,7 +912,8 @@ for file in $gnulib_extra_files; do
   build-aux/*) dst=$build_aux/${file#build-aux/};;
   *) dst=$file;;
   esac
-  symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
+  symlink_to_dir "$GNULIB_SRCDIR" $file $dst \
+    || die "failed to symlink $file"
 done
 
 if test $with_gettext = yes; then
@@ -912,7 +929,8 @@ if test $with_gettext = yes; then
       a\
           '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
     }
-  ' po/Makevars.template >po/Makevars || exit 1
+  ' po/Makevars.template >po/Makevars \
+    || die 'cannot generate po/Makevars'
 
   # If the 'gettext' module is in use, grab the latest Makefile.in.in.
   # If only the 'gettext-h' module is in use, assume autopoint already
@@ -920,7 +938,8 @@ if test $with_gettext = yes; then
   case $gnulib_modules in
   *gettext-h*) ;;
   *gettext*)
-    cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in || exit 1
+    cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \
+      || die "cannot create po/Makefile.in.in"
     ;;
   esac
 
@@ -936,7 +955,8 @@ if test $with_gettext = yes; then
         a\
             '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
       }
-    ' po/Makevars.template >runtime-po/Makevars || exit 1
+    ' po/Makevars.template >runtime-po/Makevars \
+    || die 'cannot generate runtime-po/Makevars'
 
     # Copy identical files from po to runtime-po.
     (cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)

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

Summary of changes:
 ChangeLog |    4 ++
 bootstrap |  118 +++++++++++++++++++++++++++++++++++-------------------------
 2 files changed, 73 insertions(+), 49 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Aug 22 07:51:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T49Sx-000118-2q
	for mharc-commit-inetutils@gnu.org; Wed, 22 Aug 2012 07:51:19 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33546)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T49Sp-00010O-TX
	for commit-inetutils@gnu.org; Wed, 22 Aug 2012 07:51:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T49Sj-0002TZ-6m
	for commit-inetutils@gnu.org; Wed, 22 Aug 2012 07:51:11 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:49470)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T49Sj-0002TP-3C
	for commit-inetutils@gnu.org; Wed, 22 Aug 2012 07:51:05 -0400
Received: from jas by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <simon@josefsson.org>) id 1T49Si-00053y-KG
	for commit-inetutils@gnu.org; Wed, 22 Aug 2012 11:51:04 +0000
Date: Wed, 22 Aug 2012 11:51:04 +0000
Message-Id: <E1T49Si-00053y-KG@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-153-g8073192
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: d5021bb3ec84525f0ded3e5ae3a3c6e1aafee443
X-Git-Newrev: 8073192d2df6eb3e8d018e8ed68df4e1df5d75ba
From: Simon Josefsson <simon@josefsson.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 22 Aug 2012 11:51: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  8073192d2df6eb3e8d018e8ed68df4e1df5d75ba (commit)
      from  d5021bb3ec84525f0ded3e5ae3a3c6e1aafee443 (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=8073192d2df6eb3e8d018e8ed68df4e1df5d75ba


commit 8073192d2df6eb3e8d018e8ed68df4e1df5d75ba
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Aug 22 13:48:07 2012 +0200

    telnet: fix responding to DO commands, by initializing variables properly.
    
    Tiny patch from Petr Malát <oss@malat.biz>.

diff --git a/ChangeLog b/ChangeLog
index 5c0a7ab..53e22b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-22  Petr Malát  <oss@malat.biz>  (tiny change)
+
+	* telnet/telnet.c (options, do_dont_resp, will_wont_resp):
+	Initialize variables.
+	(init_telnet): Remove partial initialization from here.
+
 2012-08-22  Simon Josefsson  <simon@josefsson.org>
 
 	* bootstrap: Updated from gnulib.
diff --git a/telnet/telnet.c b/telnet/telnet.c
index a7f43f0..b5e4b64 100644
--- a/telnet/telnet.c
+++ b/telnet/telnet.c
@@ -105,9 +105,9 @@ static unsigned char subbuffer[SUBBUFSIZE], *subpointer, *subend;	/* buffer for
 #define SB_EOF()	(subpointer >= subend)
 #define SB_LEN()	(subend - subpointer)
 
-char options[256];		/* The combined options */
-char do_dont_resp[256];
-char will_wont_resp[256];
+char options[256] = { 0 };		/* The combined options */
+char do_dont_resp[256] = { 0 };
+char will_wont_resp[256] = { 0 };
 
 int eight = 0, autologin = 0,	/* Autologin anyone? */
   skiprc = 0, connected, showoptions, In3270,	/* Are we in 3270 mode? */
@@ -189,7 +189,6 @@ init_telnet (void)
   env_init ();
 
   SB_CLEAR ();
-  ClearArray (options);
 
   connected = In3270 = ISend = localflow = donebinarytoggle = 0;
 #if defined AUTHENTICATION || defined ENCRYPTION

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

Summary of changes:
 ChangeLog       |    6 ++++++
 telnet/telnet.c |    7 +++----
 2 files changed, 9 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Aug 24 03:08:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T4o0F-0000AW-ET
	for mharc-commit-inetutils@gnu.org; Fri, 24 Aug 2012 03:08:23 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47020)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T4o0C-00009w-5J
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 03:08:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T4o0A-0004Mj-RS
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 03:08:20 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:42094)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T4o0A-0004Md-OB
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 03:08:18 -0400
Received: from jas by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <simon@josefsson.org>) id 1T4o09-0005EW-OP
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 07:08:18 +0000
Date: Fri, 24 Aug 2012 07:08:17 +0000
Message-Id: <E1T4o09-0005EW-OP@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-154-gb189c9e
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 8073192d2df6eb3e8d018e8ed68df4e1df5d75ba
X-Git-Newrev: b189c9e69b5727a8325651b1a40dd3c849093a27
From: Simon Josefsson <simon@josefsson.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 24 Aug 2012 07:08: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  b189c9e69b5727a8325651b1a40dd3c849093a27 (commit)
      from  8073192d2df6eb3e8d018e8ed68df4e1df5d75ba (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=b189c9e69b5727a8325651b1a40dd3c849093a27


commit b189c9e69b5727a8325651b1a40dd3c849093a27
Author: Simon Josefsson <simon@josefsson.org>
Date:   Fri Aug 24 09:07:17 2012 +0200

    Don't busy loop when waiting for data from client.
    
    Tiny patch from Petr Malát <oss@malat.biz>.

diff --git a/ChangeLog b/ChangeLog
index 53e22b1..dec4809 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-24  Petr Malát  <oss@malat.biz>  (tiny change)
+
+	* telnetd/utility.c (io_drain): New variable rfds.
+	(io_drain): Use select to wait for data to be available.
+
 2012-08-22  Petr Malát  <oss@malat.biz>  (tiny change)
 
 	* telnet/telnet.c (options, do_dont_resp, will_wont_resp):
diff --git a/telnetd/utility.c b/telnetd/utility.c
index b96a18f..1128cea 100644
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -402,21 +402,23 @@ pty_read (void)
 void
 io_drain (void)
 {
+  fd_set rfds;
+
   DEBUG (debug_report, 1, debug_output_data ("td: ttloop\r\n"));
   if (nfrontp - nbackp > 0)
     netflush ();
 
-again:
+  FD_ZERO(&rfds);
+  FD_SET(net, &rfds);
+  if (1 != select(net + 1, &rfds, NULL, NULL, NULL))
+    {
+      syslog (LOG_INFO, "ttloop:  select: %m\n");
+      exit (EXIT_FAILURE);
+    }
+
   ncc = read (net, netibuf, sizeof netibuf);
   if (ncc < 0)
     {
-      if (errno == EAGAIN)
-	{
-	  /*
-	   * syslog (LOG_INFO, "ttloop: retrying");
-	   */
-	  goto again;
-	}
       syslog (LOG_INFO, "ttloop:  read: %m\n");
       exit (EXIT_FAILURE);
     }

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

Summary of changes:
 ChangeLog         |    5 +++++
 telnetd/utility.c |   18 ++++++++++--------
 2 files changed, 15 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Aug 24 03:10:25 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T4o2D-0001H1-Po
	for mharc-commit-inetutils@gnu.org; Fri, 24 Aug 2012 03:10:25 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38979)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T4o29-00016v-6L
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 03:10:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T4o27-000523-Vm
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 03:10:21 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:42189)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <simon@josefsson.org>) id 1T4o27-00051t-QW
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 03:10:19 -0400
Received: from jas by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <simon@josefsson.org>) id 1T4o27-0005Jr-IL
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 07:10:19 +0000
Date: Fri, 24 Aug 2012 07:10:19 +0000
Message-Id: <E1T4o27-0005Jr-IL@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-155-gca404fb
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: b189c9e69b5727a8325651b1a40dd3c849093a27
X-Git-Newrev: ca404fb90885aa8d36f689936513295add317e16
From: Simon Josefsson <simon@josefsson.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 24 Aug 2012 07:10:24 -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  ca404fb90885aa8d36f689936513295add317e16 (commit)
      from  b189c9e69b5727a8325651b1a40dd3c849093a27 (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=ca404fb90885aa8d36f689936513295add317e16


commit ca404fb90885aa8d36f689936513295add317e16
Author: Simon Josefsson <simon@josefsson.org>
Date:   Fri Aug 24 09:09:44 2012 +0200

    Use 2kb buffer, as suggested by GNU termcap manual.
    
    Tiny patch from Petr Malát  <oss@malat.biz>.

diff --git a/ChangeLog b/ChangeLog
index dec4809..fd41f82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-08-24  Petr Malát  <oss@malat.biz>  (tiny change)
 
+	* telnetd/utility.c (terminaltypeok): Use 2kb buffer, as suggested
+	by GNU termcap manual.
+
+2012-08-24  Petr Malát  <oss@malat.biz>  (tiny change)
+
 	* telnetd/utility.c (io_drain): New variable rfds.
 	(io_drain): Use select to wait for data to be available.
 
diff --git a/telnetd/utility.c b/telnetd/utility.c
index 1128cea..b02601a 100644
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -845,7 +845,7 @@ getterminaltype (char *user_name)
 int
 terminaltypeok (char *s)
 {
-  char buf[1024];
+  char buf[2048];
 
   if (terminaltype == NULL)
     return 1;

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

Summary of changes:
 ChangeLog         |    5 +++++
 telnetd/utility.c |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Aug 24 05:54:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T4qb4-00067n-Jn
	for mharc-commit-inetutils@gnu.org; Fri, 24 Aug 2012 05:54:34 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41770)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T4qax-00067B-Ph
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 05:54:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T4qaw-0003i1-8r
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 05:54:27 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:59845)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T4qaw-0003hw-5I
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 05:54:26 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1T4qav-0004mX-20
	for commit-inetutils@gnu.org; Fri, 24 Aug 2012 09:54:25 +0000
Date: Fri, 24 Aug 2012 09:54:25 +0000
Message-Id: <E1T4qav-0004mX-20@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-156-g1bf2a40
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: ca404fb90885aa8d36f689936513295add317e16
X-Git-Newrev: 1bf2a40a9b36d84c0931b0308f163d4ba7cb8576
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 24 Aug 2012 09:54:33 -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  1bf2a40a9b36d84c0931b0308f163d4ba7cb8576 (commit)
      from  ca404fb90885aa8d36f689936513295add317e16 (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=1bf2a40a9b36d84c0931b0308f163d4ba7cb8576


commit 1bf2a40a9b36d84c0931b0308f163d4ba7cb8576
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Aug 24 11:43:12 2012 +0200

    Test script update.

diff --git a/ChangeLog b/ChangeLog
index fd41f82..9cf0df7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-24  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* tests/tftp.sh (silence, bucket): New variables.
+	Make the script silent in standard case.
+
 2012-08-24  Petr Malát  <oss@malat.biz>  (tiny change)
 
 	* telnetd/utility.c (terminaltypeok): Use 2kb buffer, as suggested
diff --git a/tests/tftp.sh b/tests/tftp.sh
index c9c66dc..65e6b77 100755
--- a/tests/tftp.sh
+++ b/tests/tftp.sh
@@ -36,7 +36,12 @@ $need_dd || exit_no_dd
 $need_mktemp || exit_no_mktemp
 $need_netstat || exit_no_netstat
 
-if [ "$VERBOSE" ]; then
+if test -z "${VERBOSE+set}"; then
+    silence=:
+    bucket='>/dev/null'
+fi
+
+if test -n "$VERBOSE"; then
     set -x
 fi
 
@@ -295,15 +300,15 @@ SUCCESSES=0
 EFFORTS=0
 RESULT=0
 
-echo "Looking into '`echo $ADDRESSES | tr "\n" ' '`'."
+$silence echo "Looking into '`echo $ADDRESSES | tr "\n" ' '`'."
 
 for addr in $ADDRESSES; do
-    echo "trying address '$addr'..." >&2
+    $silence echo "trying address '$addr'..." >&2
 
     for name in $FILELIST; do
 	EFFORTS=`expr $EFFORTS + 1`
 	rm -f $name
-	echo "get $name" | "$TFTP" ${VERBOSE:+-v} "$addr" $PORT
+	echo "get $name" | eval "$TFTP" ${VERBOSE:+-v} "$addr" $PORT $bucket
 
 	cmp "$TMPDIR/tftp-test/$name" "$name" 2>/dev/null
 	result=$?
@@ -335,10 +340,10 @@ locate_port $PROTO $PORT &&
 	locate_port $PROTO $PORT && do_conf_reload=false
     }
 
-echo
+$silence echo >&2
 
 if $do_conf_reload; then
-    echo >&2 'Testing altered and reloaded configuration.'
+    $silence echo >&2 'Testing altered and reloaded configuration.'
     write_conf ||
 	{
 	    echo >&2 'Could not rewrite configuration file for Inetd.  Failing.'
@@ -350,7 +355,7 @@ if $do_conf_reload; then
     for addr in $ADDRESSES; do
 	EFFORTS=`expr $EFFORTS + 1`
 	test -f "$name" && rm "$name"
-	echo "get $name" | "$TFTP" ${VERBOSE:+-v} "$addr" $PORT
+	echo "get $name" | eval "$TFTP" ${VERBOSE:+-v} "$addr" $PORT $bucket
 	cmp "$TMPDIR/tftp-test/$name" "$name" 2>/dev/null
 	result=$?
 	if test $result -ne 0; then
@@ -362,11 +367,12 @@ if $do_conf_reload; then
 	fi
     done
 else
-    echo >&2 'Informational: Inhibiting config reload test.'
+    $silence echo >&2 'Informational: Inhibiting config reload test.'
 fi
 
 # Minimal clean up. Main work in posttesting().
-echo
-echo Tests in $0 had $SUCCESSES successes out of $EFFORTS cases.
+$silence echo
+test $RESULT -eq 0 && $silence false \
+    || echo Test had $SUCCESSES successes out of $EFFORTS cases.
 
 exit $RESULT

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

Summary of changes:
 ChangeLog     |    5 +++++
 tests/tftp.sh |   26 ++++++++++++++++----------
 2 files changed, 21 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Aug 29 20:42:37 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T6sqD-0002Sa-1H
	for mharc-commit-inetutils@gnu.org; Wed, 29 Aug 2012 20:42:37 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45758)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T6sqA-0002S2-Km
	for commit-inetutils@gnu.org; Wed, 29 Aug 2012 20:42:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T6sq8-0007bM-CF
	for commit-inetutils@gnu.org; Wed, 29 Aug 2012 20:42:34 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:53644)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T6sq8-0007bI-87
	for commit-inetutils@gnu.org; Wed, 29 Aug 2012 20:42:32 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1T6sq7-0008Dy-P3
	for commit-inetutils@gnu.org; Thu, 30 Aug 2012 00:42:32 +0000
Date: Thu, 30 Aug 2012 00:42:31 +0000
Message-Id: <E1T6sq7-0008Dy-P3@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-157-g910a251
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 1bf2a40a9b36d84c0931b0308f163d4ba7cb8576
X-Git-Newrev: 910a251821bd879991cc11f73908402e575c3d5e
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 30 Aug 2012 00:42: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  910a251821bd879991cc11f73908402e575c3d5e (commit)
      from  1bf2a40a9b36d84c0931b0308f163d4ba7cb8576 (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=910a251821bd879991cc11f73908402e575c3d5e


commit 910a251821bd879991cc11f73908402e575c3d5e
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Aug 30 02:28:36 2012 +0200

    Configuration impovements.

diff --git a/ChangeLog b/ChangeLog
index 9cf0df7..87b909a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2012-08-30  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* configure.ac: Add a final AC_MSG_NOTICE, containing a summary
+	of established compilation tasks.
+	(KERBEROS_VERSION): Assign values `krb4' and `krb5'.  Change test
+	values in case patterns.
+	(enable_authentication, enable_encryption) [-n KERBEROS_VERSION]:
+	Assign `yes' as default value in two separate tests.
+	<KERBEROS_VERSION == Shishi>: Have `--without-shishi' bypass
+	the feature checks for libshishi.  Set KERBEROS_VERSION empty
+	when AC_CHECK_LIB fails.  Empty INCAUTH, LIBAUTH, and also
+	KERBEROS_VERSION when AC_CHECK_HEADER fails.
+
+	* tests/Makefile.am (bin_PROGRAMS): Remove variable.
+	(check_PROGRAMS): New variable replaces bin_PROGRAMS, not added
+	to variable TESTS.
+
+	* tests/syslogd.sh (silence): New variable, decreases verbosity.
+
 2012-08-24  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* tests/tftp.sh (silence, bucket): New variables.
diff --git a/configure.ac b/configure.ac
index a32dc9d..d147fd5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,12 +39,12 @@ AC_SUBST(inetdaemondir)
 AC_ARG_WITH([krb4],
             AC_HELP_STRING([--with-krb4[[=PATH]]],
                            [Compile with Kerberos IV]),
-            [KERBEROS_VERSION=4
+            [KERBEROS_VERSION=krb4
              KERBEROS_DIR=$withval])
 AC_ARG_WITH([krb5],
             AC_HELP_STRING([--with-krb5[[=PATH]]],
                            [Compile with Kerberos V]),
-            [KERBEROS_VERSION=5
+            [KERBEROS_VERSION=krb5
              KERBEROS_DIR=$withval])
 AC_ARG_WITH([shishi],
             AC_HELP_STRING([--with-shishi[[=PATH]]],
@@ -54,11 +54,11 @@ AC_ARG_WITH([shishi],
 
 AC_ARG_ENABLE([servers],
               AC_HELP_STRING([--disable-servers],
-                             [Don't compile servers]),
+                             [Do not compile servers]),
 	      , [enable_servers=yes])
 AC_ARG_ENABLE([clients],
               AC_HELP_STRING([--disable-clients],
-                             [Don't compile clients]),
+                             [Do not compile clients]),
 	      , [enable_clients=yes])
 AC_ARG_ENABLE([libls],
               AC_HELP_STRING([--disable-libls],
@@ -67,19 +67,17 @@ AC_ARG_ENABLE([libls],
 AC_ARG_ENABLE([encryption],
               AC_HELP_STRING([--enable-encryption],
                              [Enable encryption]),
-              [test -z "$KERBEROS_VERSION" && AC_MSG_ERROR([--enable-encryption is given but no Kerberos version is required])],
+              [test -z "$KERBEROS_VERSION" && AC_MSG_ERROR([--enable-encryption is given, but a Kerberos version is not provided])],
               [test -z "$KERBEROS_VERSION" && enable_encryption=no])
 AC_ARG_ENABLE([authentication],
               AC_HELP_STRING([--enable-authentication],
                              [Enable connection authentication]),
-              [test -z "$KERBEROS_VERSION" && AC_MSG_ERROR([--enable-authentication is given but no Kerberos version is required])],
+              [test -z "$KERBEROS_VERSION" && AC_MSG_ERROR([--enable-authentication is given, but a Kerberos version is not provided])],
 	      [test -z "$KERBEROS_VERSION" && enable_authentication=no])
 
 if test -n "$KERBEROS_VERSION"; then
-  if test -z "$enable_authentication$enable_encryption"; then
-    enable_authentication=yes
-    enable_encryption=yes
-  fi
+  test -n "$enable_authentication" || enable_authentication=yes
+  test -n "$enable_encryption" || enable_encryption=yes
 fi
 
 AC_ARG_WITH([wrap],
@@ -318,7 +316,7 @@ if test "$enable_encryption" = yes \
   AH_TEMPLATE(DES_ENCRYPTION, [FIXME])
 
   case $KERBEROS_VERSION in
-  4)
+  krb4)
     AC_CHECK_LIB(krb, krb_mk_req,
                  LIBAUTH=-lkrb
                   AC_DEFINE([KRB4]),
@@ -341,31 +339,38 @@ if test "$enable_encryption" = yes \
       && AC_DEFINE([DES_ENCRYPTION])
     fi
     ;;
-  5)
-    IU_CHECK_KRB5($KERBEROS_VERSION,$KERBEROS_DIR)
+  krb5)
+    IU_CHECK_KRB5([5],$KERBEROS_DIR)
     LIBAUTH="$KRB5_LIBS" # FIXME
-    INCAUTH=$KRB5_CFLAGS
+    INCAUTH="$KRB5_CFLAGS"
     if test ".$LIBAUTH" != . ;then
       AC_DEFINE([KERBEROS])
       AC_DEFINE([KRB5])
     fi
     ;;
   *)
-    if test x$KERBEROS_DIR != x; then
-      LIBAUTH=-L$KERBEROS_DIR/lib
-      INCAUTH=-I$KERBEROS_DIR/include
+    # Properly handle --without-shishi.
+    if test x$KERBEROS_DIR = xno; then
+      KERBEROS_VERSION=
+    else
+      if test x$KERBEROS_DIR != x \
+	  && test x$KERBEROS_DIR != xyes; then
+	LIBAUTH=-L$KERBEROS_DIR/lib
+	INCAUTH=-I$KERBEROS_DIR/include
+      fi
+      LIBAUTH="$LIBAUTH -lshishi"
+      save_LIBS=$LIBS
+      LIBS="$LIBS $LIBAUTH"
+      save_CPPFLAGS=$CPPFLAGS
+      CPPFLAGS="$CPPFLAGS $INCAUTH"
+      AC_CHECK_HEADER(shishi.h,
+	AC_CHECK_LIB(shishi, shishi_check_version,
+	  AC_DEFINE([SHISHI]),
+	  [INCAUTH= LIBAUTH= KERBEROS_VERSION=]),
+	[INCAUTH= LIBAUTH= KERBEROS_VERSION=])
+      LIBS=$save_LIBS
+      CPPFLAGS=$save_CPPFLAGS
     fi
-    LIBAUTH="$LIBAUTH -lshishi"
-    save_LIBS=$LIBS
-    LIBS="$LIBS $LIBAUTH"
-    save_CPPFLAGS=$CPPFLAGS
-    CPPFLAGS="$CPPFLAGS $INCAUTH"
-    AC_CHECK_HEADER(shishi.h,
-      AC_CHECK_LIB(shishi, shishi_check_version,
-        AC_DEFINE([SHISHI]),
-        [INCAUTH= LIBAUTH=]))
-    LIBS=$save_LIBS
-    CPPFLAGS=$save_CPPFLAGS
   esac
 fi
 AC_SUBST(LIBAUTH)
@@ -893,7 +898,7 @@ if test "$inetutils_cv_macro_fd_set_macros" = no; then
     FD_ZERO FD_CLR FD_SET FD_ISSET)
 fi
 
-# Set convinience variables for inetutils.
+# Set convenience variables for inetutils.
 iu_LIBRARIES='$(top_builddir)/libinetutils/libinetutils.a $(top_builddir)/lib/libgnu.a'
 iu_INCLUDES='-I$(top_srcdir)/lib -I$(top_builddir)/lib -I$(top_srcdir)/libinetutils'
 AC_SUBST(iu_LIBRARIES)
@@ -946,3 +951,49 @@ tests/Makefile
 confpaths.h:confpaths.h.in
 ])
 AC_OUTPUT
+
+# Collect informational status.
+AC_MSG_NOTICE([summary of build decisions:
+
+  Clients:
+
+    dnsdomainname  ${enable_dnsdomainname}
+    ftp            ${enable_ftp}  \
+${ftp_BUILD:+${LIBREADLINE:+$LIBREADLINE }$LIBTERMCAP}
+    hostname       ${enable_hostname}
+    ifconfig       ${enable_ifconfig}
+    logger         ${enable_logger}
+    ping           ${enable_ping}
+    ping6          ${enable_ping6}
+    rcp            ${enable_rcp}  \
+${rcp_BUILD:+$KERBEROS_VERSION}
+    rexec          ${enable_rexec}
+    rlogin         ${enable_rlogin}  \
+${rlogin_BUILD:+$KERBEROS_VERSION}
+    rsh            ${enable_rsh}  \
+${rshd_BUILD:+$KERBEROS_VERSION}
+    talk           ${enable_talk}
+    telnet         ${enable_telnet}  \
+${telnet_BUILD:+${KERBEROS_VERSION:+$KERBEROS_VERSION }$LIBTERMCAP}
+    tftp           ${enable_tftp}
+    traceroute     ${enable_traceroute}
+    whois          ${enable_whois}
+
+  Servers:
+
+    ftpd           ${enable_ftpd}  \
+${ftpd_BUILD:+${FTPD_LIBPAM:+PAM }$LIBWRAP}
+    inetd          ${enable_inetd}
+    rexecd         ${enable_rexecd}  \
+${rexecd_BUILD:+${LIBPAM:+PAM}}
+    rlogind        ${enable_rlogind}  \
+${rlogind_BUILD:+$KERBEROS_VERSION}
+    rshd           ${enable_rshd}  \
+${rshd_BUILD:+${KERBEROS_VERSION:+$KERBEROS_VERSION }${LIBPAM:+PAM}}
+    syslogd        ${enable_syslogd}
+    talkd          ${enable_talkd}
+    telnetd        ${enable_telnetd}  \
+${telnetd_BUILD:+${KERBEROS_VERSION:+$KERBEROS_VERSION }$LIBTERMCAP}
+    tftpd          ${enable_tftpd}
+    uucpd          ${enable_uucpd}
+])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1b3c60a..0a9ba70 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -21,9 +21,9 @@ AM_CPPFLAGS = $(iu_INCLUDES)
 
 LDADD = $(iu_LIBRARIES)
 
-bin_PROGRAMS = localhost
+check_PROGRAMS = localhost
 if ENABLE_inetd
-bin_PROGRAMS += addrpeek
+check_PROGRAMS += addrpeek
 endif
 
 dist_check_SCRIPTS =
@@ -68,7 +68,7 @@ if ENABLE_dnsdomainname
 dist_check_SCRIPTS += dnsdomainname.sh
 endif
 
-TESTS = $(bin_PROGRAMS) $(dist_check_SCRIPTS)
+TESTS = $(dist_check_SCRIPTS)
 
 TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT)
 
diff --git a/tests/syslogd.sh b/tests/syslogd.sh
index 0409d8b..08f8cb7 100755
--- a/tests/syslogd.sh
+++ b/tests/syslogd.sh
@@ -58,6 +58,10 @@ fi
 
 . ./tools.sh
 
+if test -z "${VERBOSE+set}"; then
+    silence=:
+fi
+
 # Portability fix for SVR4
 PWD="${PWD:-`pwd`}"
 
@@ -274,7 +278,7 @@ rm -f "$OUT" "$PID" "$CONF"
 test `func_id_uid` = 0 || do_standard_port=false
 
 if test `func_id_uid` != 0 && test $PORT -le 1023; then
-    cat <<-EOT >&2
+    $silence cat <<-EOT >&2
 	WARNING!!  The preset port $PORT/$PROTO is not usable,
 	since you are underprivileged.  Now attempting
 	a randomised higher port.
@@ -503,7 +507,8 @@ if [ -n "${VERBOSE+yes}" ]; then
 	EOT
 fi
 
-echo "Registered $SUCCESSES successes out of $TESTCASES."
+test $SUCCESSES -eq $TESTCASES && $silence false \
+    || echo "Registered $SUCCESSES successes out of $TESTCASES."
 
 # Report incomplete test setup.
 $do_inet_socket ||
@@ -512,10 +517,10 @@ $do_standard_port ||
     echo 'NOTICE: Standard port test was not run.' >&1
 
 if [ "$SUCCESSES" -eq "$TESTCASES" ]; then
-    echo "Successful testing."
+    $silence echo "Successful testing."
     EXITCODE=0
 else
-    echo "Failing some tests."
+    $silence echo "Failing some tests."
 fi
 
 # Remove the daemon process.

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

Summary of changes:
 ChangeLog         |   19 +++++++++
 configure.ac      |  109 +++++++++++++++++++++++++++++++++++++++--------------
 tests/Makefile.am |    6 +-
 tests/syslogd.sh  |   13 ++++--
 4 files changed, 111 insertions(+), 36 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Aug 31 12:25:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1T7U2U-0002XP-Pl
	for mharc-commit-inetutils@gnu.org; Fri, 31 Aug 2012 12:25:46 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47277)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T7U2O-0002Wr-B7
	for commit-inetutils@gnu.org; Fri, 31 Aug 2012 12:25:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T7U2M-0008BG-3Y
	for commit-inetutils@gnu.org; Fri, 31 Aug 2012 12:25:40 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:34080)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1T7U2M-0008BC-0A
	for commit-inetutils@gnu.org; Fri, 31 Aug 2012 12:25:38 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1T7U2L-0005bb-Aj
	for commit-inetutils@gnu.org; Fri, 31 Aug 2012 16:25:37 +0000
Date: Fri, 31 Aug 2012 16:25:37 +0000
Message-Id: <E1T7U2L-0005bb-Aj@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-158-g3841619
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 910a251821bd879991cc11f73908402e575c3d5e
X-Git-Newrev: 3841619d01f81d265c9cec7c37a1388bda465a1b
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
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, 31 Aug 2012 16:25:45 -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  3841619d01f81d265c9cec7c37a1388bda465a1b (commit)
      from  910a251821bd879991cc11f73908402e575c3d5e (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=3841619d01f81d265c9cec7c37a1388bda465a1b


commit 3841619d01f81d265c9cec7c37a1388bda465a1b
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Aug 31 17:30:50 2012 +0200

    ping, ping6: Support IDN named hosts.

diff --git a/ChangeLog b/ChangeLog
index 87b909a..1c8c87f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2012-08-31  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ping, ping6: Support IDN named hosts.
+
+	* configure.ac: New checks for `locale.h' and setlocale().
+	(--with-idn): New setting.
+	(INCIDN, LIBIDN): New variables.
+	* ping/Makefile.am (ping_LDADD): Add $(LIBIDN).
+	(ping6_LDADD): Likewise.
+	(INCLUDES): Add $(INCIDN).
+	* ping/libping.c [HAVE_LOCALE_H]: Include <locale.h>.
+	[HAVE_IDNA_H]: Include <idna.h>.
+	(ping_set_dest) [HAVE_IDN]: New variables P and RC.
+	Resolve HOST by a call to idna_to_ascii_lz().
+	[HAVE_IDN && HAVE_SETLOCALE]: Call setlocale().
+	* ping/ping6.c [HAVE_LOCALE_H]: Include <locale.h>.
+	[HAVE_IDNA_H]: Include <idna.h>.
+	(ping_set_dest): New variable RHOST used in getaddrinfo().
+	[!HAVE_IDN]: Make RHOST a reference to HOST.
+	[HAVE_IDN]: Resolve HOST by a call to idna_to_ascii_lz().
+	[HAVE_IDN && HAVE_SETLOCALE]: Call setlocale().
+
 2012-08-30  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* configure.ac: Add a final AC_MSG_NOTICE, containing a summary
diff --git a/configure.ac b/configure.ac
index d147fd5..e313b59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,6 +86,10 @@ AC_ARG_WITH([wrap],
 AC_ARG_WITH([pam],
             AC_HELP_STRING([--with-pam],
                            [Add support for PAM]))
+AC_ARG_WITH([idn],
+  AC_HELP_STRING([--with-idn],
+		 [Use IDN support, with optional inclusion directory]), ,
+		 [with_idn=no])
 
 IU_ENABLE_SERVER(ftpd)
 IU_ENABLE_SERVER(inetd)
@@ -557,6 +561,31 @@ if test "$with_wrap" = yes; then
 fi
 AC_SUBST(LIBWRAP)
 
+### Check for GNU Libidn
+AC_CHECK_HEADERS([locale.h])
+AC_CHECK_FUNCS([setlocale])
+if test x"$with_idn" != xno \
+    && test "$ac_cv_header_locale_h" = yes \
+    && test "$ac_cv_func_setlocale" = yes; then
+  AC_MSG_CHECKING([if GNU libidn is available])
+  if test x"$with_idn" != xyes; then
+    INCIDN=-I$with_idn
+  fi
+  save_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS $INCIDN"
+  AC_CHECK_HEADERS([idna.h])
+  if test "$ac_cv_header_idna_h" = yes; then
+    AC_CHECK_LIB(idn, idna_to_ascii_lz, [LIBIDN=-lidn], [INCIDN=])
+    if test "$ac_cv_lib_idn_idna_to_ascii_lz" = yes; then
+      AC_DEFINE(HAVE_IDN, 1, [Define to 1 for use of GNU Libidn.])
+    fi
+  fi
+  AC_MSG_RESULT($ac_cv_lib_idna_to_ascii_lz)
+  CPPFLAGS=$save_CPPFLAGS
+fi
+AC_SUBST([LIBIDN])
+AC_SUBST([INCIDN])
+
 ### Checks for header files.
 
 AC_HEADER_STDC
@@ -963,8 +992,10 @@ ${ftp_BUILD:+${LIBREADLINE:+$LIBREADLINE }$LIBTERMCAP}
     hostname       ${enable_hostname}
     ifconfig       ${enable_ifconfig}
     logger         ${enable_logger}
-    ping           ${enable_ping}
-    ping6          ${enable_ping6}
+    ping           ${enable_ping}  \
+${ping_BUILD:+$LIBIDN}
+    ping6          ${enable_ping6}  \
+${ping6_BUILD:+$LIBIDN}
     rcp            ${enable_rcp}  \
 ${rcp_BUILD:+$KERBEROS_VERSION}
     rexec          ${enable_rexec}
diff --git a/ping/Makefile.am b/ping/Makefile.am
index 8314662..0b51189 100644
--- a/ping/Makefile.am
+++ b/ping/Makefile.am
@@ -22,9 +22,9 @@ bin_PROGRAMS = $(ping_BUILD) $(ping6_BUILD)
 
 EXTRA_PROGRAMS = ping ping6
 
-ping_LDADD = $(iu_LIBRARIES) $(top_builddir)/libicmp/libicmp.a
-ping6_LDADD = $(iu_LIBRARIES)
-INCLUDES = $(iu_INCLUDES) -I$(top_srcdir)/libicmp
+ping_LDADD = $(iu_LIBRARIES) $(top_builddir)/libicmp/libicmp.a $(LIBIDN)
+ping6_LDADD = $(iu_LIBRARIES) $(LIBIDN)
+INCLUDES = $(iu_INCLUDES) -I$(top_srcdir)/libicmp $(INCIDN)
 
 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/ping/libping.c b/ping/libping.c
index 41d3f92..a2bf3d7 100644
--- a/ping/libping.c
+++ b/ping/libping.c
@@ -33,6 +33,12 @@
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+#ifdef HAVE_IDNA_H
+# include <idna.h>
+#endif
 
 #include "ping.h"
 
@@ -273,7 +279,22 @@ ping_set_dest (PING * ping, char *host)
     ping->ping_hostname = strdup (host);
   else
     {
-      struct hostent *hp = gethostbyname (host);
+      struct hostent *hp;
+#ifdef HAVE_IDN
+      char *p;
+      int rc;
+
+# ifdef HAVE_SETLOCALE
+      setlocale(LC_ALL, "");
+# endif
+      rc = idna_to_ascii_lz (host, &p, 0);
+      if (rc)
+	return 1;
+      hp = gethostbyname (p);
+      free (p);
+#else /* !HAVE_IDN */
+      hp = gethostbyname (host);
+#endif
       if (!hp)
 	return 1;
 
diff --git a/ping/ping6.c b/ping/ping6.c
index d432af4..4f3e948 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -41,6 +41,12 @@
 #include <ctype.h>
 #include <errno.h>
 #include <limits.h>
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+#ifdef HAVE_IDNA_H
+# include <idna.h>
+#endif
 
 #include <xalloc.h>
 #include "ping6.h"
@@ -877,12 +883,26 @@ ping_set_dest (PING * ping, char *host)
 {
   int err;
   struct addrinfo *result, hints;
+  char *rhost;
 
-  memset (&hints, 0, sizeof (hints));
+#ifdef HAVE_IDN
+# ifdef HAVE_SETLOCALE
+  setlocale (LC_ALL, "");
+# endif
+  err = idna_to_ascii_lz (host, &rhost, 0);
+  if (err)
+    return 1;
+#else /* !HAVE_IDN */
+  rhost = host;
+#endif
 
+  memset (&hints, 0, sizeof (hints));
   hints.ai_family = AF_INET6;
 
-  err = getaddrinfo (host, NULL, &hints, &result);
+  err = getaddrinfo (rhost, NULL, &hints, &result);
+#if HAVE_IDN
+  free (rhost);
+#endif
   if (err)
     return 1;
 

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

Summary of changes:
 ChangeLog        |   22 ++++++++++++++++++++++
 configure.ac     |   35 +++++++++++++++++++++++++++++++++--
 ping/Makefile.am |    6 +++---
 ping/libping.c   |   23 ++++++++++++++++++++++-
 ping/ping6.c     |   24 ++++++++++++++++++++++--
 5 files changed, 102 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


