From MAILER-DAEMON Wed Oct 03 16:22:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TJVSK-0003Yl-8r
	for mharc-commit-inetutils@gnu.org; Wed, 03 Oct 2012 16:22:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58625)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TJVSF-0003XZ-2D
	for commit-inetutils@gnu.org; Wed, 03 Oct 2012 16:22:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TJVSA-0004o9-Ne
	for commit-inetutils@gnu.org; Wed, 03 Oct 2012 16:22:02 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:49823)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TJVSA-0004nk-IO
	for commit-inetutils@gnu.org; Wed, 03 Oct 2012 16:21:58 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TJVSA-00087D-4Y
	for commit-inetutils@gnu.org; Wed, 03 Oct 2012 20:21:58 +0000
Date: Wed, 03 Oct 2012 20:21:58 +0000
Message-Id: <E1TJVSA-00087D-4Y@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-181-g066ab95
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 303e2467054ace8a8951d42ae28e714a67059295
X-Git-Newrev: 066ab951480bcdf9599da7e8a1f2822b116fa5ef
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, 03 Oct 2012 20:22: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  066ab951480bcdf9599da7e8a1f2822b116fa5ef (commit)
       via  6cc00eea329b672efee344f71844d70796d90510 (commit)
       via  99971d407ceff56f8f6be622d8295f20f7104e41 (commit)
      from  303e2467054ace8a8951d42ae28e714a67059295 (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=066ab951480bcdf9599da7e8a1f2822b116fa5ef


commit 066ab951480bcdf9599da7e8a1f2822b116fa5ef
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Tue Oct 2 16:31:21 2012 +0200

    Overflow protection.

diff --git a/ChangeLog b/ChangeLog
index 801b192..a6cc7af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2012-10-02  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	* libinetutils/logwtmp.c [HAVE_STRUCT_UTMPX_UT_SYSLEN]:
+	Take care of overlong host name when storing length
+	in `ut.ut_syslen'.
+	* libinetutils/logwtmpko.c, libinetutils/utmp_init.c:
+	Likewise.
+
+	* ftpd/popen.c, libinetutils/daemon.c,
+	libinetutils/ttymsg.c, src/inetd.c, src/rshd.c,
+	src/syslogd.c, telnet/commands.c: Call _exit()
+	with EXIT_SUCCESS or EXIT_FAILURE, not 0 or 1.
+
+2012-10-02  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	uucpd: Upgrade, including IPv6.
 
 	* src/uucpd.c: Include <unused-parameter.h>.
diff --git a/ftpd/popen.c b/ftpd/popen.c
index 8aa8a11..8cc6857 100644
--- a/ftpd/popen.c
+++ b/ftpd/popen.c
@@ -183,7 +183,7 @@ ftpd_popen (char *program, const char *type)
 #endif
 
       execv (gargv[0], gargv);
-      _exit (1);
+      _exit (EXIT_FAILURE);
     }
   /* parent; assume fdopen can't fail...  */
   if (*type == 'r')
diff --git a/libinetutils/daemon.c b/libinetutils/daemon.c
index 5606b10..1265c68 100644
--- a/libinetutils/daemon.c
+++ b/libinetutils/daemon.c
@@ -142,7 +142,7 @@ waitdaemon (int nochdir, int noclose, int maxwait)
 	  alarm (maxwait);
 	  pause ();
 	}
-      _exit (0);
+      _exit (EXIT_SUCCESS);
     }
 
   if (setsid () == -1)
@@ -163,7 +163,7 @@ waitdaemon (int nochdir, int noclose, int maxwait)
       return -1;
 
     default:
-      _exit (0);
+      _exit (EXIT_SUCCESS);
     }
 
   if (!nochdir)
diff --git a/libinetutils/logwtmp.c b/libinetutils/logwtmp.c
index e8a0965..d859efe 100644
--- a/libinetutils/logwtmp.c
+++ b/libinetutils/logwtmp.c
@@ -136,7 +136,13 @@ logwtmp (char *line, char *name, char *host)
 #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.  */
+  if (strlen (host) < sizeof (ut.ut_host))
+    ut.ut_syslen = strlen (host) + 1;	/* Including NUL.  */
+  else
+    {
+      ut.ut_host[sizeof (ut.ut_host) - 1] = '\0';
+      ut.ut_syslen = sizeof (ut.ut_host);
+    }
 # endif /* UT_SYSLEN */
 #endif /* UT_HOST */
 
diff --git a/libinetutils/logwtmpko.c b/libinetutils/logwtmpko.c
index ec4135a..a40ad07 100644
--- a/libinetutils/logwtmpko.c
+++ b/libinetutils/logwtmpko.c
@@ -54,7 +54,13 @@ logwtmp (char *line, char *name, char *host)
 #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.  */
+  if (strlen (host) < sizeof (ut.ut_host))
+    ut.ut_syslen = strlen (host) + 1;
+  else
+    {
+      ut.ut_host[sizeof (ut.ut_host) - 1] = '\0';
+      ut.ut_syslen = sizeof (ut.ut_host);
+    }
 # endif /* UT_SYSLEN */
 #endif
 #ifdef HAVE_STRUCT_UTMPX_UT_PID
diff --git a/libinetutils/ttymsg.c b/libinetutils/ttymsg.c
index b25d07a..8d4e0b2 100644
--- a/libinetutils/ttymsg.c
+++ b/libinetutils/ttymsg.c
@@ -152,7 +152,7 @@ ttymsg (struct iovec *iov, int iovcnt, char *line, int tmout)
 	  if (forked)
 	    {
 	      close (fd);
-	      _exit (1);
+	      _exit (EXIT_FAILURE);
 	    }
 	  cpid = fork2 ();
 	  if (cpid < 0)
@@ -194,7 +194,7 @@ ttymsg (struct iovec *iov, int iovcnt, char *line, int tmout)
 	break;
       close (fd);
       if (forked)
-	_exit (1);
+	_exit (EXIT_FAILURE);
       snprintf (errbuf, sizeof (errbuf), "%s: %s", device, strerror (errno));
       free (device);
       return (errbuf);
@@ -203,7 +203,7 @@ ttymsg (struct iovec *iov, int iovcnt, char *line, int tmout)
   free (device);
   close (fd);
   if (forked)
-    _exit (0);
+    _exit (EXIT_SUCCESS);
   return (NULL);
 }
 
@@ -232,7 +232,7 @@ fork2 (void)
 	case -1:
 	  _exit (errno);	/* Assumes all errnos are <256 */
 	default:		/* Parent.  */
-	  _exit (0);
+	  _exit (EXIT_SUCCESS);
 	}
     }
 
diff --git a/libinetutils/utmp_init.c b/libinetutils/utmp_init.c
index b598a9f..6cbfd10 100644
--- a/libinetutils/utmp_init.c
+++ b/libinetutils/utmp_init.c
@@ -91,7 +91,13 @@ utmp_init (char *line, char *user, char *id, char *host)
 #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;
+  if (strlen (host) < sizeof (utx.ut_host))
+    utx.ut_syslen = strlen (host) + 1;
+  else
+    {
+      utx.ut_host[sizeof (utx.ut_host) - 1] = '\0';
+      utx.ut_syslen = sizeof (utx.ut_host);
+    }
 # endif
 #endif /* UT_HOST */
 #if defined HAVE_STRUCT_UTMP_UT_LINE || defined HAVE_STRUCT_UTMPX_UT_LINE
diff --git a/src/inetd.c b/src/inetd.c
index 51b812b..5c720de 100644
--- a/src/inetd.c
+++ b/src/inetd.c
@@ -438,7 +438,7 @@ run_service (int ctrl, struct servtab *sep)
 		  sep->se_service, sep->se_proto, sep->se_user);
 	  if (sep->se_socktype != SOCK_STREAM)
 	    recv (0, buf, sizeof buf, 0);
-	  _exit (1);
+	  _exit (EXIT_FAILURE);
 	}
       if (sep->se_group && *sep->se_group)
 	{
@@ -449,7 +449,7 @@ run_service (int ctrl, struct servtab *sep)
 		      sep->se_service, sep->se_proto, sep->se_group);
 	      if (sep->se_socktype != SOCK_STREAM)
 		recv (0, buf, sizeof buf, 0);
-	      _exit (1);
+	      _exit (EXIT_FAILURE);
 	    }
 	}
       if (pwd->pw_uid)
@@ -460,14 +460,14 @@ run_service (int ctrl, struct servtab *sep)
 		{
 		  syslog (LOG_ERR, "%s: can't set gid %d: %m",
 			  sep->se_service, grp->gr_gid);
-		  _exit (1);
+		  _exit (EXIT_FAILURE);
 		}
 	    }
 	  else if (setgid (pwd->pw_gid) < 0)
 	    {
 	      syslog (LOG_ERR, "%s: can't set gid %d: %m",
 		      sep->se_service, pwd->pw_gid);
-	      _exit (1);
+	      _exit (EXIT_FAILURE);
 	    }
 #ifdef HAVE_INITGROUPS
 	  initgroups (pwd->pw_name,
@@ -477,14 +477,14 @@ run_service (int ctrl, struct servtab *sep)
 	    {
 	      syslog (LOG_ERR, "%s: can't set uid %d: %m",
 		      sep->se_service, pwd->pw_uid);
-	      _exit (1);
+	      _exit (EXIT_FAILURE);
 	    }
 	}
       execv (sep->se_server, sep->se_argv);
       if (sep->se_socktype != SOCK_STREAM)
 	recv (0, buf, sizeof buf, 0);
       syslog (LOG_ERR, "cannot execute %s: %m", sep->se_server);
-      _exit (1);
+      _exit (EXIT_FAILURE);
     }
 }
 
@@ -1768,7 +1768,7 @@ tcpmux (int s, struct servtab *sep)
   if (len < 0)
     {
       strwrite (s, "-Error reading service name\r\n");
-      _exit (1);
+      _exit (EXIT_FAILURE);
     }
   service[len] = '\0';
 
@@ -1788,7 +1788,7 @@ tcpmux (int s, struct servtab *sep)
 	  write (s, sep->se_service, strlen (sep->se_service));
 	  strwrite (s, "\r\n");
 	}
-      _exit (1);
+      _exit (EXIT_FAILURE);
     }
 
   /* Try matching a service in inetd.conf with the request */
diff --git a/src/rshd.c b/src/rshd.c
index 27d4017..35d8588 100644
--- a/src/rshd.c
+++ b/src/rshd.c
@@ -362,7 +362,7 @@ main (int argc, char *argv[])
   if (getpeername (sockfd, (struct sockaddr *) &from, &fromlen) < 0)
     {
       syslog (LOG_ERR, "getpeername: %m");
-      _exit (1);
+      _exit (EXIT_FAILURE);
     }
 
   /* Set the socket options: SO_KEEPALIVE and SO_LINGER */
diff --git a/src/syslogd.c b/src/syslogd.c
index 37dfd8a..f184459 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -1676,7 +1676,7 @@ logerror (const char *type)
 void
 doexit (int signo _GL_UNUSED_PARAMETER)
 {
-  _exit (0);
+  _exit (EXIT_SUCCESS);
 }
 
 void
diff --git a/telnet/commands.c b/telnet/commands.c
index e6b73d5..0375e72 100644
--- a/telnet/commands.c
+++ b/telnet/commands.c
@@ -1590,7 +1590,7 @@ shell (int argc, char *argv[] _GL_UNUSED_PARAMETER)
 	else
 	  execl (shellp, shellname, NULL);
 	perror ("Execl");
-	_exit (1);
+	_exit (EXIT_FAILURE);
       }
     default:
       wait ((int *) 0);		/* Wait for the shell to complete */

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


commit 6cc00eea329b672efee344f71844d70796d90510
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Tue Oct 2 14:39:34 2012 +0200

    uucpd: Upgrade, including IPv6.

diff --git a/ChangeLog b/ChangeLog
index 8ba9f02..801b192 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2012-10-02  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	uucpd: Upgrade, including IPv6.
+
+	* src/uucpd.c: Include <unused-parameter.h>.
+	(hisctladdr, hisaddrlen): Remove variables.
+	(uucico_location, Logname): New variables.
+	(nenv): Add `Logname'.
+	(argp_options): New variable.
+	(parse_opt): New function.
+	(argp): Add `argp_options' and `parse_opt'.
+	(main): New variables HISCTLADDR, HISADDRLEN.
+	(readline): Read from STDIN_FILENO.
+	(doit): New signature `(struct sockaddr *, socklen_t)'.
+	Remove truncation of USER.  Ask password for non-existent
+	user, then fail.  Check user shell after password check,
+	and compare to `uucico_location'.  Set LOGNAME in `nenv'
+	for portability.  Call execl() with `uucico_location'.
+	[HAVE_INITGROUPS]: Guard call to initgroups().
+	(dologin): New signature
+	`(struct passwd *, struct sockaddr *, socklen_t)'
+	[HAVE_DECL_GETNAMEINFO]: Use getnameinfo() as resolver.
+	[!HAVE_DECL_GETNAMEINFO]: Extend code with gethostbyaddr()
+	to accept IPv6.  Replace inet_ntoa() by inet_ntop().
+	(dologin) [HAVE_STRUCT_UTMPX_UT_SYSLEN]: Correctly set
+	the used length of `ut.ut_host'.
+
 2012-10-01  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	uucpd: Restore inetd code.
diff --git a/src/uucpd.c b/src/uucpd.c
index bee2803..4ff6295 100644
--- a/src/uucpd.c
+++ b/src/uucpd.c
@@ -87,28 +87,53 @@
 
 #include <argp.h>
 #include <progname.h>
+#include <unused-parameter.h>
 #include <libinetutils.h>
 
-void dologin (struct passwd *pw, struct sockaddr_in *sin);
+void dologin (struct passwd *pw, struct sockaddr *sap, socklen_t salen);
 void dologout (void);
-void doit (struct sockaddr_in *sinp);
-
-struct sockaddr_in hisctladdr;
-socklen_t hisaddrlen = sizeof (hisctladdr);
+void doit (struct sockaddr *sap, socklen_t salen);
 
+char *uucico_location = PATH_UUCICO;
 int mypid;
 
 char Username[64];
+char Logname[64];
 char *nenv[] = {
   Username,
+  Logname,
   NULL,
 };
 
 extern char **environ;
 
+static struct argp_option argp_options[] = {
+#define GRP 10
+  { "uucico", 'u', "LOCATION", 0,
+    "location of uucico executable, "
+    "replacing default at " PATH_UUCICO, GRP },
+#undef GRP
+  { NULL, 0, NULL, 0, NULL, 0 }
+};
+
+static error_t
+parse_opt (int key, char *arg,
+	   struct argp_state *state _GL_UNUSED_PARAMETER)
+{
+  switch (key)
+    {
+    case 'u':
+      uucico_location = arg;
+      break;
+    default:
+      return ARGP_ERR_UNKNOWN;
+    }
+  return 0;
+}
+
 static struct argp argp =
   {
-    NULL, NULL, NULL,
+    argp_options, parse_opt, NULL,
     "TCP/IP server for uucico.",
     NULL, NULL, NULL
   };
@@ -116,6 +141,9 @@ static struct argp argp =
 int
 main (int argc, char **argv)
 {
+  struct sockaddr_storage hisctladdr;
+  socklen_t hisaddrlen = sizeof (hisctladdr);
+
   set_program_name (argv[0]);
   iu_argp_init ("uucpd", default_program_authors);
   argp_parse (&argp, argc, argv, 0, NULL, NULL);
@@ -128,7 +156,8 @@ main (int argc, char **argv)
   dup2 (STDIN_FILENO, STDERR_FILENO);
 
   hisaddrlen = sizeof (hisctladdr);
-  if (getpeername (STDIN_FILENO, &hisctladdr, &hisaddrlen) < 0)
+  if (getpeername (STDIN_FILENO, (struct sockaddr *) &hisctladdr,
+		   &hisaddrlen) < 0)
     {
       fprintf (stderr, "%s: ", argv[0]);
       perror ("getpeername");
@@ -136,7 +165,7 @@ main (int argc, char **argv)
     }
 
   if (fork () == 0)
-    doit (&hisctladdr);
+    doit ((struct sockaddr *) &hisctladdr, hisaddrlen);
 
   dologout ();
   exit (EXIT_FAILURE);
@@ -149,7 +178,7 @@ readline (register char *p, register int n)
 
   while (n-- > 0)
     {
-      if (read (0, &c, 1) <= 0)
+      if (read (STDIN_FILENO, &c, 1) <= 0)
 	return (-1);
       c &= 0177;
       if (c == '\n' || c == '\r')
@@ -163,7 +192,7 @@ readline (register char *p, register int n)
 }
 
 void
-doit (struct sockaddr_in *sinp)
+doit (struct sockaddr *sap, socklen_t salen)
 {
   struct passwd *pw;
   char user[64], passwd[64];
@@ -177,17 +206,21 @@ doit (struct sockaddr_in *sinp)
       fprintf (stderr, "user read\n");
       return;
     }
-  /* truncate username to 8 characters */
-  user[8] = '\0';
+  user[sizeof (user) - 1] = '\0';
+
   pw = getpwnam (user);
   if (pw == NULL)
     {
-      fprintf (stderr, "user unknown\n");
-      return;
-    }
-  /* XXX: Compare only shell base name to "uucico"?  */
-  if (strcmp (pw->pw_shell, PATH_UUCICO))
-    {
+      /* Simulate continuation, in order not
+       * to disclose user name information.
+       */
+      printf ("Password: ");
+      fflush (stdout);
+      if (readline (passwd, sizeof (passwd)) < 0)
+	{
+	  fprintf (stderr, "passwd read\n");
+	  return;
+	}
       fprintf (stderr, "Login incorrect.");
       return;
     }
@@ -207,14 +240,27 @@ doit (struct sockaddr_in *sinp)
 	  return;
 	}
     }
+
+  /* XXX: Compare only shell base name to "uucico"?
+   * Calling execl(uucico_location) would still use
+   * the only acceptable binary.  */
+  if (strcmp (pw->pw_shell, uucico_location))
+    {
+      fprintf (stderr, "Login incorrect.");
+      return;
+    }
+
   alarm (0);
   sprintf (Username, "USER=%s", user);
-  dologin (pw, sinp);
+  sprintf (Logname, "LOGNAME=%s", user);
+  dologin (pw, sap, salen);
   setgid (pw->pw_gid);
+#ifdef HAVE_INITGROUPS
   initgroups (pw->pw_name, pw->pw_gid);
+#endif
   chdir (pw->pw_dir);
   setuid (pw->pw_uid);
-  execl (pw->pw_shell, "uucico", NULL);
+  execl (uucico_location, "uucico", NULL);
   perror ("uucico server: execl");
 }
 
@@ -266,15 +312,42 @@ dologout (void)
  * Record login in wtmp file.
  */
 void
-dologin (struct passwd *pw, struct sockaddr_in *sin)
+dologin (struct passwd *pw, struct sockaddr *sap, socklen_t salen)
 {
   char line[32];
-  char remotehost[32];
 #if defined PATH_LASTLOG && defined HAVE_STRUCT_LASTLOG
   int f;
 #endif
-  struct hostent *hp = gethostbyaddr ((char *) &sin->sin_addr,
-				      sizeof (struct in_addr), AF_INET);
+#if HAVE_DECL_GETNAMEINFO
+  char remotehost[NI_MAXHOST];
+
+  if (getnameinfo (sap, salen, remotehost, sizeof (remotehost),
+		   NULL, 0, 0))
+    (void) getnameinfo (sap, salen, remotehost, sizeof (remotehost),
+			NULL, 0, NI_NUMERICHOST);
+#else
+  char remotehost[64];
+  struct hostent *hp;
+  void *addr;
+  socklen_t addrlen;
+
+  switch (sap->sa_family)
+    {
+#ifdef IPV6
+    case AF_INET6:
+      addr = (void *) &(((struct sockaddr_in6 *) sap)->sin6_addr);
+      addrlen = sizeof (struct in6_addr);
+      break;
+#endif
+    case AF_INET:
+    default:
+      addr = (void *) &(((struct sockaddr_in *) sap)->sin_addr);
+      addrlen = sizeof (struct in_addr);
+      break;
+    }
+
+  (void) salen;		/* Silence warning.  */
+  hp = gethostbyaddr (addr, addrlen, sap->sa_family);
 
   if (hp)
     {
@@ -282,7 +355,12 @@ dologin (struct passwd *pw, struct sockaddr_in *sin)
       endhostent ();
     }
   else
-    strncpy (remotehost, inet_ntoa (sin->sin_addr), sizeof (remotehost));
+    {
+      remotehost[0] = '\0';
+      (void) inet_ntop (sap->sa_family, addr,
+			remotehost, sizeof (remotehost));
+    }
+#endif
 
   sprintf (line, "uucp%.4d", (int) getpid ());
 
@@ -302,7 +380,13 @@ dologin (struct passwd *pw, struct sockaddr_in *sin)
     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;
+    if (strlen (remotehost) < sizeof (ut.ut_host))
+      ut.ut_syslen = strlen (remotehost) + 1;
+    else
+      {
+	ut.ut_host[sizeof (ut.ut_host) - 1] = '\0';
+	ut.ut_syslen = sizeof (ut.ut_host);
+      }
 # endif
     gettimeofday (&now, NULL);
     ut.ut_tv.tv_sec = now.tv_sec;

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


commit 99971d407ceff56f8f6be622d8295f20f7104e41
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Mon Oct 1 13:58:26 2012 +0200

    uucpd: Restore inetd code.

diff --git a/ChangeLog b/ChangeLog
index 21836c8..8ba9f02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2012-10-01  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	uucpd: Restore inetd code.
+
+	Code necessary for inetd mode was accidentally
+	removed on 2009-10-26.  Replace daemon mode code.
+	* src/uucpd.c: Include <grp.h>.
+	(hisaddrlen): Type is socklen_t.
+	(myctladdr): Removed.
+	(main): Remove variables S and SP.  Remove broken,
+	partial code for daemon mode operation.  New calls
+	to dup2(), getpeername(), doit(), and dologout().
+	(doit): New calls to initgroups() and execl().
+
 2012-09-28  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	rlogind: Daemon mode update.
diff --git a/src/uucpd.c b/src/uucpd.c
index 70b38cd..bee2803 100644
--- a/src/uucpd.c
+++ b/src/uucpd.c
@@ -51,7 +51,7 @@
    Adams. */
 
 /*
- * 4.2BSD TCP/IP server for uucico
+ * TCP/IP server for uucico.
  * uucico's TCP channel causes this server to be run at the remote end.
  */
 
@@ -68,6 +68,7 @@
 #include <sys/time.h>
 #include <time.h>
 #include <pwd.h>
+#include <grp.h>
 #include <unistd.h>
 #include <errno.h>
 #include <stdio.h>
@@ -89,10 +90,12 @@
 #include <libinetutils.h>
 
 void dologin (struct passwd *pw, struct sockaddr_in *sin);
+void dologout (void);
+void doit (struct sockaddr_in *sinp);
 
 struct sockaddr_in hisctladdr;
-int hisaddrlen = sizeof hisctladdr;
-struct sockaddr_in myctladdr;
+socklen_t hisaddrlen = sizeof (hisctladdr);
+
 int mypid;
 
 char Username[64];
@@ -100,44 +103,43 @@ char *nenv[] = {
   Username,
   NULL,
 };
+
 extern char **environ;
 
 static struct argp argp =
   {
     NULL, NULL, NULL,
-    "TCP/IP server for uucico",
+    "TCP/IP server for uucico.",
     NULL, NULL, NULL
   };
 
 int
 main (int argc, char **argv)
 {
-  register int s;
-  struct servent *sp;
-  void dologout (void);
-
   set_program_name (argv[0]);
   iu_argp_init ("uucpd", default_program_authors);
   argp_parse (&argp, argc, argv, 0, NULL, NULL);
 
+  /* Minimal environment, containing only USER.  */
   environ = nenv;
-  sp = getservbyname ("uucp", "tcp");
-  if (sp == NULL)
-    {
-      perror ("uucpd: getservbyname");
-      exit (EXIT_FAILURE);
-    }
-  if (fork ())
-    exit (EXIT_SUCCESS);
-  if ((s = open (PATH_TTY, O_RDWR)) >= 0)
+
+  /* Circumvent all descriptor trickery.  */
+  dup2 (STDIN_FILENO, STDOUT_FILENO);
+  dup2 (STDIN_FILENO, STDERR_FILENO);
+
+  hisaddrlen = sizeof (hisctladdr);
+  if (getpeername (STDIN_FILENO, &hisctladdr, &hisaddrlen) < 0)
     {
-      ioctl (s, TIOCNOTTY, (char *) 0);
-      close (s);
+      fprintf (stderr, "%s: ", argv[0]);
+      perror ("getpeername");
+      _exit (EXIT_FAILURE);
     }
 
-  memset (&myctladdr, 0, sizeof (myctladdr));
-  myctladdr.sin_family = AF_INET;
-  myctladdr.sin_port = sp->s_port;
+  if (fork () == 0)
+    doit (&hisctladdr);
+
+  dologout ();
+  exit (EXIT_FAILURE);
 }
 
 static int
@@ -163,14 +165,14 @@ readline (register char *p, register int n)
 void
 doit (struct sockaddr_in *sinp)
 {
-  struct passwd *pw, *getpwnam (const char *);
+  struct passwd *pw;
   char user[64], passwd[64];
   char *xpasswd;
 
   alarm (60);
   printf ("login: ");
   fflush (stdout);
-  if (readline (user, sizeof user) < 0)
+  if (readline (user, sizeof (user)) < 0)
     {
       fprintf (stderr, "user read\n");
       return;
@@ -183,6 +185,7 @@ doit (struct sockaddr_in *sinp)
       fprintf (stderr, "user unknown\n");
       return;
     }
+  /* XXX: Compare only shell base name to "uucico"?  */
   if (strcmp (pw->pw_shell, PATH_UUCICO))
     {
       fprintf (stderr, "Login incorrect.");
@@ -192,7 +195,7 @@ doit (struct sockaddr_in *sinp)
     {
       printf ("Password: ");
       fflush (stdout);
-      if (readline (passwd, sizeof passwd) < 0)
+      if (readline (passwd, sizeof (passwd)) < 0)
 	{
 	  fprintf (stderr, "passwd read\n");
 	  return;
@@ -208,8 +211,10 @@ doit (struct sockaddr_in *sinp)
   sprintf (Username, "USER=%s", user);
   dologin (pw, sinp);
   setgid (pw->pw_gid);
+  initgroups (pw->pw_name, pw->pw_gid);
   chdir (pw->pw_dir);
   setuid (pw->pw_uid);
+  execl (pw->pw_shell, "uucico", NULL);
   perror ("uucico server: execl");
 }
 
@@ -320,7 +325,7 @@ dologin (struct passwd *pw, struct sockaddr_in *sin)
       strcpy (line, remotehost);
       SCPYN (ll.ll_line, line);
       SCPYN (ll.ll_host, remotehost);
-      write (f, (char *) &ll, sizeof ll);
+      write (f, (char *) &ll, sizeof (ll));
       close (f);
     }
 #endif

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

Summary of changes:
 ChangeLog                |   54 ++++++++++++++
 ftpd/popen.c             |    2 +-
 libinetutils/daemon.c    |    4 +-
 libinetutils/logwtmp.c   |    8 ++-
 libinetutils/logwtmpko.c |    8 ++-
 libinetutils/ttymsg.c    |    8 +-
 libinetutils/utmp_init.c |    8 ++-
 src/inetd.c              |   16 ++--
 src/rshd.c               |    2 +-
 src/syslogd.c            |    2 +-
 src/uucpd.c              |  177 ++++++++++++++++++++++++++++++++++-----------
 telnet/commands.c        |    2 +-
 12 files changed, 226 insertions(+), 65 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Oct 04 16:26:07 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TJrzj-0007ND-IF
	for mharc-commit-inetutils@gnu.org; Thu, 04 Oct 2012 16:26:07 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47459)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TJrzg-0007Kn-Go
	for commit-inetutils@gnu.org; Thu, 04 Oct 2012 16:26:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TJrze-0008Pb-Hd
	for commit-inetutils@gnu.org; Thu, 04 Oct 2012 16:26:04 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:36619)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TJrze-0008PT-Ee
	for commit-inetutils@gnu.org; Thu, 04 Oct 2012 16:26:02 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TJrzd-0000jw-RM
	for commit-inetutils@gnu.org; Thu, 04 Oct 2012 20:26:02 +0000
Date: Thu, 04 Oct 2012 20:26:01 +0000
Message-Id: <E1TJrzd-0000jw-RM@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-182-gd3771eb
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 066ab951480bcdf9599da7e8a1f2822b116fa5ef
X-Git-Newrev: d3771eb02dee934f0f38abb944a8b53a5233999a
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, 04 Oct 2012 20:26:05 -0000

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

The branch, master has been updated
       via  d3771eb02dee934f0f38abb944a8b53a5233999a (commit)
      from  066ab951480bcdf9599da7e8a1f2822b116fa5ef (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=d3771eb02dee934f0f38abb944a8b53a5233999a


commit d3771eb02dee934f0f38abb944a8b53a5233999a
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Oct 4 22:24:15 2012 +0200

    ping, traceroute: IDN for glibc.

diff --git a/ChangeLog b/ChangeLog
index a6cc7af..dd37c65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-10-04  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* ping/libping.c (ping_set_dest) [HAVE_DECL_GETADDRINFO]:
+	Alternative and preferred resolver using getaddrinfo().
+	* ping/ping6.c (print_echo) [NI_IDN]: Add flag NI_IDN
+	to getnameinfo() if option OPT_NUMERIC is not set.
+	(ping_set_dest) [AI_IDN]: Add flag AI_IDN to HINTS.
+	* ping/ping_common.c (ipaddr2str) [NI_IDN]: Add flag
+	NI_IDN to getnameinfo().
+	* src/traceroute.c (main) [AI_IDN]: Add flag AI_IDN to HINTS.
+	[AI_IDN && AI_CANONIDN]: Add flag AI_CANONIDN to HINTS.
+
 2012-10-02  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* libinetutils/logwtmp.c [HAVE_STRUCT_UTMPX_UT_SYSLEN]:
diff --git a/ping/libping.c b/ping/libping.c
index ac99b9d..d269150 100644
--- a/ping/libping.c
+++ b/ping/libping.c
@@ -267,17 +267,55 @@ ping_set_packetsize (PING * ping, size_t size)
 int
 ping_set_dest (PING * ping, char *host)
 {
+#if HAVE_DECL_GETADDRINFO
+  int rc;
+  struct addrinfo hints, *res;
+  char *p;
+
+# ifdef HAVE_IDN
+  rc = idna_to_ascii_lz (host, &p, 0);	/* P is allocated.  */
+  if (rc)
+    return 1;
+# else /* !HAVE_IDN */
+  p = host;
+# endif
+
+  memset (&hints, 0, sizeof (hints));
+  hints.ai_family = AF_INET;
+  hints.ai_flags = AI_CANONNAME;
+# ifdef AI_IDN
+  hints.ai_flags |= AI_IDN;
+#  ifdef AI_CANONIDN
+  hints.ai_flags |= AI_CANONIDN;
+#  endif
+# endif
+
+  rc = getaddrinfo (p, NULL, &hints, &res);
+# ifdef HAVE_IDN
+  free (p);
+# endif
+
+  if (rc)
+    return 1;
+
+  memcpy (&ping->ping_dest.ping_sockaddr, res->ai_addr, res->ai_addrlen);
+  ping->ping_hostname = strdup (res->ai_canonname);
+  freeaddrinfo (res);
+
+  return 0;
+#else /* !HAVE_DECL_GETADDRINFO */
+
   struct sockaddr_in *s_in = &ping->ping_dest.ping_sockaddr;
   s_in->sin_family = AF_INET;
-#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+# ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
   s_in->sin_len = sizeof (*s_in);
-#endif
+# endif
   if (inet_aton (host, &s_in->sin_addr))
     ping->ping_hostname = strdup (host);
   else
     {
       struct hostent *hp;
-#ifdef HAVE_IDN
+# ifdef HAVE_IDN
       char *p;
       int rc;
 
@@ -286,9 +324,9 @@ ping_set_dest (PING * ping, char *host)
 	return 1;
       hp = gethostbyname (p);
       free (p);
-#else /* !HAVE_IDN */
+# else /* !HAVE_IDN */
       hp = gethostbyname (host);
-#endif
+# endif
       if (!hp)
 	return 1;
 
@@ -300,4 +338,5 @@ ping_set_dest (PING * ping, char *host)
       ping->ping_hostname = strdup (hp->h_name);
     }
   return 0;
+#endif /* !HAVE_DECL_GETADDRINFO */
 }
diff --git a/ping/ping6.c b/ping/ping6.c
index 5364a99..2035ec2 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -531,7 +531,13 @@ print_echo (int dupflag, int hops, struct ping_stat *ping_stat,
 
   err = getnameinfo ((struct sockaddr *) from, sizeof (*from),
 		     buf, sizeof (buf), NULL, 0,
-		     (options & OPT_NUMERIC) ? NI_NUMERICHOST : 0);
+		     (options & OPT_NUMERIC) ? NI_NUMERICHOST
+#ifdef NI_IDN
+		     : NI_IDN
+#else
+		     : 0
+#endif
+		     );
   if (err)
     {
       const char *errmsg;
@@ -902,6 +908,9 @@ ping_set_dest (PING * ping, char *host)
 
   memset (&hints, 0, sizeof (hints));
   hints.ai_family = AF_INET6;
+#ifdef AI_IDN
+  hints.ai_flags = AI_IDN;
+#endif
 
   err = getaddrinfo (rhost, NULL, &hints, &result);
 #if HAVE_IDN
diff --git a/ping/ping_common.c b/ping/ping_common.c
index 59afb86..623fd9c 100644
--- a/ping/ping_common.c
+++ b/ping/ping_common.c
@@ -281,7 +281,13 @@ ipaddr2str (struct sockaddr *from, socklen_t fromlen)
     return xstrdup (ipstr);
 
   err = getnameinfo (from, fromlen, hoststr, sizeof (hoststr),
-		     NULL, 0, NI_NAMEREQD);
+		     NULL, 0,
+#ifdef NI_IDN
+		     NI_IDN | NI_NAMEREQD
+#else
+		     NI_NAMEREQD
+#endif
+		     );
   if (err)
     return xstrdup (ipstr);
 
diff --git a/src/traceroute.c b/src/traceroute.c
index 0a3ad38..8819336 100644
--- a/src/traceroute.c
+++ b/src/traceroute.c
@@ -227,6 +227,12 @@ main (int argc, char **argv)
   memset (&hints, 0, sizeof (hints));
   hints.ai_family = AF_INET;
   hints.ai_flags = AI_CANONNAME;
+#ifdef AI_IDN
+  hints.ai_flags |= AI_IDN;
+# ifdef AI_CANONIDN
+  hints.ai_flags |= AI_CANONIDN;
+# endif
+#endif
 
 #ifdef HAVE_IDN
   rc = idna_to_ascii_lz (hostname, &rhost, 0);

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

Summary of changes:
 ChangeLog          |   12 ++++++++++++
 ping/libping.c     |   49 ++++++++++++++++++++++++++++++++++++++++++++-----
 ping/ping6.c       |   11 ++++++++++-
 ping/ping_common.c |    8 +++++++-
 src/traceroute.c   |    6 ++++++
 5 files changed, 79 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Oct 05 18:49:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TKGiI-0008TB-KE
	for mharc-commit-inetutils@gnu.org; Fri, 05 Oct 2012 18:49:46 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39443)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TKGiG-0008RI-Ub
	for commit-inetutils@gnu.org; Fri, 05 Oct 2012 18:49:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TKGiD-0004PH-PB
	for commit-inetutils@gnu.org; Fri, 05 Oct 2012 18:49:44 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:51480)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TKGiD-0004OX-Lv
	for commit-inetutils@gnu.org; Fri, 05 Oct 2012 18:49:41 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TKGiD-0004mT-3n
	for commit-inetutils@gnu.org; Fri, 05 Oct 2012 22:49:41 +0000
Date: Fri, 05 Oct 2012 22:49:41 +0000
Message-Id: <E1TKGiD-0004mT-3n@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-183-g88ff7a4
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: d3771eb02dee934f0f38abb944a8b53a5233999a
X-Git-Newrev: 88ff7a44098fd6e26ddaa4fc7a61e5ed6f6e1678
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, 05 Oct 2012 22:49: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  88ff7a44098fd6e26ddaa4fc7a61e5ed6f6e1678 (commit)
      from  d3771eb02dee934f0f38abb944a8b53a5233999a (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=88ff7a44098fd6e26ddaa4fc7a61e5ed6f6e1678


commit 88ff7a44098fd6e26ddaa4fc7a61e5ed6f6e1678
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Oct 5 23:54:25 2012 +0200

    telnet: Signal action portability.

diff --git a/ChangeLog b/ChangeLog
index dd37c65..de25dc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-10-05  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	telnet: Reliability fix caused by OpenSolaris,
+	where SIGWINCH regularly got lost.
+
+	* telnet/sys_bsd.c (sys_telnet_init): New variable SA.
+	[SIGWINCH]: Install handler with sigaction().
+	[SIGTSTP]: Likewise.
+	[SIGINFO]: Likewise.
+
 2012-10-04  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* ping/libping.c (ping_set_dest) [HAVE_DECL_GETADDRINFO]:
diff --git a/telnet/sys_bsd.c b/telnet/sys_bsd.c
index e133cce..eb610d1 100644
--- a/telnet/sys_bsd.c
+++ b/telnet/sys_bsd.c
@@ -1013,17 +1013,25 @@ ayt (int sig)
 void
 sys_telnet_init (void)
 {
+  struct sigaction sa;
+
+  sa.sa_flags = SA_RESTART;
+  sigemptyset (&sa.sa_mask);
+
   signal (SIGINT, intr);
   signal (SIGQUIT, intr2);
   signal (SIGPIPE, deadpeer);
 #ifdef	SIGWINCH
-  signal (SIGWINCH, sendwin);
+  sa.sa_handler = sendwin;
+  (void) sigaction (SIGWINCH, &sa, NULL);
 #endif
 #ifdef	SIGTSTP
-  signal (SIGTSTP, susp);
+  sa.sa_handler = susp;
+  (void) sigaction (SIGTSTP, &sa, NULL);
 #endif
 #ifdef	SIGINFO
-  signal (SIGINFO, ayt);
+  sa.sa_handler = ayt;
+  (void) sigaction (SIGINFO, &sa, NULL);
 #endif
 
   setconnmode (0);

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

Summary of changes:
 ChangeLog        |   10 ++++++++++
 telnet/sys_bsd.c |   14 +++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Tue Oct 09 16:21:52 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TLgJM-0003iQ-NW
	for mharc-commit-inetutils@gnu.org; Tue, 09 Oct 2012 16:21:52 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35680)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TLgJJ-0003hb-WC
	for commit-inetutils@gnu.org; Tue, 09 Oct 2012 16:21:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TLgJI-0001NV-1n
	for commit-inetutils@gnu.org; Tue, 09 Oct 2012 16:21:49 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:56718)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TLgJH-0001NR-Tz
	for commit-inetutils@gnu.org; Tue, 09 Oct 2012 16:21:47 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TLgJH-0003CN-3F
	for commit-inetutils@gnu.org; Tue, 09 Oct 2012 20:21:47 +0000
Date: Tue, 09 Oct 2012 20:21:47 +0000
Message-Id: <E1TLgJH-0003CN-3F@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-184-gc235508
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 88ff7a44098fd6e26ddaa4fc7a61e5ed6f6e1678
X-Git-Newrev: c235508d8df9371a1da1bfa1e147d0cfd5a8ced4
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, 09 Oct 2012 20:21:51 -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  c235508d8df9371a1da1bfa1e147d0cfd5a8ced4 (commit)
      from  88ff7a44098fd6e26ddaa4fc7a61e5ed6f6e1678 (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=c235508d8df9371a1da1bfa1e147d0cfd5a8ced4


commit c235508d8df9371a1da1bfa1e147d0cfd5a8ced4
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Mon Oct 8 19:06:59 2012 +0200

    rlogind: Support libwrap in daemon mode.

diff --git a/ChangeLog b/ChangeLog
index de25dc7..c2474df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2012-10-08  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	rlogind: Support libwrap in daemon mode.
+
+	* configure.ac <rlogind summary>: Print $LIBWRAP.
+	* src/Makefile.am (rlogind_LDADD): Add $(LIBWRAP).
+	* src/rlogind.c [HAVE_TCPD_H]: Include <tcpd.h>.
+	[WITH_WRAP && !HAVE_DECL_HOSTS_CTL]: New prototype
+	for missing hosts_ctl() declaration.
+	(allow_severity, deny_severity) [WITH_WRAP]:
+	New variables.
+	(check_host) [WITH_WRAP]: New function.
+	(rlogin_daemon) [WITH_WRAP]: Call check_host().
+	(protocol) [!SHISHI]: Trivial use of AP.
+
+	* ftpd/server_mode.c (check_host): Use severity
+	`deny_severity' to syslog() at rejects.
+
 2012-10-05  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	telnet: Reliability fix caused by OpenSolaris,
diff --git a/configure.ac b/configure.ac
index e348aff..11f23d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1047,7 +1047,7 @@ ${ftpd_BUILD:+${FTPD_LIBPAM:+PAM }$LIBWRAP}
     rexecd         ${enable_rexecd}  \
 ${rexecd_BUILD:+${LIBPAM:+PAM}}
     rlogind        ${enable_rlogind}  \
-${rlogind_BUILD:+$KERBEROS_VERSION}
+${rlogind_BUILD:+${KERBEROS_VERSION:+$KERBEROS_VERSION }$LIBWRAP}
     rshd           ${enable_rshd}  \
 ${rshd_BUILD:+${KERBEROS_VERSION:+$KERBEROS_VERSION }${LIBPAM:+PAM}}
     syslogd        ${enable_syslogd}
diff --git a/ftpd/server_mode.c b/ftpd/server_mode.c
index 113ee79..6b304d7 100644
--- a/ftpd/server_mode.c
+++ b/ftpd/server_mode.c
@@ -78,7 +78,7 @@ check_host (struct sockaddr *sa, socklen_t len)
     {
       if (!hosts_ctl ("ftpd", name, addr, STRING_UNKNOWN))
 	{
-	  syslog (LOG_NOTICE, "tcpwrappers rejected: %s [%s]",
+	  syslog (deny_severity, "tcpwrappers rejected: %s [%s]",
 		  name, addr);
 	  return 0;
 	}
@@ -87,7 +87,7 @@ check_host (struct sockaddr *sa, socklen_t len)
     {
       if (!hosts_ctl ("ftpd", STRING_UNKNOWN, addr, STRING_UNKNOWN))
 	{
-	  syslog (LOG_NOTICE, "tcpwrappers rejected: [%s]", addr);
+	  syslog (deny_severity, "tcpwrappers rejected: [%s]", addr);
 	  return 0;
 	}
     }
diff --git a/src/Makefile.am b/src/Makefile.am
index 1f7bf13..05e3aa1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -79,7 +79,7 @@ EXTRA_PROGRAMS += rexecd
 
 inetdaemon_PROGRAMS += $(rlogind_BUILD)
 rlogind_SOURCES = rlogind.c
-rlogind_LDADD = $(LDADD) $(LIBAUTH)
+rlogind_LDADD = $(LDADD) $(LIBAUTH) $(LIBWRAP)
 EXTRA_PROGRAMS += rlogind
 
 inetdaemon_PROGRAMS += $(rshd_BUILD)
diff --git a/src/rlogind.c b/src/rlogind.c
index 9e16cfc..9663be6 100644
--- a/src/rlogind.c
+++ b/src/rlogind.c
@@ -67,6 +67,10 @@
 
 #include <pty.h>
 
+#ifdef HAVE_TCPD_H
+# include <tcpd.h>
+#endif
+
 #include <progname.h>
 #include <argp.h>
 #include <libinetutils.h>
@@ -161,9 +165,9 @@ struct auth_data
   krb5_ccache ccache;
   krb5_keytab keytab;
 #  endif
-# endif
+# endif /* KERBEROS */
 };
-#endif
+#endif /* !SHISHI */
 
 #define MODE_INETD 0
 #define MODE_DAEMON 1
@@ -197,6 +201,15 @@ int local_dot_count;
 
 struct winsize win = { 0, 0, 0, 0 };
 
+#ifdef WITH_WRAP
+int allow_severity = LOG_INFO;
+int deny_severity = LOG_NOTICE;
+
+# if !HAVE_DECL_HOSTS_CTL
+extern int hosts_ctl (char *, char *, char *, char *);
+# endif
+#endif /* WITH_WRAP */
+
 #if defined __GLIBC__ && defined WITH_IRUSEROK
 extern int iruserok (uint32_t raddr, int superuser,
                      const char *ruser, const char *luser);
@@ -232,6 +245,76 @@ rlogind_sigchld (int signo _GL_UNUSED_PARAMETER)
     --numchildren;
 }
 
+#ifdef WITH_WRAP
+static int
+check_host (struct sockaddr *sa, socklen_t len)
+{
+  int rc;
+  char addr[INET6_ADDRSTRLEN];
+# if HAVE_DECL_GETNAMEINFO
+  char name[NI_MAXHOST];
+# else
+  struct hostent *hp;
+  void *addrp;
+  char *name;
+# endif /* !HAVE_DECL_NAMEINFO */
+
+  if (sa->sa_family != AF_INET
+# ifdef IPV6
+      && sa->sa_family != AF_INET6)
+# endif
+    return 1;
+
+# if HAVE_DECL_GETNAMEINFO
+  (void) getnameinfo(sa, len, addr, sizeof (addr), NULL, 0, NI_NUMERICHOST);
+  rc = getnameinfo(sa, len, name, sizeof (name), NULL, 0, NI_NAMEREQD);
+# else /* !HAVE_DECL_GETNAMEINFO */
+
+  (void) len;		/* Silence warning.  */
+
+  switch (sa->sa_family)
+    {
+#  ifdef IPV6
+    case AF_INET6:
+      addrp = (void *) &((struct sockaddr_in6 *) sa)->sin6_addr;
+      hp = gethostbyaddr (addrp, sizeof (struct in6_addr),
+			  sa->sa_family);
+      break;
+#  endif
+    case AF_INET:
+    default:
+      addrp = (void *) &((struct sockaddr_in *) sa)->sin_addr;
+      hp = gethostbyaddr (addrp, sizeof (struct in_addr),
+			  sa->sa_family);
+    }
+
+  (void) inet_ntop (sa->sa_family, addrp, addr, sizeof (addr));
+  if (hp)
+    name = hp->h_name;
+  rc = (hp == NULL);		/* Translate to getnameinfo style.  */
+# endif /* !HAVE_DECL_GETNAMEINFO */
+
+  if (!rc)
+    {
+      if (!hosts_ctl ("rlogind", name, addr, STRING_UNKNOWN))
+	{
+	  syslog (deny_severity, "tcpd rejects %s [%s]",
+		  name, addr);
+	  return 0;
+	}
+    }
+  else
+    {
+      if (!hosts_ctl ("rlogind", STRING_UNKNOWN, addr, STRING_UNKNOWN))
+	{
+	  syslog (deny_severity, "tcpd rejects [%s]", addr);
+	  return 0;
+	}
+    }
+  return 1;
+}
+#endif /* WITH_WRAP */
+
 #if defined KERBEROS && defined ENCRYPTION
 # define ENCRYPT_IO encrypt_io
 # define IF_ENCRYPT(stmt) if (encrypt_io) stmt
@@ -665,6 +748,10 @@ rlogin_daemon (int maxchildren, int port)
 	      close (listenfd[0]);
 	      if (numfd > 1)
 		close (listenfd[1]);
+#ifdef WITH_WRAP
+	      if (!check_host ((struct sockaddr *) &saddr, size))
+		exit (EXIT_FAILURE);
+#endif
 	      exit (rlogind_mainloop (fd, fd));
 	    }
 	  /* parent only */
@@ -1576,6 +1663,9 @@ protocol (int f, int p, struct auth_data *ap)
   int cc, nfd, n;
   char cntl;
 
+#ifndef SHISHI
+  (void) ap;		/* Silence warning.  */
+#endif
   /*
    * Must ignore SIGTTOU, otherwise we'll stop
    * when we try and set slave pty's window shape

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

Summary of changes:
 ChangeLog          |   18 ++++++++++
 configure.ac       |    2 +-
 ftpd/server_mode.c |    4 +-
 src/Makefile.am    |    2 +-
 src/rlogind.c      |   94 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 114 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Tue Oct 09 20:53:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TLkYR-00065f-VN
	for mharc-commit-inetutils@gnu.org; Tue, 09 Oct 2012 20:53:43 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54866)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TLkYM-00064q-7r
	for commit-inetutils@gnu.org; Tue, 09 Oct 2012 20:53:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TLkYI-0003vN-6b
	for commit-inetutils@gnu.org; Tue, 09 Oct 2012 20:53:38 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:54659)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TLkYI-0003vB-2r
	for commit-inetutils@gnu.org; Tue, 09 Oct 2012 20:53:34 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TLkYH-0003xs-ET
	for commit-inetutils@gnu.org; Wed, 10 Oct 2012 00:53:33 +0000
Date: Wed, 10 Oct 2012 00:53:33 +0000
Message-Id: <E1TLkYH-0003xs-ET@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-185-ge4ac90a
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: c235508d8df9371a1da1bfa1e147d0cfd5a8ced4
X-Git-Newrev: e4ac90ae657b406b66ba25e68198b96764c322dc
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, 10 Oct 2012 00:53:42 -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  e4ac90ae657b406b66ba25e68198b96764c322dc (commit)
      from  c235508d8df9371a1da1bfa1e147d0cfd5a8ced4 (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=e4ac90ae657b406b66ba25e68198b96764c322dc


commit e4ac90ae657b406b66ba25e68198b96764c322dc
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Oct 10 02:50:18 2012 +0200

    Documentation (silent change)

diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index 942178a..7edf426 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -171,6 +171,7 @@ many more.
 
 @node Common options
 @chapter Common options
+@cindex common options
 
 Certain options are available in all these programs.  Rather than
 writing identical descriptions for each of the programs, they are
@@ -335,16 +336,12 @@ Both options are most influencial when the target host is named using
 a symbolic name, but numerical addresses for host or source must also
 match if either of @option{--ipv4} or @option{--ipv6} is stated.
 
-@item -i[@var{pid}]
-@itemx --id=[@var{pid}]
-@opindex -i
-@opindex --id
-Add process ID to each message.  If @var{pid} is not supplied, use the
-process ID of the logger process with each line.  Notice, that
-@var{pid} is an optional argument.  When supplied to the @option{-i}
-option, it must follow the @samp{i} letter immediately, without any
-separating whitespace.  When supplied to the @option{--id} form, it
-must be separated from it by exactly one equals sign.
+@item -f @var{file}
+@itemx --file=@var{file}
+@opindex -f
+@opindex --file
+Log the content of the specified file.  If @var{file} is @samp{-} then
+standard input is assumed.
 
 @item -h @var{host}
 @itemx --host=@var{host}
@@ -366,35 +363,16 @@ the port number corresponding to the @samp{syslog} service is used.
 If a numerical IPv6 address is given without a port specification,
 then the address must be enclosed within brackets (like [::1]).
 
-@item -u @var{socket}
-@itemx --unix=@var{socket}
-@opindex -h
-@opindex --host
-Send messages to the given local UNIX socket.  The @var{socket} argument
-can be either an absolute path (starting with a slash @samp{/}), or a relative
-path understood relative to the current working directory.
-
-@item -S @var{addr}
-@itemx --source=@var{addr}
-@opindex -S
-@opindex --source
-Supply the source IP address for INET connections.  This option is
-useful in conjunction with @option{--host} (see above).  The kind of
-address specified here (IPv4 or IPv6) will propagate to influence
-the resolution of the host address, if it is a symbolic name.
-
-@item -s
-@itemx --stderr
-@opindex -s
-@opindex --stderr
-Log the message to standard error, as well as the system log.
-
-@item -f @var{file}
-@itemx --file=@var{file}
-@opindex -f
-@opindex --file
-Log the content of the specified file.  If @var{file} is @samp{-} the
-standard input is assumed.
+@item -i[@var{pid}]
+@itemx --id=[@var{pid}]
+@opindex -i
+@opindex --id
+Add process ID to each message.  If @var{pid} is not supplied, use the
+process ID of the logger process with each line.  Notice, that
+@var{pid} is an optional argument.  When supplied to the @option{-i}
+option, it must follow the @samp{i} letter immediately, without any
+separating whitespace.  When supplied to the @option{--id} form, it
+must be separated from it by exactly one equals sign.
 
 @item -p @var{priority}
 @itemx --priority=@var{priority}
@@ -408,11 +386,34 @@ level in the @samp{local3} facility.  The default is
 
 The actual list of supported facilities and levels is system specific.
 
+@item -s
+@itemx --stderr
+@opindex -s
+@opindex --stderr
+Log the message to standard error, as well as to the system log.
+
+@item -S @var{addr}
+@itemx --source=@var{addr}
+@opindex -S
+@opindex --source
+Supply the source IP address for INET connections.  This option is
+useful in conjunction with @option{--host} (see above).  The kind of
+address specified here (IPv4 or IPv6) will propagate to influence
+the resolution of the host address, if it is a symbolic name.
+
 @item -t @var{tag}
 @itemx --tag=@var{tag}
 @opindex -t
 @opindex --tag
 Mark every line in the log with the specified tag.
+
+@item -u @var{socket}
+@itemx --unix=@var{socket}
+@opindex -h
+@opindex --host
+Send messages to the given local UNIX socket.  The @var{socket} argument
+can be either an absolute path (starting with a slash @samp{/}), or a relative
+path understood relative to the current working directory.
 @end table
 
 The options are followed by the message which should be written to the
@@ -461,7 +462,7 @@ warnings
 datagram to elicit an ICMP @code{ECHO_RESPONSE} from a host or
 gateway.  @code{ECHO_REQUEST} datagrams (@dfn{pings}) have an IP and
 ICMP header, followed by a @dfn{struct timeval} and then an arbitrary
-number of @dfn{pad} bytes used to fill out the packet.  Synopsis:
+number of @dfn{pad} bytes used to fill out the packet.
 
 @example
 ping [@var{option}@dots{}] @var{host}@dots{}
@@ -473,6 +474,11 @@ ping [@var{option}@dots{}] @var{host}@dots{}
 @c       --mask                 Same as --address
 @c       --timestamp            Send ICMP_TIMESTAMP packets
 @c   -t, --type=TYPE            Send TYPE packets
+
+Sending echo requests is the standard use of @command{ping},
+but not the only use case.  Selection of packet type is handled
+with these few options:
+
 @table @option
 @item --address
 @opindex --address
@@ -515,6 +521,8 @@ Send @var{type} packets.  Accepted values are @samp{address},
 @c   -T, --tos=NUM              Set type-of-service to NUM
 @c       --ttl=NUMBER           Set specified time-to-live on packet
 
+The following options are available for all packet types:
+
 @table @option
 @item -c @var{n}
 @itemx --count=@var{n}
@@ -563,17 +571,41 @@ Set type-of-service, TOS, to NUM on transmitted packets.
 @opindex --ttl
 Set the specified number @var{n} as value of time-to-live when
 transmitting packets.  Acceptable values are 1 to 255, inclusive.
+
+@item -v
+@itemx --verbose
+@opindex -v
+@opindex --verbose
+Produce more verbose output, giving more statistics.
+
+@item -w @var{n}
+@itemx --timeout=@var{n}
+@opindex -w
+@opindex --timeout
+Stop after @var{n} seconds.
+
+@item -W @var{n}
+@itemx --linger=@var{n}
+@opindex -W
+@opindex --linger
+Maximum number of seconds @var{n} to wait for a response.
 @end table
 
 @c Options valid for --echo requests:
 @c   -f, --flood                Flood ping (root only)
 @c       --ip-timestamp=FLAG    Timestamp IP option of types tsonly,
-@                               tsaddr, or (not yet implemented) prespec.
+@c                              tsaddr, or (not yet implemented) prespec.
 @c   -l, --preload=NUMBER       Send NUMBER packets as fast as possible before
 @c                              falling into normal mode of behavior (root only)
 @c   -p, --pattern=PATTERN      Fill ICMP packet with given pattern (hex)
+@c   -q, --quiet                no packet message
 @c   -R, --route                Record route IP option
 @c   -s, --size=NUMBER          Send NUMBER data octets
+
+Finally, these last options are relevant only for sending echo requests,
+allowing many variations in order to detect various peculiarities of
+the targeted host, or the intermediary routers for that matter.
+
 @table @option
 @item -f
 @itemx --flood
@@ -609,6 +641,11 @@ This is useful for diagnosing data-dependent problems in a network.
 For example, @option{-p ff} will cause the sent packet to be filled
 with all ones.
 
+@item -q
+@itemx --quiet
+@opindex -q
+@opindex --quiet
+Do not print timing for each transmitted packet.
 @item -R
 @itemx --route
 @opindex -R
@@ -625,18 +662,6 @@ Many hosts ignore or discard this option.
 Specifies the number of data bytes to be sent.  The default is 56,
 which translates into 64 ICMP data bytes when combined with the 8
 bytes of ICMP header data.
-
-@item -w @var{n}
-@itemx --timeout=@var{n}
-@opindex -w
-@opindex --timeout
-Stop after @var{n} seconds.
-
-@item -W @var{n}
-@itemx --linger=@var{n}
-@opindex -W
-@opindex --linger
-Maximum number of seconds @var{n} to wait for a response.
 @end table
 
 @section Using ping for network fault isolation
@@ -755,7 +780,7 @@ conditions.
 
 @node traceroute invocation
 @chapter @command{traceroute}: Trace the route to a host
-@pindex traceroute
+@cindex traceroute
 
 @command{traceroute} traces the route packets take to a host.
 Synopsis:
@@ -797,6 +822,7 @@ Set type-of-service, TOS, to NUM on transmitted packets.
 
 @node whois invocation
 @chapter @command{whois}: Whois user interface
+@cindex whois
 
 Synopsis:
 
@@ -1689,26 +1715,31 @@ and therefore difficult to document here.
 @chapter @command{rsh}: Remote shell
 @cindex rsh
 
-@command{rsh} executes command on host and copies its standard input
-to the remote command, the standard output of the remote command to
-its standard output, and the standard error of the remote command to
-its standard error.  Interrupt, quit and terminate signals are
-propagated to the remote command; @command{rsh} normally terminates
-when the remote command does.
+@command{rsh} executes commands on a remote host and copies its local
+standard input to that of the remote command, as well as the remote
+standard output to the local standard output, and the remote standard
+error to the local standard error.  Locally raised interrupt, quit and
+terminate signals are all propagated to the remote command. Normally
+@command{rsh} terminates when the remote command does so.
 
-When using the @command{rsh} command, you can create a link to your
-path using a host name as the link name.  For example:
+When using the @command{rsh} command, you can for convenience create
+a link in your path, using a host name as name of the link.  For example:
 
 @example
 # ln -s /usr/bin/rsh @var{hostname}
 # @var{hostname} ls
 @end example
 
-@var{hostname} will be passed to @command{rsh} as the default host.
+@noindent
+Afterwards, @var{hostname} will be passed to @command{rsh} as host name
+whenever the command @var{hostname} is issued.
 
 @command{rsh} allows access to the remote host without the use of a
-passwd.  For details, @xref{rcmd, , rcmd, libc, The GNU C Library
-Reference Manual}.
+password.  The prerequisite is a suitable specification in @file{~/.rhosts}.
+For details, @xref{rcmd, , rcmd, libc, The GNU C Library Reference Manual}.
+
+If no command is specified for @command{rsh} ar argument following the
+host name, then you will be logged in on the remote host using @command{rlogin}.
 
 @section Invoking
 
@@ -1733,19 +1764,6 @@ Use only IPv6.
 @opindex --debug
 Turns on socket debugging used for communication with the remote host.
 
-@item -k @var{realm}
-@itemx --realm=@var{realm}
-@opindex -k
-@opindex --realm
-The option requests rsh to obtain tickets for the remote host in
-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
@@ -1762,6 +1780,25 @@ whenever available, and authorization is determined as in @command{rlogin}
 @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.
+@end table
+
+@noindent
+The next three options are available only if the program
+has been compiled with support for Kerberos authentication.
+
+@table @option
+@item -k @var{realm}
+@itemx --realm=@var{realm}
+@opindex -k
+@opindex --realm
+The option requests rsh to obtain tickets for the remote host in
+realm @var{realm} instead of the remote host's realm.
+
+@item -K
+@itemx --kerberos
+@opindex -K
+@opindex --kerberos
+Turns off all Kerberos authentication.
 
 @item -x
 @itemx --encrypt
@@ -1772,48 +1809,78 @@ may impact response time and CPU utilization, but provides increased
 security.
 @end table
 
-If no command is specified, you will be logged in on the remote host
-using @command{rlogin}.
+@noindent
+Finally, some compatibility options are present:
+
+@table @option
+@itemx -8
+@itemx --8-bit
+@itemx -e @var{char}
+@itemx --escape=@var{char}
+@itemx -E
+@itemx --no-escape
+Ignored during normal operation, but passed on to @command{rlogin}
+when @command{rsh} is invoked without a command argument.
+@end table
 
-@c FIXME: I do not follow the example, what is OTHER_REMOTEFILE?
+@section Note on stream redirections
 
-Shell metacharacters which are not quoted are interpreted on the local
+Beware that non-quoted shell metacharacters are interpreted on the local
 machine, while quoted metacharacters are interpreted on the remote
 machine.  For example:
 
 @example
-rsh otherhost cat remotefile >> localfile
-rsh otherhost cat remotefile ">> "localfile
+rsh otherhost  cat remotefile >> localfile
+rsh otherhost  cat remotefile ">>" otherfile
 @end example
 
-The first command appends the remote file file @file{remotefile} to
-the local file @file{localfile}, while the later command appends
-@file{remotefile} to @file{other_remotefile}.
+@noindent
+The first command appends the contents of @file{remotefile}, as found
+on the remote host, to the file @file{localfile} on the local host,
+since the local shell will intercept the redirection and will thus
+receive whatever the remote process directs to stdout.
+
+In contrast, the second command will append the contents of the same
+file @file{remotefile} to a file named @file{otherfile} again, but this
+time the file is located on the remote host.  The effect of quoting
+the redirection operator is to execute the command
+
+@smallexample
+cat remotefile >> localfile
+@end smallexample
+
+@noindent
+entirely on the remote most, whence stdout at the remote host will
+have nothing to transmit to the listening local host!.
 
 @node rlogin invocation
 @chapter @command{rlogin}: Remote login
 @cindex rlogin
 
-@command{rlogin} command logs into a specified remote host and
-connects your local terminal to the remote host.  The remote terminal
-type is the same as that given in the @env{TERM} local environment
-variable.  The terminal or window size is also the same, if the remote
-host supports them, and any changes in size are transferred.
+The @command{rlogin} command starts a terminal session on the
+specified remote host, provided the required authentication
+is successful.  The remote terminal type is the same as that
+given in the @env{TERM} local environment variable.
+The terminal and the window size stay the same, if the remote
+host supports them, and any changes in size are transferred
+as need may be.
 
-When using the @command{rlogin} command, you can create a link to your
-path using a host name as the link name.  For example:
+When using the @command{rlogin} command, you can create a link
+in your path, using a host name as the link name.  For example:
 
 @example
 # ln -s /usr/bin/rlogin @var{hostname}
 # @var{hostname} -8
 @end example
 
-Using @var{hostname} automatically uses the @command{rlogin} to log in
-to the remote host named @var{hostname}.
+@noindent
+Afterwards, the use of @var{hostname} will automatically invoke
+@command{rlogin} to direct a log in request to the remote host
+named @var{hostname}.
 
 @command{rlogin} allows access to the remote host without the use of a
-passwd.  For details, @xref{rcmd, , rcmd, libc, The GNU C Library
-Reference Manual}.
+password.  The prerequisite is a suitable specification in @file{~/.rhosts}.
+For details, @xref{rcmd, , rcmd, libc, The GNU C Library Reference Manual}.
 
 @section Invoking
 
@@ -1863,6 +1930,20 @@ Stops any character from being recognized as an escape character.
 When used with the @option{-8} option, this provides a completely
 transparent connection.
 
+@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.
+@end table
+
+@noindent
+The next three options are available only if the program
+has been compiled with support for Kerberos authentication.
+
+@table @option
 @item -k @var{realm}
 @itemx --realm=@var{realm}
 @opindex -k
@@ -1876,14 +1957,6 @@ realm @var{realm} instead of the remote host's realm.
 @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
@@ -1893,24 +1966,61 @@ This may impact response time and CPU utilization, but provides
 increased security.
 @end table
 
-A line of the form @kbd{@var{escape-char}.} disconnects from the
-remote host.  Similarly, the line @kbd{@var{escape-char}C-Z} will
-suspend the rlogin session, and
-@kbd{@var{escape-char}@var{delayed-suspend-char}} suspends the send
-portion of the @command{rlogin}, but allows output from the remote
-system.  By default, the tilde (@samp{~) character} is the
-@var{escape-char}, and normally @kbd{C-Y} is the
-@var{delayed-suspend-char}.
-
-All echoing takes place at the remote site, so that (except for
-delays) the @command{rlogin} is transparent.  Flow control via
-@kbd{C-S}/@kbd{C-Q}, if supported, stop and start the flow of
-information, flushing of input and output on interrupts are handled
-properly.
+@section Escape characters and flow control
+
+As long as the connection stands, the client program @command{rsh}
+is observing the input stream in order to detect so called
+escape sequences, allowing the user to execute some local
+actions without having to tear down the remote connection.
+
+The sequences consist of two characters, the first of which
+always is the distinguished character @var{escape-char}.
+The following sequences are supported:
+
+@c An input line of the form of the two-character sequence
+@itemize @bullet
+@item
+@kbd{@var{escape-char} .} disconnects from the remote host.
+
+@item
+@kbd{@var{escape-char} C-d} does the same.
+(Termios character @samp{VEOF}.)
+
+@item
+@kbd{@var{escape-char} C-z} suspends the session, halting the
+remote process, but keeping it ready for resumed processing.
+The user is given access to a local shell.
+(Termios character @samp{VSUSP}.)
+
+@item
+@kbd{@var{escape-char} @var{delayed-suspend-char}} implements
+a half-way suspend, in the sense of stopping local input from
+reaching the remote side, but still displaying all output from
+the remote host on the local terminal.  The remote process is
+still running, but the local user is given a local shell until
+the resuming the original command.
+Normally, only BSD systems offer this mode.
+(Termios character @samp{VDSUSP}.)
+@end itemize
+
+@noindent
+By default, the character tilde @samp{~} is assigned to @var{escape-char},
+but it can be changed using the option @option{--escape}.
+The processing of escape sequences can even be disable using
+the option @option{--no-escape}.
+On BSD systems, @var{delayed-suspend-char} is usually set to @kbd{C-Y}.
+It displays as @samp{dsusp} using @command{stty}.
+
+All echoing takes place at the remote site, so that the @command{rlogin}
+is transparent except possibly for transmission delays.
+Flow control via @kbd{C-S} and @kbd{C-Q}, if at all supported,
+will stop and start the flow of data on the local terminal.
+Flushing of input and output on interrupts is also
+handled properly.
 
 On the server side the @code{iruserok} and @code{ruserok} functions
-are used to authenticate, see the appropriate man page for more
-information, if supported.
+are used to authenticate the connection request, unless Kerberised
+mode is in effect.  See the appropriate man pages for more information.
 
 @section Kerberos Authentication
 
@@ -2161,6 +2271,7 @@ previous state.
 
 @node telnet invocation
 @chapter @command{telnet}: User interface to TELNET
+@cindex telnet
 
 Login to a remote system HOST, optionally using a (non-standard)
 service port PORT:
@@ -2317,38 +2428,47 @@ however, support several command line options.  These are:
 Turns on debugging.  With this option, @command{inetd} stays in
 foreground and prints additional debugging information of stderr.
 
-@item -R @var{rate}
-@itemx --rate=@var{rate}
-@opindex --r
-@opindex --rate
-Specifies the maximum number of times a service can be invoked in one
-minute; the default is 1000.
-
-@opindex --environment
 @item --environment
+@opindex --environment
 Pass local and remote socket information in environment variables.
 @xref{Inetd Environment}.
 
-@opindex --resolve
+@item -p[@var{file}]
+@itemx --pidfile[=@var{file}]
+@opindex -p
+@opindex --pidfile
+Use @var{file} as location to store process ID of the running server
+process, thus overriding the default location.  Setting an empty
+argument will disable the use of a file for storing the process ID.
+
 @item --resolve
-Resolve IP addresses when setting environment variables.  @xref{Inetd
-Environment}.
+@opindex --resolve
+Resolve IP addresses when setting environment variables.
+@xref{Inetd Environment}.
+
+@item -R @var{rate}
+@itemx --rate=@var{rate}
+@opindex --r
+@opindex --rate
+Specify the maximum number of times a service can be invoked in one
+minute; the default is 1000.
 @end table
 
 @node Configuration file
 @section Configuration file
 
-Upon execution, inetd reads its configuration information from a
-configuration pathnames on the command line, by default,
-@file{/etc/inetd.conf} and @file{/etc/initd.d}.  If the configuration
-pathname is a directory, all the files in the directory are read like
-a configuration file.  All of the configuration files are read and
-merged.  There must be an entry for each field in the configuration
-file, with entries for each field separated by a tab or a space.
-Comments are denoted by a ``#'' at the beginning of a line.  There
-must be an entry for each field.  The fields of the configuration file
-are summarized in the table below (optional parts are enclosed in
-square brackets:
+Upon execution, inetd reads its configuration information from
+configuration files and directories named on the command line.
+By default these are @file{/etc/inetd.conf} and @file{/etc/initd.d}.
+If the configuration pathname is a directory, all files in the
+directory are read and interpreted like a configuration file.
+All of the configuration files are read and the results are merged.
+
+There must be an entry for each field in the configuration file,
+with entries for each field separated by a tab or a space.
+Comments are denoted by a ``#'' at the beginning of a line.
+The available fields of the configuration file are summarized
+in the table below (optional parts are enclosed in square brackets):
 
 @table @asis
 @item [service node:]service name
@@ -2361,7 +2481,7 @@ representation thereof.  For TCPMUX services, the value of the
 followed by a slash and the locally-chosen service name
 (@pxref{TCPMUX}).
 
-Optional @samp{service node} prefix is allowed for internet services.
+An optional @samp{service node} prefix is allowed for internet services.
 When present, it supplies the local addresses @command{inetd} should
 use when listening for that service.  @samp{Service node} consists of
 a comma-separated list of addresses.  Both symbolic host names and
@@ -2382,8 +2502,8 @@ further lines lacking an explicit host specifier.  Such a default
 address remains in effect until another such line or end of the
 configuration is encountered, whichever occurs first.
 
-A special hostname @samp{*} stands for @code{INADDR_ANY}.  When used
-in a normal configuration line, it causes the default address
+A special hostname @samp{*} stands for the wildcard address.
+When used in a normal configuration line, it causes the default address
 specifier to be ignored for that line.  When used in a default address
 specification, e.g.:
 
@@ -3375,75 +3495,57 @@ useful in an ``open'' environment.
 @chapter @command{rlogind}: Remote login server
 @cindex rlogind
 
-@command{rlogind} is the server for the @command{rlogin} program
+@command{rlogind} is the server for the @command{rlogin} client program
 (@pxref{rlogin invocation}).  The server provides a remote login
 facility with authentication based on privileged port numbers from
-trusted hosts.
-
-@command{rlogind} listens for service requests at the port indicated
-in the @samp{login} service specification.  When a service 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.
-
-@item
-The server checks the client's source address and requests the
-corresponding host name.  If the hostname cannot be determined, the
-dot-notation representation of the host address is used.  If the
-hostname is in the same domain as the server (according to the last
-two components of the domain name), or if the @option{-a} option is
-given, the addresses for the hostname are requested, verifying that
-the name and address correspond.  Normal authentication is bypassed if
-the address verification fails.
-@end enumerate
-
-Once the source port and address have been checked, rlogind proceeds
-with the authentication process described @ref{rshd invocation}.  It
-then allocates a pseudo terminal, and manipulates file descriptors so
-that the slave half of the pseudo terminal becomes the stdin, stdout,
-and stderr for a login process.  The login process is an instance of
-the @command{login} program, invoked with the @option{-f} option if
-authentication has succeeded.  If automatic authentication fails, the
-user is prompted to log in as if on a standard terminal line.
-
-The parent of the login process manipulates the master side of the
-pseudo terminal, operating as an intermediary between the login
-process and the client instance of the rlogin program.  In normal
-operation, the packet protocol described in @samp{PTY} is invoked to
-provide @kbd{C-S}/@kbd{C-Q} type facilities and propagate interrupt
-signals to the remote programs.  The login process propagates the
-client terminal's baud rate and terminal type, as found in the
-environment variable, @env{TERM}.  The screen or window size of the
-terminal is requested from the client, and window size changes from
-the client are propagated to the pseudo terminal.
-
-Transport-level keepalive messages are enabled unless the @option{-n}
-option is client instance of the @code{rlogin} program.  The use of
-keepalive messages allows sessions to be timed out if the client
-crashes or becomes unreachable.
-
-@xref{ruserok, , ruserok, libc, The GNU C Library Reference Manual},
-for details.
+trusted hosts, or using authentication according to a Kerberos
+protocol.
+
+@command{rlogind} in daemon mode listens for service requests at the
+port indicated in the @samp{login} service specification.  A common
+alternative is to have the super-server @command{inetd} listen at
+the same port, which then invokes @command{rlogind} as demand arises.
+In Kerberised mode, the port is either @samp{eklogin}, or
+@samp{klogin}, depending on preset encryption, or none.
+
+The standard authentication procedure assumes the integrity of each
+client machine and of the connecting medium.  This is insecure, since
+it transmits credentials in clear text, but is useful in an ``open''
+environment.  This weakness is reduced when running the service
+in Kerberised version, at the price of a larger complexity of the
+supporting infrastructure.  Using an encrypting Kerberised service
+even avoids all clear text processing.
 
 @section Invoking
 
-The options are as follows:
+The available options are as follows:
 
 @table @option
+@item -4
+@itemx --ipv4
+@opindex -4
+@opindex --ipv4
+Accept only IPv4 connections in daemon mode.
+
+@item -6
+@itemx --ipv6
+@opindex -6
+@opindex --ipv6
+Only IPv6 connections in daemon mode.
+
 @item -a
 @itemx --verify-hostname
 @opindex -a
 @opindex --verify-hostname
 Ask hostname for verification.
 
-@item -d
-@itemx --daemon
+@item -d[@var{max}]
+@itemx --daemon[=@var{max}]
 @opindex -d
 @opindex --daemon
-Daemon mode.
+Run in background daemon mode, optionally setting the maximal
+number of simultaneously running client sessions.  The default
+limit is 10.
 
 @item -D[@var{level}]
 @itemx --debug[=@var{level}]
@@ -3451,80 +3553,163 @@ Daemon mode.
 @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
 @opindex --no-rhosts
-Ignore @file{.rhosts} file.
+Ignore client's @file{.rhosts} file.
 
 @item -L @var{name}
 @itemx --local-domain=@var{name}
 @opindex -L
 @opindex --local-domain
-Set local domain name.
+Set local domain name, to which the server host belongs.  By default
+the domain is recovered from the canonical name of the host.
 
 @item -n
 @itemx --no-keepalive
 @opindex -n
 @opindex --no-keepalive
-Do not set SO_KEEPALIVE.
+Do not set SO_KEEPALIVE on sockets.  This decreases the ability
+to close lost connections to once active clients.
 
 @item -o
 @itemx --allow-root
 @opindex -o
 @opindex --allow-root
-Allow the root user to login. This is disallowed by default.
+Allow the root user to login, which is disallowed by default.
 
 @item -p @var{port}
 @itemx --port=@var{port}
 @opindex -p
 @opindex --port
-Listen on given port. (Applicable 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 remote host's numerical IP.
+Require reverse resolvability of remote host's numerical IP.
+@end table
+
+For sites requiring improved authentication, Kerberos
+authentication is a viable decision, and possibly even
+with encryption for enhanced integrity.  Three additional
+options are available for an executable @command{rlogind}
+compiled with Kerberos support.
+
+@table @option
+@item -k
+@itemx --kerberos
+@opindex -k
+@opindex --kerberos
+Activate Kerberos authentication on all incoming requests.
 
 @item -S @var{name}
-@itemx --servername=@var{name}
+@itemx --server-principal=@var{name}
 @opindex -S
-@opindex --servername
+@opindex --server-principal
 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.
+Activate encryption of all data passed via the @command{rlogind} session.
 This may impact response time and CPU utilization, but provides
-increased security.
-
+increased security.  Only for Kerberised mode of operation.
 @end table
 
+@section Kerberos specific details
+
+The option @option{-k} is mandatory for Kerberised operation mode,
+while addition of the option @option{-x} will also demand encryption
+of every request to this particular server.
+
+@command{rlogind} will, in Kerberised operation mode, as default
+instantiate itself using the principal name
+@samp{host/canonical_name@@DEFAULT_REALM}, a compound arranged
+from the running host's canonical name, and from the default realm
+configured for the system.  Either of these can be overridden
+using the option @option{--server-principal}, as follows:
+
+@example
+rlogind -k -S alias.server.our
+rlogind --kerberos --server-principal=@@NEW.REALM
+rlogind -k -x -S rlogin/backup.ex.org@@OUR.REALM
+@end example
+
+When overriding only the realm, with the option @option{-S},
+an initial at-sign is mandatory.
+
+@section Protocol details
+
+When a service request is received, in non-Kerberised mode,
+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.
+
+@item
+The server next checks the client's source address and requests the
+corresponding host name.  If the hostname cannot be determined, the
+numerical representation of the host address is used.  If the
+hostname is in the same domain as the server (according to the last
+two components of the domain name), or if the option @option{-a} is
+in effect, the address for the hostname is requested, verifying that
+the name and address correspond.  Normal authentication is considered
+as failed, should this address verification fail.
+@end enumerate
+
+Once the source port and address have been checked, @command{rlogind}
+proceeds
+with the authentication process as described in @ref{rshd invocation}.
+The server
+then allocates a pseudo terminal, and manipulates file descriptors so
+that the slave half of the pseudo terminal becomes the stdin, stdout,
+and stderr for a login process.  The login process is an instance of
+the @command{login} program, invoked with the option @option{-f} if
+authentication had succeeded.  If automatic authentication had failed,
+the user is prompted to log in as if on a standard terminal line.
+
+The parent of the login process manipulates the master side of the
+pseudo terminal, operating as an intermediary between the login
+process and the client instance of the rlogin program.  In normal
+operation, the packet protocol described in @samp{PTY} is invoked to
+provide flow control using @kbd{C-S}/@kbd{C-Q}, and to propagate interrupt
+signals to the remote program.  The login process transmits the
+client terminal's baud rate, and its terminal type, as found in the
+environment variable @env{TERM}.  The screen or window size of the
+terminal is requested from the client, and any later window size changes
+at the client's side are propagated to the pseudo terminal as well.
+
+Transport-level keepalive messages are enabled unless the
+option @option{-n} was in effect when starting @code{rlogind}.
+The use of keepalive messages allows sessions to be timed out,
+should the client crash, or otherwise become unreachable.
+
+@xref{ruserok, , ruserok, libc, The GNU C Library Reference Manual},
+for details.
+
 @section Diagnostics
 
-All initial diagnostic messages are indicated by a leading byte with a
-value of 1, after which any network connections are closed.  If there
-are no errors before login is invoked, a null byte is returned as in
-indication of success.
+The exchange protocol states that a negotiation reaches a successful
+completion as soon as the server @command{rlogind} transmits back to
+the client a single null byte, marking the completion of all
+information exchange.
+
+Error conditions are instead transmitted back to the client as
+a message containing an initial byte value 1, followed by a C-string
+indicating the cause of failure. All network connections are closed
+at the server side after this message.  Some common messages follow:
 
 @table @samp
 @item Try again.
 A fork by the server failed.
 @end table
 
-The authentication procedure used here assumes the integrity of each
-client machine and the connecting medium.  This is insecure, but is
-useful in an ``open'' environment.
-
 @node rexecd invocation
 @chapter @command{rexecd}: server for @code{rexec}
 @cindex rexecd
@@ -3871,14 +4056,45 @@ is to be disabled.  Standard choices are @samp{null},
 @end table
 
 @node uucpd invocation
-@chapter @command{uucpd}: Unix to Unix Copy
+@chapter @command{uucpd}: Unix to Unix Copy relay daemon.
+@cindex uucpd
 
-Synopsis:
+@command{uucpd} is a relay daemon responsible for accepting
+TCP transported connections for @command{uucico}.  It is started
+by @command{inetd}, conducts any authentication, and then hands
+acceptable requests over to @command{uucico}.
 
 @example
 uucpd [@var{option}]...
 @end example
 
+@section Options
+
+There is a single, specific option available:
+
+@table @option
+@item -u @var{location}
+@itemx --uucico=@var{location}
+@opindex -u
+@opindex --uucico
+Replace the hard coded location of @command{uucico} with the
+value specified as @var{location}.
+@end table
+
+@section Authentication steps.
+
+Invocation is expected to be conducted by a protocol described
+exchange of user name and password; unfortunately in clear text.
+If those agree with existing local entries, then @command{uucpd}
+verifies that the stated user also has user shell location
+identical to the full file system location of @command{uucico}.
+Should that not be the case, the request is declined.
+
+For this latter check, the option @option{--uucico} is useful
+when setting the configuration for @command{inetd}. It is
+recommended to wrap the invocation line of @command{uucpd}
+within a call to @command{tcpd} in the standard fashion.
+
 @node GNU Free Documentation License
 @appendix GNU Free Documentation License
 @include fdl-1.3.texi

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

Summary of changes:
 doc/inetutils.texi |  672 ++++++++++++++++++++++++++++++++++------------------
 1 files changed, 444 insertions(+), 228 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Oct 10 20:23:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TM6Yb-0001Xp-5g
	for mharc-commit-inetutils@gnu.org; Wed, 10 Oct 2012 20:23:21 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33561)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TM6YX-0001XQ-De
	for commit-inetutils@gnu.org; Wed, 10 Oct 2012 20:23:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TM6YV-0004zq-B0
	for commit-inetutils@gnu.org; Wed, 10 Oct 2012 20:23:17 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:41948)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TM6YV-0004zi-7b
	for commit-inetutils@gnu.org; Wed, 10 Oct 2012 20:23:15 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TM6YU-0003ok-2H
	for commit-inetutils@gnu.org; Thu, 11 Oct 2012 00:23:14 +0000
Date: Thu, 11 Oct 2012 00:23:14 +0000
Message-Id: <E1TM6YU-0003ok-2H@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-186-g037be5b
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: e4ac90ae657b406b66ba25e68198b96764c322dc
X-Git-Newrev: 037be5ba9e0ff931ffddbba117939094126ca443
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, 11 Oct 2012 00:23:19 -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  037be5ba9e0ff931ffddbba117939094126ca443 (commit)
      from  e4ac90ae657b406b66ba25e68198b96764c322dc (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=037be5ba9e0ff931ffddbba117939094126ca443


commit 037be5ba9e0ff931ffddbba117939094126ca443
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Oct 11 02:14:13 2012 +0200

    telnetd: Resolve mixed up host names.

diff --git a/ChangeLog b/ChangeLog
index c2474df..6f34b80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2012-10-11  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	telnetd: Set local name correctly for libshishi.
+	Improve selectivity of intended server host key.
+
+	* libtelnet/shishi.h (krb5shishi_is_auth): Replace call
+	to shishi_hostkeys_for_server(), with a variant where
+	default realm is made explicit with shishi_realm_default().
+
+	* telnetd/telnetd.c (telnetd_setup)
+	[AUTHENTICATION || ENCRYPTION]: Exchange places of
+	`local_hostname' and `remote_hostname' in call to
+	auth_encrypt_init().
+
+	rlogind: Enable Kerberised daemon mode listener.
+
+	* src/rlogind.c (DEFPORT_KLOGIN, DEFPORT_EKLOGIN): New macros.
+	(rlogin_daemon): New variable SERVICE.  Use service port
+	`login', `klogin', or `eklogin' according to set options.
+
+	* src/rlogin.c (main) <rcmd failure>: Print a NL, finishing
+	an unfinished error massage emitted by Glibc.
+
 2012-10-08  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	rlogind: Support libwrap in daemon mode.
diff --git a/libtelnet/shishi.c b/libtelnet/shishi.c
index 32a59e6..9edd4e5 100644
--- a/libtelnet/shishi.c
+++ b/libtelnet/shishi.c
@@ -501,7 +501,9 @@ krb5shishi_is_auth (TN_Authenticator * a, unsigned char *data, int cnt,
 	key = shishi_hostkeys_for_serverrealm (shishi_handle,
 					       server, realm);
       else
-	key = shishi_hostkeys_for_server (shishi_handle, server);
+	/* Enforce a search with the known default realm.  */
+	key = shishi_hostkeys_for_serverrealm (shishi_handle,
+			server, shishi_realm_default (shishi_handle));
 
       free (server);
     }
diff --git a/src/rlogin.c b/src/rlogin.c
index 569245e..9a7c483 100644
--- a/src/rlogin.c
+++ b/src/rlogin.c
@@ -617,7 +617,10 @@ try_connect:
 #endif /* KERBEROS */
 
   if (rem < 0)
-    exit (EXIT_FAILURE);
+    {
+      puts ("");	/* Glibc does not close all error strings in rcmd().  */
+      exit (EXIT_FAILURE);
+    }
 
   {
     int one = 1;
diff --git a/src/rlogind.c b/src/rlogind.c
index 9663be6..7e8b113 100644
--- a/src/rlogind.c
+++ b/src/rlogind.c
@@ -141,6 +141,12 @@
 #ifndef DEFPORT
 # define DEFPORT 513
 #endif
+#ifndef DEFPORT_KLOGIN
+# define DEFPORT_KLOGIN 543
+#endif
+#ifndef DEFPORT_EKLOGIN
+# define DEFPORT_EKLOGIN 2105
+#endif
 
 #ifdef HAVE___CHECK_RHOSTS_FILE
 extern int __check_rhosts_file;
@@ -391,12 +397,12 @@ static struct argp_option options[] = {
 #if defined KERBEROS || defined SHISHI
 # define GRP 20
   { "kerberos", 'k', NULL, 0,
-    "use kerberos IV/V authentication", GRP },
+    "use Kerberos V authentication", GRP },
   { "server-principal", 'S', "NAME", 0,
     "set Kerberos server name, overriding canonical hostname", GRP },
 # if defined ENCRYPTION
   { "encrypt", 'x', NULL, 0,
-    "use DES encryption", GRP },
+    "use encryption", GRP },
 # endif
 # undef GRP
 #endif
@@ -647,13 +653,28 @@ rlogin_daemon (int maxchildren, int port)
 
   if (port == 0)
     {
+      char *service;
       struct servent *svp;
 
-      svp = getservbyname ("login", "tcp");
+      if (kerberos && encrypt_io)
+	{
+	  service = "eklogin";
+	  port = DEFPORT_EKLOGIN;
+	}
+      else if (kerberos)
+	{
+	  service = "klogin";
+	  port = DEFPORT_KLOGIN;
+	}
+      else
+	{
+	  service = "login";
+	  port = DEFPORT;
+	}
+
+      svp = getservbyname (service, "tcp");
       if (svp != NULL)
 	port = ntohs (svp->s_port);
-      else
-	port = DEFPORT;
     }
 
   /* Become a daemon. Take care to close inherited fds and reserve
diff --git a/telnetd/telnetd.c b/telnetd/telnetd.c
index c376197..82243c5 100644
--- a/telnetd/telnetd.c
+++ b/telnetd/telnetd.c
@@ -466,7 +466,7 @@ telnetd_setup (int fd)
 
   local_hostname = localhost ();
 #if defined AUTHENTICATION || defined ENCRYPTION
-  auth_encrypt_init (remote_hostname, local_hostname, principal,
+  auth_encrypt_init (local_hostname, remote_hostname, principal,
 		     "TELNETD", 1);
 #endif
 

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

Summary of changes:
 ChangeLog          |   23 +++++++++++++++++++++++
 libtelnet/shishi.c |    4 +++-
 src/rlogin.c       |    5 ++++-
 src/rlogind.c      |   31 ++++++++++++++++++++++++++-----
 telnetd/telnetd.c  |    2 +-
 5 files changed, 57 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Oct 10 21:03:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TM7BR-0000kL-5g
	for mharc-commit-inetutils@gnu.org; Wed, 10 Oct 2012 21:03:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40483)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TM7BK-0000jn-32
	for commit-inetutils@gnu.org; Wed, 10 Oct 2012 21:03:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TM7BF-0001wz-NS
	for commit-inetutils@gnu.org; Wed, 10 Oct 2012 21:03:22 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:58448)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TM7BF-0001wu-KI
	for commit-inetutils@gnu.org; Wed, 10 Oct 2012 21:03:17 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TM7BF-0007P8-CH
	for commit-inetutils@gnu.org; Thu, 11 Oct 2012 01:03:17 +0000
Date: Thu, 11 Oct 2012 01:03:17 +0000
Message-Id: <E1TM7BF-0007P8-CH@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-187-g17f476a
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 037be5ba9e0ff931ffddbba117939094126ca443
X-Git-Newrev: 17f476a91f604b0307eb4fdb9498d352457909fe
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, 11 Oct 2012 01:03:28 -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  17f476a91f604b0307eb4fdb9498d352457909fe (commit)
      from  037be5ba9e0ff931ffddbba117939094126ca443 (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=17f476a91f604b0307eb4fdb9498d352457909fe


commit 17f476a91f604b0307eb4fdb9498d352457909fe
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Oct 11 02:55:46 2012 +0200

    rlogind: Protect code blocks for Kerberos.

diff --git a/ChangeLog b/ChangeLog
index 6f34b80..3d49088 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2012-10-11  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	* src/rlogind.c (rlogin_daemon)
+	[(KERBEROS || SHISHI) && ENCRYPTION]: Protect
+	encrypted port pre-selection.
+	[(KERBEROS || SHISHI) && !ENCRYPTION]: Protect
+	standard Kerberos port pre-selection.
+
+2012-10-11  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	telnetd: Set local name correctly for libshishi.
 	Improve selectivity of intended server host key.
 
diff --git a/src/rlogind.c b/src/rlogind.c
index 7e8b113..064cc50 100644
--- a/src/rlogind.c
+++ b/src/rlogind.c
@@ -656,21 +656,26 @@ rlogin_daemon (int maxchildren, int port)
       char *service;
       struct servent *svp;
 
+#if defined KERBEROS || defined SHISHI
+# ifdef ENCRYPTION
       if (kerberos && encrypt_io)
 	{
 	  service = "eklogin";
 	  port = DEFPORT_EKLOGIN;
 	}
-      else if (kerberos)
-	{
-	  service = "klogin";
-	  port = DEFPORT_KLOGIN;
-	}
       else
-	{
-	  service = "login";
-	  port = DEFPORT;
-	}
+# endif /* ENCRYPTION */
+	if (kerberos)
+	  {
+	    service = "klogin";
+	    port = DEFPORT_KLOGIN;
+	  }
+	else
+#endif /* KERBEROS || SHISHI */
+	  {
+	    service = "login";
+	    port = DEFPORT;
+	  }
 
       svp = getservbyname (service, "tcp");
       if (svp != NULL)

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

Summary of changes:
 ChangeLog     |    8 ++++++++
 src/rlogind.c |   23 ++++++++++++++---------
 2 files changed, 22 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Oct 11 07:16:11 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TMGkN-0007lL-NG
	for mharc-commit-inetutils@gnu.org; Thu, 11 Oct 2012 07:16:11 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41554)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TMGkG-0007kD-1v
	for commit-inetutils@gnu.org; Thu, 11 Oct 2012 07:16:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TMGk9-0000Xm-QC
	for commit-inetutils@gnu.org; Thu, 11 Oct 2012 07:16:03 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:33068)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TMGk9-0000Xi-MR
	for commit-inetutils@gnu.org; Thu, 11 Oct 2012 07:15:57 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TMGk8-0002rA-Hn
	for commit-inetutils@gnu.org; Thu, 11 Oct 2012 11:15:57 +0000
Date: Thu, 11 Oct 2012 11:15:56 +0000
Message-Id: <E1TMGk8-0002rA-Hn@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-188-g48c58b1
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 17f476a91f604b0307eb4fdb9498d352457909fe
X-Git-Newrev: 48c58b140e5eb42dc2ea831d65eb516cae320b62
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, 11 Oct 2012 11:16:10 -0000

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

The branch, master has been updated
       via  48c58b140e5eb42dc2ea831d65eb516cae320b62 (commit)
      from  17f476a91f604b0307eb4fdb9498d352457909fe (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=48c58b140e5eb42dc2ea831d65eb516cae320b62


commit 48c58b140e5eb42dc2ea831d65eb516cae320b62
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Oct 11 13:12:18 2012 +0200

    rlogin: Urgent data handling.

diff --git a/ChangeLog b/ChangeLog
index 3d49088..75a8674 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2012-10-11  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	rlogin: Read urgent data also when Kerberos has
+	been disabled.  Needed for window sizing.
+
+	* src/rlogin.c (sigwinch): Call get_window_size()
+	with STDIN_FILENO as file descriptor.
+	(oob) [SHISHI]: Receive MSG_OOB data whenever
+	`!use_kerberos' is true.
+
+2012-10-11  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	* src/rlogind.c (rlogin_daemon)
 	[(KERBEROS || SHISHI) && ENCRYPTION]: Protect
 	encrypted port pre-selection.
diff --git a/src/rlogin.c b/src/rlogin.c
index 9a7c483..6d0c0fc 100644
--- a/src/rlogin.c
+++ b/src/rlogin.c
@@ -1111,7 +1111,7 @@ sigwinch (int signo _GL_UNUSED_PARAMETER)
 {
   struct winsize ws;
 
-  if (dosigwinch && get_window_size (0, &ws) == 0
+  if (dosigwinch && get_window_size (STDIN_FILENO, &ws) == 0
       && memcmp (&ws, &winsize, sizeof ws))
     {
       winsize = ws;
@@ -1176,36 +1176,38 @@ oob (int signo _GL_UNUSED_PARAMETER)
   out = O_RDWR;
   rcvd = 0;
 
-#ifndef SHISHI
-  while (recv (rem, &mark, 1, MSG_OOB) < 0)
-    {
-      switch (errno)
-	{
-	case EWOULDBLOCK:
-	  /*
-	   * Urgent data not here yet.  It may not be possible
-	   * to send it yet if we are blocked for output and
-	   * our input buffer is full.
-	   */
-	  if ((size_t) rcvcnt < sizeof rcvbuf)
-	    {
-	      n = read (rem, rcvbuf + rcvcnt, sizeof (rcvbuf) - rcvcnt);
-	      if (n <= 0)
-		return;
-	      rcvd += n;
-	    }
-	  else
-	    {
-	      n = read (rem, waste, sizeof waste);
-	      if (n <= 0)
-		return;
-	    }
-	  continue;
-	default:
-	  return;
-	}
-    }
+#ifdef SHISHI
+  if (!use_kerberos)
 #endif
+    while (recv (rem, &mark, 1, MSG_OOB) < 0)
+      {
+	switch (errno)
+	  {
+	  case EWOULDBLOCK:
+	    /*
+	     * Urgent data not here yet.  It may not be possible
+	     * to send it yet if we are blocked for output and
+	     * our input buffer is full.
+	     */
+	    if ((size_t) rcvcnt < sizeof rcvbuf)
+	      {
+		n = read (rem, rcvbuf + rcvcnt, sizeof (rcvbuf) - rcvcnt);
+		if (n <= 0)
+		  return;
+		rcvd += n;
+	      }
+	    else
+	      {
+		n = read (rem, waste, sizeof waste);
+		if (n <= 0)
+		  return;
+	      }
+	    continue;
+	  default:
+	    return;
+	  }
+      }
+
   if (mark & TIOCPKT_WINDOW)
     {
       /* Let server know about window size changes */
@@ -1346,6 +1348,7 @@ reader (sigset_t * osmask)
 	}
     }
 }
+
 void
 mode (int f)
 {

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

Summary of changes:
 ChangeLog    |   10 +++++++++
 src/rlogin.c |   63 ++++++++++++++++++++++++++++++---------------------------
 2 files changed, 43 insertions(+), 30 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Oct 11 20:57:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TMTZO-0007E7-RB
	for mharc-commit-inetutils@gnu.org; Thu, 11 Oct 2012 20:57:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53602)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TMTZL-0007Dy-Iq
	for commit-inetutils@gnu.org; Thu, 11 Oct 2012 20:57:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TMTZK-0002m9-1j
	for commit-inetutils@gnu.org; Thu, 11 Oct 2012 20:57:39 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:58616)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TMTZJ-0002m3-U1
	for commit-inetutils@gnu.org; Thu, 11 Oct 2012 20:57:37 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TMTZJ-00012c-6l
	for commit-inetutils@gnu.org; Fri, 12 Oct 2012 00:57:37 +0000
Date: Fri, 12 Oct 2012 00:57:37 +0000
Message-Id: <E1TMTZJ-00012c-6l@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-189-g171cec6
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 48c58b140e5eb42dc2ea831d65eb516cae320b62
X-Git-Newrev: 171cec6e1ded44e7a6e394d8728c5a8cf2562940
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, 12 Oct 2012 00:57:41 -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  171cec6e1ded44e7a6e394d8728c5a8cf2562940 (commit)
      from  48c58b140e5eb42dc2ea831d65eb516cae320b62 (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=171cec6e1ded44e7a6e394d8728c5a8cf2562940


commit 171cec6e1ded44e7a6e394d8728c5a8cf2562940
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Oct 11 22:35:02 2012 +0200

    rlogind: Name specification in Kerberos mode.
    
    Improve realm detection and handle urgent
    data in non-encrypted Kerberos mode.

diff --git a/ChangeLog b/ChangeLog
index 75a8674..61e492d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,28 @@
 2012-10-11  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	rlogind: Server and realm detection.
+
+	* libinetutils/shishi.c (get_auth): Parse server
+	name input using shishi_parse_name(), but only if
+	`srvname' has some content.  Retrieve default
+	realm by calling shishi_realm_default(), and
+	pass it to shishi_hostkeys_for_serverrealm().
+
+	rlogin: Handle urgent data for non-encrypted Kerberos.
+	This enables window sizing and buffer flushing.
+
+	* src/rlogin.c (main): Set sigaction flag SA_RESTART
+	when installing SIGURG and SIGUSR1; a portability fix.
+	(oob) [SHISHI]: Assign urgent data `rcvbuf[4]' to MARK
+	whenever `use_kerberos' is true.  This is then compared
+	to different TIOCPKT_*.
+
+	* src/rlogind.c (fatal): Replace an empty format
+	input by the string "unspecified error", in order
+	to protect against segfaults in vsnprintf().
+
+2012-10-11  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	rlogin: Read urgent data also when Kerberos has
 	been disabled.  Needed for window sizing.
 
diff --git a/libinetutils/shishi.c b/libinetutils/shishi.c
index 1df3195..90c79a8 100644
--- a/libinetutils/shishi.c
+++ b/libinetutils/shishi.c
@@ -290,7 +290,7 @@ get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
   /* PROTOCOL VERSION */
   char krb5kcmd1[] = "KCMDV0.1";
   char krb5kcmd2[] = "KCMDV0.2";
-  char *servername, *server, *realm;
+  char *servername, *server = NULL, *realm = NULL;
 
   *err_msg = NULL;
   /* Get key for the server. */
@@ -306,11 +306,14 @@ get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
   if (rc != SHISHI_OK)
     return rc;
 
-  rc = shishi_parse_name (*handle, srvname, &server, &realm);
-  if (rc != SHISHI_OK)
+  if (srvname && *srvname)
     {
-      *err_msg = shishi_strerror (rc);
-      return rc;
+      rc = shishi_parse_name (*handle, srvname, &server, &realm);
+      if (rc != SHISHI_OK)
+	{
+	  *err_msg = shishi_strerror (rc);
+	  return rc;
+	}
     }
 
   if (server && *server)
@@ -351,7 +354,8 @@ get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
 	}
     }
 
-  key = shishi_hostkeys_for_server (*handle, servername);
+  key = shishi_hostkeys_for_serverrealm (*handle, servername,
+					 shishi_realm_default (*handle));
   free (servername);
   if (!key)
     {
diff --git a/src/rlogin.c b/src/rlogin.c
index 6d0c0fc..97d94a5 100644
--- a/src/rlogin.c
+++ b/src/rlogin.c
@@ -456,7 +456,7 @@ main (int argc, char *argv[])
    * a signal by the time that they are unblocked later on.
    */
   sigemptyset (&sa.sa_mask);
-  sa.sa_flags = 0;
+  sa.sa_flags = SA_RESTART;
   sa.sa_handler = copytochild;
   (void) sigaction (SIGURG, &sa, NULL);
   sa.sa_handler = writeroob;
@@ -1177,7 +1177,9 @@ oob (int signo _GL_UNUSED_PARAMETER)
   rcvd = 0;
 
 #ifdef SHISHI
-  if (!use_kerberos)
+  if (use_kerberos)
+    mark = rcvbuf[4];		/* Payload in fifth byte.  */
+  else
 #endif
     while (recv (rem, &mark, 1, MSG_OOB) < 0)
       {
diff --git a/src/rlogind.c b/src/rlogind.c
index 064cc50..c169ef5 100644
--- a/src/rlogind.c
+++ b/src/rlogind.c
@@ -1976,6 +1976,6 @@ rlogind_error (int f, int syserr, const char *msg, ...)
 void
 fatal (int f, const char *msg, int syserr)
 {
-  rlogind_error (f, syserr, msg);
+  rlogind_error (f, syserr, (msg && *msg) ? msg : "unspecified error");
   exit (EXIT_FAILURE);
 }

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

Summary of changes:
 ChangeLog             |   23 +++++++++++++++++++++++
 libinetutils/shishi.c |   16 ++++++++++------
 src/rlogin.c          |    6 ++++--
 src/rlogind.c         |    2 +-
 4 files changed, 38 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Oct 18 16:43:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TOwwI-0002bl-3s
	for mharc-commit-inetutils@gnu.org; Thu, 18 Oct 2012 16:43:34 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58380)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TOwwF-0002be-PL
	for commit-inetutils@gnu.org; Thu, 18 Oct 2012 16:43:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TOwwD-0005QF-Io
	for commit-inetutils@gnu.org; Thu, 18 Oct 2012 16:43:31 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:58727)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TOwwD-0005Q8-Eg
	for commit-inetutils@gnu.org; Thu, 18 Oct 2012 16:43:29 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TOwwC-0007X9-Sq
	for commit-inetutils@gnu.org; Thu, 18 Oct 2012 20:43:29 +0000
Date: Thu, 18 Oct 2012 20:43:28 +0000
Message-Id: <E1TOwwC-0007X9-Sq@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-191-g430bcdd
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 171cec6e1ded44e7a6e394d8728c5a8cf2562940
X-Git-Newrev: 430bcddb8ca05fe57a9fbe1119732f9b77b58fe3
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, 18 Oct 2012 20:43: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  430bcddb8ca05fe57a9fbe1119732f9b77b58fe3 (commit)
       via  d8342b4732138dae5c5de6ea16d2ffd77a4b03a0 (commit)
      from  171cec6e1ded44e7a6e394d8728c5a8cf2562940 (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=430bcddb8ca05fe57a9fbe1119732f9b77b58fe3


commit 430bcddb8ca05fe57a9fbe1119732f9b77b58fe3
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Oct 18 22:37:51 2012 +0200

    ftpd: User session close down.

diff --git a/ChangeLog b/ChangeLog
index bd9878f..4a3b957 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2012-10-18  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	ftpd: Properly close a user session.
+
+	* ftpd/ftpd.c (dologout): Call end_login().
+	* ftpd/pam.c (pam_doit): Call finishing pam_end()
+	only if ERROR is not PAM_SUCCESS.
+
+2012-10-18  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	ftpd: Security audit.
 
 	* ftpd/auth.c (auth_user): Declare ERR at top.
diff --git a/ftpd/ftpd.c b/ftpd/ftpd.c
index 10a7871..5ba5e24 100644
--- a/ftpd/ftpd.c
+++ b/ftpd/ftpd.c
@@ -1784,17 +1784,13 @@ dolog (struct sockaddr *sa, socklen_t salen, struct credentials *pcred)
 void
 dologout (int status)
 {
-  /* Racing condition with SIGURG: If SIGURG is receive
-     here, it will jump back has root in the main loop
+  /* Race condition with SIGURG: If SIGURG is received
+     here, it will jump back has root in the main loop.
      David Greenman:dg@root.com.  */
   transflag = 0;
+  end_login (&cred);
 
-  if (cred.logged_in)
-    {
-      seteuid ((uid_t) 0);
-      logwtmp_keep_open (ttyline, "", "");
-    }
-  /* beware of flushing buffers after a SIGPIPE */
+  /* Beware of flushing buffers after a SIGPIPE.  */
   _exit (status);
 }
 
diff --git a/ftpd/pam.c b/ftpd/pam.c
index 6f4fe00..babb48d 100644
--- a/ftpd/pam.c
+++ b/ftpd/pam.c
@@ -208,8 +208,11 @@ pam_doit (struct credentials *pcred)
 	    }
 	}
     }
-  pam_end (pamh, error);
-  pamh = 0;
+  if (error != PAM_SUCCESS)
+    {
+      pam_end (pamh, error);
+      pamh = NULL;
+    }
 
   return (error != PAM_SUCCESS);
 }
@@ -220,10 +223,10 @@ pam_user (const char *username, struct credentials *pcred)
 {
   int error;
 
-  if (pamh != 0)
+  if (pamh != NULL)
     {
       pam_end (pamh, PAM_ABORT);
-      pamh = 0;
+      pamh = NULL;
     }
 
   free (pcred->name);

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


commit d8342b4732138dae5c5de6ea16d2ffd77a4b03a0
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Thu Oct 18 21:26:10 2012 +0200

    ftpd: Prevent privilege escalation.

diff --git a/ChangeLog b/ChangeLog
index 61e492d..bd9878f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2012-10-18  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftpd: Security audit.
+
+	* ftpd/auth.c (auth_user): Declare ERR at top.
+	Replace most `return` inside switch block by `break`.
+	Put call checkuser(PATH_FTPCHROOT) at function end
+	whenever authentication succeeded, thus making it
+	reachable for all authentication modes.
+
+	* ftpd/ftpd.c: Include <xgetcwd.h>.
+	(curdir, makedir, removedir): Remove prototype xgetcwd().
+	(main): Call localhost() before sending welcome msg.
+	(complete_login): New variable CWD.  Set EUID before
+	calling chdir() for real users.  Call xgetcwd() and
+	set HOME in environment for all kinds of user.
+	(end_login): Reset `pcred->logged_in`.
+	(getdatasock, passive): Call _exit() at failure of
+	seteuid(cred.uid).
+
+	ftp: Self documentating code.
+
+	* ftp/ftp.c (getreply): Make ARPA's reply codes
+	explicit.  Let N carry these codes, not an ASCII
+	character value.
+
 2012-10-11  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	rlogind: Server and realm detection.
diff --git a/ftp/ftp.c b/ftp/ftp.c
index 43dbb36..5c4eba2 100644
--- a/ftp/ftp.c
+++ b/ftp/ftp.c
@@ -450,10 +450,10 @@ getreply (int expecteof)
 		  fflush (stdout);
 		}
 	      code = 421;
-	      return (4);
+	      return (TRANSIENT);
 	    }
 	  if (c != '\r' && (verbose > 0 ||
-			    (verbose > -1 && n == '5' && dig > 4)))
+			    (verbose > -1 && n == ERROR && dig > 4)))
 	    {
 	      if (proxflag && (dig == 1 || (dig == 5 && verbose == 0)))
 		printf ("%s:", hostname);
@@ -482,11 +482,11 @@ getreply (int expecteof)
 	      continuation++;
 	    }
 	  if (n == 0)
-	    n = c;
+	    n = c - '0';	/* Extract ARPA's reply code.  */
 	  if (cp < &reply_string[sizeof (reply_string) - 1])
 	    *cp++ = c;
 	}
-      if (verbose > 0 || (verbose > -1 && n == '5'))
+      if (verbose > 0 || (verbose > -1 && n == ERROR))
 	{
 	  putchar (c);
 	  fflush (stdout);
@@ -498,14 +498,14 @@ getreply (int expecteof)
 	  continue;
 	}
       *cp = '\0';
-      if (n != '1')
+      if (n != PRELIM)
 	cpend = 0;
       signal (SIGINT, oldintr);
       if (code == 421 || originalcode == 421)
 	lostpeer (0);
       if (abrtflag && oldintr != cmdabort && oldintr != SIG_IGN)
 	(*oldintr) (SIGINT);
-      return (n - '0');
+      return n;
     }
 }
 
diff --git a/ftpd/auth.c b/ftpd/auth.c
index 1270faa..db9668d 100644
--- a/ftpd/auth.c
+++ b/ftpd/auth.c
@@ -47,25 +47,31 @@
 int
 auth_user (const char *name, struct credentials *pcred)
 {
+  int err = 0;		/* Never remove initialisation!  */
+
   pcred->guest = 0;
 
   switch (pcred->auth_type)
     {
 #ifdef WITH_LINUX_PAM
     case AUTH_TYPE_PAM:
-      return pam_user (name, pcred);
+      err = pam_user (name, pcred);
+      break;
 #endif
 #ifdef WITH_KERBEROS
     case AUTH_TYPE_KERBEROS:
-      return -1;
+      err = -1;
+      break;
 #endif
 #ifdef WITH_KERBEROS5
     case AUTH_TYPE_KERBEROS5:
-      return -1;
+      err = -1;
+      break;
 #endif
 #ifdef WITH_OPIE
     case AUTH_TYPE_OPIE:
-      return -1;
+      err = -1;
+      break;
 #endif
     case AUTH_TYPE_PASSWD:
     default:
@@ -80,7 +86,6 @@ auth_user (const char *name, struct credentials *pcred)
 	/* check for anonymous logging */
 	if (strcmp (name, "ftp") == 0 || strcmp (name, "anonymous") == 0)
 	  {
-	    int err = 0;
 	    if (checkuser (PATH_FTPUSERS, "ftp")
 		|| checkuser (PATH_FTPUSERS, "anonymous"))
 	      {
@@ -120,7 +125,7 @@ auth_user (const char *name, struct credentials *pcred)
 	    if (cp == NULL || checkuser (PATH_FTPUSERS, name))
 	      {
 		sprintf (pcred->message, "User %s access denied.", name);
-		return 1;
+		err = 1;
 	      }
 	  }
 	else
@@ -129,13 +134,16 @@ auth_user (const char *name, struct credentials *pcred)
 	    pcred->message = NULL;
 	    return 1;
 	  }
-	pcred->dochroot = checkuser (PATH_FTPCHROOT, pcred->name);
 	snprintf (pcred->message, len,
 		  "Password required for %s.", pcred->name);
-	return 0;
+	err = 0;
       }
     }
-  return -1;
+
+  if (err == 0)
+    pcred->dochroot = checkuser (PATH_FTPCHROOT, pcred->name);
+
+  return err;
 }
 
 int
diff --git a/ftpd/ftpd.c b/ftpd/ftpd.c
index d8a63d9..10a7871 100644
--- a/ftpd/ftpd.c
+++ b/ftpd/ftpd.c
@@ -98,6 +98,7 @@
 #include <glob.h>
 #include <argp.h>
 #include <error.h>
+#include <xgetcwd.h>
 
 #include <progname.h>
 #include <libinetutils.h>
@@ -556,14 +557,14 @@ main (int argc, char *argv[], char **envp)
       exit (EXIT_SUCCESS);
     }
 
-  /* Display a Welcome message if exists,
-     N.B. reply(220,) must follow.  */
-  display_file (PATH_FTPWELCOME, 220);
-
   hostname = localhost ();
   if (!hostname)
     perror_reply (550, "Local resource failure: malloc");
 
+  /* Display a Welcome message if it exists.
+     N.B. a reply(220,) must follow as continuation.  */
+  display_file (PATH_FTPWELCOME, 220);
+
   /* Tell them we're ready to roll.  */
   if (!no_version)
     reply (220, "%s FTP server (%s %s) ready.",
@@ -584,7 +585,7 @@ static char *
 curdir (void)
 {
   static char *path = 0;
-  extern char *xgetcwd (void);
+
   free (path);
   path = xgetcwd ();
   if (!path)
@@ -645,6 +646,8 @@ sgetsave (const char *s)
 static void
 complete_login (struct credentials *pcred)
 {
+  char *cwd;
+
   if (setegid ((gid_t) pcred->gid) < 0)
     {
       reply (550, "Can't set gid.");
@@ -677,28 +680,38 @@ complete_login (struct credentials *pcred)
 	  reply (550, "Can't change root.");
 	  goto bad;
 	}
-      setenv ("HOME", pcred->homedir, 1);
     }
-  else if (chdir (pcred->rootdir) < 0)
+
+  if (seteuid ((uid_t) pcred->uid) < 0)
     {
-      if (chdir ("/") < 0)
+      reply (550, "Can't set uid.");
+      goto bad;
+    }
+
+  if (!pcred->guest && !pcred->dochroot)	/* Remaining case.  */
+    {
+      if (chdir (pcred->rootdir) < 0)
 	{
-	  reply (530, "User %s: can't change directory to %s.",
-		 pcred->name, pcred->homedir);
-	  goto bad;
+	  if (chdir ("/") < 0)
+	    {
+	      reply (530, "User %s: can't change directory to %s.",
+		     pcred->name, pcred->homedir);
+	      goto bad;
+	    }
+
+	  lreply (230, "No directory! Logging in with home=/");
 	}
-      else
-	lreply (230, "No directory! Logging in with home=/");
     }
 
-  if (seteuid ((uid_t) pcred->uid) < 0)
+  cwd = xgetcwd ();
+  if (cwd)
     {
-      reply (550, "Can't set uid.");
-      goto bad;
+      setenv ("HOME", cwd, 1);
+      free (cwd);
     }
 
   /* Display a login message, if it exists.
-     N.B. reply(230,) must follow the message.  */
+     N.B. a reply(230,) must follow after this message.  */
   display_file (PATH_FTPLOGINMESG, 230);
 
   if (pcred->guest)
@@ -832,6 +845,7 @@ end_login (struct credentials *pcred)
   memset (pcred, 0, sizeof (*pcred));
   pcred->remotehost = remotehost;
   pcred->auth_type = atype;
+  pcred->logged_in = 0;
 }
 
 void
@@ -1091,7 +1105,8 @@ getdatasock (const char *mode)
 	goto bad;
       sleep (tries);
     }
-  seteuid ((uid_t) cred.uid);
+  if (seteuid ((uid_t) cred.uid) != 0)
+    _exit (EXIT_FAILURE);
 
 #if defined IP_TOS && defined IPTOS_THROUGHPUT && defined IPPROTO_IP
   if (ctrl_addr.ss_family == AF_INET)
@@ -1106,7 +1121,8 @@ getdatasock (const char *mode)
 bad:
   /* Return the real value of errno (close may change it) */
   t = errno;
-  seteuid ((uid_t) cred.uid);
+  if (seteuid ((uid_t) cred.uid) != 0)
+    _exit (EXIT_FAILURE);;
   close (s);
   errno = t;
   return NULL;
@@ -1675,8 +1691,6 @@ cwd (const char *path)
 void
 makedir (const char *name)
 {
-  extern char *xgetcwd (void);
-
   LOGCMD ("mkdir", name);
   if (mkdir (name, 0777) < 0)
     perror_reply (550, name);
@@ -1712,8 +1726,8 @@ removedir (const char *name)
 void
 pwd (void)
 {
-  extern char *xgetcwd (void);
   char *path = xgetcwd ();
+
   if (path)
     {
       reply (257, "\"%s\" is current directory.", path);
@@ -1850,10 +1864,12 @@ passive (int epsv, int af)
   seteuid ((uid_t) 0);
   if (bind (pdata, (struct sockaddr *) &pasv_addr, pasv_addrlen) < 0)
     {
-      seteuid ((uid_t) cred.uid);
+      if (seteuid ((uid_t) cred.uid))
+	_exit (EXIT_FAILURE);
       goto pasv_error;
     }
-  seteuid ((uid_t) cred.uid);
+  if (seteuid ((uid_t) cred.uid))
+    _exit (EXIT_FAILURE);
   pasv_addrlen = sizeof (pasv_addr);
   if (getsockname (pdata, (struct sockaddr *) &pasv_addr, &pasv_addrlen) < 0)
     goto pasv_error;

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

Summary of changes:
 ChangeLog   |   34 ++++++++++++++++++++++++++
 ftp/ftp.c   |   12 ++++----
 ftpd/auth.c |   26 +++++++++++++-------
 ftpd/ftpd.c |   76 ++++++++++++++++++++++++++++++++++------------------------
 ftpd/pam.c  |   11 +++++---
 5 files changed, 108 insertions(+), 51 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Oct 19 09:43:53 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TPCrh-0003Vp-UH
	for mharc-commit-inetutils@gnu.org; Fri, 19 Oct 2012 09:43:53 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39294)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TPCra-0003UD-JV
	for commit-inetutils@gnu.org; Fri, 19 Oct 2012 09:43:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TPCrQ-00018M-NO
	for commit-inetutils@gnu.org; Fri, 19 Oct 2012 09:43:46 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:38007)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TPCrQ-00018G-Jm
	for commit-inetutils@gnu.org; Fri, 19 Oct 2012 09:43:36 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TPCrP-0001UH-QE
	for commit-inetutils@gnu.org; Fri, 19 Oct 2012 13:43:36 +0000
Date: Fri, 19 Oct 2012 13:43:35 +0000
Message-Id: <E1TPCrP-0001UH-QE@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-192-g728b8f7
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 430bcddb8ca05fe57a9fbe1119732f9b77b58fe3
X-Git-Newrev: 728b8f78c398b64c9e8c87aef883d83391c49482
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, 19 Oct 2012 13:43:53 -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  728b8f78c398b64c9e8c87aef883d83391c49482 (commit)
      from  430bcddb8ca05fe57a9fbe1119732f9b77b58fe3 (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=728b8f78c398b64c9e8c87aef883d83391c49482


commit 728b8f78c398b64c9e8c87aef883d83391c49482
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Oct 19 15:32:45 2012 +0200

    syslogd: Portability of utmp reading.

diff --git a/ChangeLog b/ChangeLog
index 4a3b957..b7f87fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-10-19  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	syslogd: Portability of utmp.  Disclosed by Solaris 11.
+
+	* src/syslogd.c (wallmsg): Call read_utmp() with the
+	file argument UTMP_FILE, not PATH_UTMP.
+	* talkd/process.c (find_user): Likewise.
+
+	* tests/syslogd.sh (USER): New variable.
+	<verbose mode>: Add a stanza to the configuration file
+	for passing all messages also to user $USER.
+
 2012-10-18  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftpd: Properly close a user session.
diff --git a/src/syslogd.c b/src/syslogd.c
index f184459..4008967 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -1524,7 +1524,7 @@ wallmsg (struct filed *f, struct iovec *iov)
   if (reenter++)
     return;
 
-  read_utmp (PATH_UTMP, &utmp_count, &utmpbuf,
+  read_utmp (UTMP_FILE, &utmp_count, &utmpbuf,
 	     READ_UTMP_USER_PROCESS | READ_UTMP_CHECK_PIDS);
 
   for (utp = utmpbuf; utp < utmpbuf + utmp_count; utp++)
diff --git a/talkd/process.c b/talkd/process.c
index 4b180f0..7107135 100644
--- a/talkd/process.c
+++ b/talkd/process.c
@@ -186,7 +186,7 @@ find_user (char *name, char *tty)
   status = NOT_HERE;
   strcpy (ftty, PATH_DEV);
 
-  read_utmp (PATH_UTMP, &utmp_count, &utmpbuf,
+  read_utmp (UTMP_FILE, &utmp_count, &utmpbuf,
 	     READ_UTMP_USER_PROCESS | READ_UTMP_CHECK_PIDS);
 
   for (uptr = utmpbuf; uptr < utmpbuf + utmp_count; uptr++)
diff --git a/tests/syslogd.sh b/tests/syslogd.sh
index 08f8cb7..c91a485 100755
--- a/tests/syslogd.sh
+++ b/tests/syslogd.sh
@@ -64,6 +64,7 @@ fi
 
 # Portability fix for SVR4
 PWD="${PWD:-`pwd`}"
+USER="${USER:-`id -u -n`}"
 
 $need_mktemp || exit_no_mktemp
 $need_netstat || exit_no_netstat
@@ -314,6 +315,9 @@ cat > "$CONF" <<-EOT
 	*.	/dev/null
 EOT
 
+# Add a user recipient in verbose mode.
+$silence false || echo "*.*	$USER" >> "$CONF"
+
 # Set REMOTE_LOGHOST to activate forwarding
 #
 if [ -n "$REMOTE_LOGHOST" ]; then

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

Summary of changes:
 ChangeLog        |   12 ++++++++++++
 src/syslogd.c    |    2 +-
 talkd/process.c  |    2 +-
 tests/syslogd.sh |    4 ++++
 4 files changed, 18 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Oct 26 09:09:07 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TRjet-0000GM-Cx
	for mharc-commit-inetutils@gnu.org; Fri, 26 Oct 2012 09:09:07 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37350)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TRjen-0000G9-IM
	for commit-inetutils@gnu.org; Fri, 26 Oct 2012 09:09:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TRjel-0004wW-M2
	for commit-inetutils@gnu.org; Fri, 26 Oct 2012 09:09:01 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:41143)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TRjel-0004wR-IO
	for commit-inetutils@gnu.org; Fri, 26 Oct 2012 09:08:59 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TRjej-0007Tn-QR
	for commit-inetutils@gnu.org; Fri, 26 Oct 2012 13:08:58 +0000
Date: Fri, 26 Oct 2012 13:08:58 +0000
Message-Id: <E1TRjej-0007Tn-QR@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-193-gcc2173d
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 728b8f78c398b64c9e8c87aef883d83391c49482
X-Git-Newrev: cc2173d24f4c905b05c58e61ace0095f0deb1354
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, 26 Oct 2012 13:09:06 -0000

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

The branch, master has been updated
       via  cc2173d24f4c905b05c58e61ace0095f0deb1354 (commit)
      from  728b8f78c398b64c9e8c87aef883d83391c49482 (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=cc2173d24f4c905b05c58e61ace0095f0deb1354


commit cc2173d24f4c905b05c58e61ace0095f0deb1354
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Tue Oct 23 19:58:02 2012 +0200

    ftpd: PAM messaging robustness.

diff --git a/ChangeLog b/ChangeLog
index b7f87fe..2ff9f4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2012-10-23  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftpd: PAM robustness.  Fine tune message passing,
+	since the finite state automata of FTP can choke
+	on some multiline messages.
+
+	* ftpd/extern.h (lreply_multiline): New prototype.
+	* ftpd/ftpd.c (user): Transmit a reply containing
+	only a single line, cutting at the last newline.
+	(pass): If the credential of an authenticated user
+	contains a message, reply using lreply_multiline().
+	(lreply_multiline): New function.
+	* ftpd/pam.c (PAM_conv): Insert a newline character
+	between concatenated message strings.  Remove only
+	trailing whitespace, leaving any colon untouched.
+	(pam_doit): Compare message string to `password:',
+	including a colon.
+
 2012-10-19  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	syslogd: Portability of utmp.  Disclosed by Solaris 11.
diff --git a/ftpd/extern.h b/ftpd/extern.h
index 7012be6..a10317d 100644
--- a/ftpd/extern.h
+++ b/ftpd/extern.h
@@ -66,6 +66,7 @@ extern FILE *ftpd_popen (char *, const char *);
 extern char *getusershell (void);
 #endif
 extern void lreply (int, const char *, ...);
+extern void lreply_multiline (int n, const char *text);
 extern void makedir (const char *);
 extern void nack (const char *);
 extern void pass (const char *);
diff --git a/ftpd/ftpd.c b/ftpd/ftpd.c
index 5ba5e24..11a69fb 100644
--- a/ftpd/ftpd.c
+++ b/ftpd/ftpd.c
@@ -795,7 +795,20 @@ user (const char *name)
 
   if (cred.message)
     {
-      reply (331, "%s", cred.message);
+      /* Stacked PAM modules for authentication may have
+       * produced a multiline message at this point.
+       * The FTP protocol does not cope well with this,
+       * so we transfer only the very last line, which
+       * should reflect the active authentication mechanism.
+       */
+      char *msg = strrchr (cred.message, '\n');
+
+      if (msg)
+	msg++;		/* Step over separator.  */
+      else
+	msg = cred.message;
+
+      reply (331, "%s", msg);
       free (cred.message);
       cred.message = NULL;
     }
@@ -883,6 +896,15 @@ pass (const char *passwd)
 	    }
 	  return;
 	}
+      if (cred.message)
+	{
+	  /* At least PAM might have committed additional messages.
+	   * Reply code 230 is used, since at this point the client
+	   * has been accepted.  */
+	  lreply_multiline (230, cred.message);
+	  free (cred.message);
+	  cred.message = NULL;
+	}
     }
   cred.logged_in = 1;		/* Everything seems to be allright.  */
   complete_login (&cred);
@@ -1638,6 +1660,42 @@ lreply (int n, const char *fmt, ...)
     }
 }
 
+/* Send a possibly multiline reply as individual
+ * lines of message with identical status code.
+ * No format string input!
+ */
+void
+lreply_multiline (int n, const char *text)
+{
+  char *line;
+
+  line = strdup (text);
+  if (line == NULL)
+    return;
+  else
+    {
+      int stop = 0;
+      char *p1 = line, *p2;
+
+      do
+	{
+	  p2 = strchrnul (p1, '\n');
+	  stop = (*p2 == '\0');		/* End of input string?  */
+	  *p2 = '\0';
+	  printf ("%d- ", n);
+	  printf ("%s\r\n", p1);
+	  if (debug)
+	    {
+	      syslog (LOG_DEBUG, "<--- %d- ", n);
+	      syslog (LOG_DEBUG, "%s", p1);
+	    }
+	  p1 = ++p2;			/* P1 is used within bounds.  */
+	}
+      while (!stop);
+      free (line);
+    }
+}
+
 static void
 ack (const char *s)
 {
diff --git a/ftpd/pam.c b/ftpd/pam.c
index babb48d..ff08a7c 100644
--- a/ftpd/pam.c
+++ b/ftpd/pam.c
@@ -113,11 +113,18 @@ PAM_conv (int num_msg, const struct pam_message **msg,
 	     in the ftpd.c:user() or ftpd.c:pass() check for it and send
 	     a lreply().  But I'm not sure the RFCs allow mutilines replies
 	     for a passwd challenge.  Many clients will simply break.  */
+	  /* XXX: Attempted solution; collect all messages, appended
+	   * one after the other, separated by "\n".  Then print all
+	   * of them in one single run.  This will circumvent the hard
+	   * coded protocol convention of not allowing continuation
+	   * massage to carry a deviating reply code relative to the
+	   * final message.
+	   */
 	  if (pcred->message)	/* XXX: make sure we split newlines correctly */
 	    {
 	      size_t len = strlen (pcred->message);
 	      char *s = realloc (pcred->message, len
-				 + strlen (msg[count]->msg) + 1);
+				 + strlen (msg[count]->msg) + 2);
 	      if (s == NULL)
 		{
 		  free (pcred->message);
@@ -126,6 +133,7 @@ PAM_conv (int num_msg, const struct pam_message **msg,
 	      else
 		{
 		  pcred->message = s;
+		  strcat (pcred->message, "\n");
 		  strcat (pcred->message, msg[count]->msg);
 		}
 	    }
@@ -137,10 +145,9 @@ PAM_conv (int num_msg, const struct pam_message **msg,
 	  else
 	    {
 	      char *sp;
-	      /* FIXME:  What's this for ? */
-	      /* Remove trailing `: ' */
+	      /* Remove trailing space only.  */
 	      sp = pcred->message + strlen (pcred->message);
-	      while (sp > pcred->message && strchr (" \t\n:", *--sp))
+	      while (sp > pcred->message && strchr (" \t\n", *--sp))
 		*sp = '\0';
 	    }
 	}
@@ -180,7 +187,7 @@ pam_doit (struct credentials *pcred)
     {
       /* Avoid overly terse passwd messages and let the people
          upstairs do something sane.  */
-      if (pcred->message && !strcasecmp (pcred->message, "password"))
+      if (pcred->message && !strcasecmp (pcred->message, "password:"))
 	{
 	  free (pcred->message);
 	  pcred->message = NULL;

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

Summary of changes:
 ChangeLog     |   18 +++++++++++++++++
 ftpd/extern.h |    1 +
 ftpd/ftpd.c   |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 ftpd/pam.c    |   17 +++++++++++----
 4 files changed, 90 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Sun Oct 28 07:15:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TSQpm-0005f3-Fn
	for mharc-commit-inetutils@gnu.org; Sun, 28 Oct 2012 07:15:14 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33680)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TSQpk-0005ex-DU
	for commit-inetutils@gnu.org; Sun, 28 Oct 2012 07:15:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TSQpj-0002PE-84
	for commit-inetutils@gnu.org; Sun, 28 Oct 2012 07:15:12 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:40624)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1TSQpj-0002P0-4y
	for commit-inetutils@gnu.org; Sun, 28 Oct 2012 07:15:11 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1TSQpi-0002Bd-FQ
	for commit-inetutils@gnu.org; Sun, 28 Oct 2012 11:15:10 +0000
Date: Sun, 28 Oct 2012 11:15:10 +0000
Message-Id: <E1TSQpi-0002Bd-FQ@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_1-194-ge1c5c58
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: cc2173d24f4c905b05c58e61ace0095f0deb1354
X-Git-Newrev: e1c5c5849a6a26e52d32cfd5c9d75d881a9c497f
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: Sun, 28 Oct 2012 11:15: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  e1c5c5849a6a26e52d32cfd5c9d75d881a9c497f (commit)
      from  cc2173d24f4c905b05c58e61ace0095f0deb1354 (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=e1c5c5849a6a26e52d32cfd5c9d75d881a9c497f


commit e1c5c5849a6a26e52d32cfd5c9d75d881a9c497f
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sun Oct 28 11:52:08 2012 +0100

    ftpd: Glob overflow and dereference.

diff --git a/ChangeLog b/ChangeLog
index 2ff9f4c..489f5a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-28  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* ftpd/popen.c (ftpd_popen): Prevent null deference
+	and allocation overflow in access to glob patterns.
+
 2012-10-23  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftpd: PAM robustness.  Fine tune message passing,
diff --git a/ftpd/popen.c b/ftpd/popen.c
index 8cc6857..f67d4e2 100644
--- a/ftpd/popen.c
+++ b/ftpd/popen.c
@@ -131,8 +131,8 @@ ftpd_popen (char *program, const char *type)
       memset (&gl, 0, sizeof (gl));
       if (glob (argv[argc], flags, NULL, &gl))
 	gargv[gargc++] = strdup (argv[argc]);
-      else
-	for (pop = gl.gl_pathv; *pop; pop++)
+      else if (gl.gl_pathc > 0)
+	for (pop = gl.gl_pathv; *pop && (gargc < MAX_GARGC - 1); pop++)
 	  gargv[gargc++] = strdup (*pop);
       globfree (&gl);
     }

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

Summary of changes:
 ChangeLog    |    5 +++++
 ftpd/popen.c |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


